9drive 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +389 -0
- package/backend/dist/app.js +113 -0
- package/backend/dist/config/env.js +75 -0
- package/backend/dist/config/prisma.js +30 -0
- package/backend/dist/middleware/api-key.middleware.js +38 -0
- package/backend/dist/middleware/auth.middleware.js +21 -0
- package/backend/dist/middleware/error.middleware.js +7 -0
- package/backend/dist/modules/api-keys/api-key.routes.js +90 -0
- package/backend/dist/modules/audit-logs/audit-log.routes.js +20 -0
- package/backend/dist/modules/auth/auth.routes.js +201 -0
- package/backend/dist/modules/cdn/cdn.routes.js +105 -0
- package/backend/dist/modules/connected-accounts/connected-account.routes.js +313 -0
- package/backend/dist/modules/files/file.routes.js +1013 -0
- package/backend/dist/modules/files/stream-file.js +10 -0
- package/backend/dist/modules/files/stream-google-file.js +79 -0
- package/backend/dist/modules/folders/folder.routes.js +546 -0
- package/backend/dist/modules/google/google.service.js +485 -0
- package/backend/dist/modules/invites/invite.routes.js +127 -0
- package/backend/dist/modules/provider-configs/provider-config.routes.js +53 -0
- package/backend/dist/modules/public/public.routes.js +44 -0
- package/backend/dist/modules/public-api/public-api.routes.js +8 -0
- package/backend/dist/modules/s3/s3.service.js +104 -0
- package/backend/dist/modules/storage/storage.routes.js +108 -0
- package/backend/dist/modules/system/system.routes.js +663 -0
- package/backend/dist/modules/uploads/upload.routes.js +569 -0
- package/backend/dist/scripts/debug-query.js +19 -0
- package/backend/dist/scripts/seed-google-config-if-present.js +49 -0
- package/backend/dist/scripts/seed-google-config.js +40 -0
- package/backend/dist/scripts/test-api-upload.js +37 -0
- package/backend/dist/scripts/test-external-upload.js +181 -0
- package/backend/dist/scripts/test-s3-connection.js +33 -0
- package/backend/dist/server.js +7 -0
- package/backend/dist/utils/audit.js +20 -0
- package/backend/dist/utils/crypto.js +33 -0
- package/backend/dist/utils/jwt.js +15 -0
- package/backend/dist/utils/password.js +14 -0
- package/backend/prisma/generated/sqlite-client/client.d.ts +1 -0
- package/backend/prisma/generated/sqlite-client/client.js +5 -0
- package/backend/prisma/generated/sqlite-client/default.d.ts +1 -0
- package/backend/prisma/generated/sqlite-client/default.js +5 -0
- package/backend/prisma/generated/sqlite-client/edge.d.ts +1 -0
- package/backend/prisma/generated/sqlite-client/edge.js +436 -0
- package/backend/prisma/generated/sqlite-client/index-browser.js +422 -0
- package/backend/prisma/generated/sqlite-client/index.d.ts +35178 -0
- package/backend/prisma/generated/sqlite-client/index.js +457 -0
- package/backend/prisma/generated/sqlite-client/package.json +183 -0
- package/backend/prisma/generated/sqlite-client/query_engine-windows.dll.node +0 -0
- package/backend/prisma/generated/sqlite-client/query_engine_bg.js +2 -0
- package/backend/prisma/generated/sqlite-client/query_engine_bg.wasm +0 -0
- package/backend/prisma/generated/sqlite-client/runtime/edge-esm.js +35 -0
- package/backend/prisma/generated/sqlite-client/runtime/edge.js +35 -0
- package/backend/prisma/generated/sqlite-client/runtime/index-browser.d.ts +370 -0
- package/backend/prisma/generated/sqlite-client/runtime/index-browser.js +17 -0
- package/backend/prisma/generated/sqlite-client/runtime/library.d.ts +3982 -0
- package/backend/prisma/generated/sqlite-client/runtime/library.js +147 -0
- package/backend/prisma/generated/sqlite-client/runtime/react-native.js +84 -0
- package/backend/prisma/generated/sqlite-client/runtime/wasm-compiler-edge.js +85 -0
- package/backend/prisma/generated/sqlite-client/runtime/wasm-engine-edge.js +38 -0
- package/backend/prisma/generated/sqlite-client/schema.prisma +354 -0
- package/backend/prisma/generated/sqlite-client/wasm-edge-light-loader.mjs +5 -0
- package/backend/prisma/generated/sqlite-client/wasm-worker-loader.mjs +5 -0
- package/backend/prisma/generated/sqlite-client/wasm.d.ts +1 -0
- package/backend/prisma/generated/sqlite-client/wasm.js +443 -0
- package/backend/prisma/migrations/20260604084325_init/migration.sql +191 -0
- package/backend/prisma/migrations/20260604090020_global_provider_config/migration.sql +8 -0
- package/backend/prisma/migrations/20260604091957_virtual_folders/migration.sql +32 -0
- package/backend/prisma/migrations/20260604095418_nested_folders/migration.sql +8 -0
- package/backend/prisma/migrations/20260604095705_file_shares/migration.sql +22 -0
- package/backend/prisma/migrations/20260604100802_file_preview_tokens/migration.sql +20 -0
- package/backend/prisma/migrations/20260604120000_add_file_share_token/migration.sql +3 -0
- package/backend/prisma/migrations/20260604130000_workspace_invites/migration.sql +17 -0
- package/backend/prisma/migrations/20260604133000_invite_targets/migration.sql +9 -0
- package/backend/prisma/migrations/20260605090000_query_indexes/migration.sql +12 -0
- package/backend/prisma/migrations/20260605100000_folder_icons/migration.sql +1 -0
- package/backend/prisma/migrations/20260605110000_google_auth_handoff/migration.sql +22 -0
- package/backend/prisma/migrations/20260611120000_s3_storage_support/migration.sql +31 -0
- package/backend/prisma/migrations/20260611130000_upload_routing_policy/migration.sql +14 -0
- package/backend/prisma/migrations/20260611140000_api_keys/migration.sql +21 -0
- package/backend/prisma/migrations/20260630030000_upload_session_resumable_fields/migration.sql +9 -0
- package/backend/prisma/migrations/migration_lock.toml +3 -0
- package/backend/prisma/schema.prisma +353 -0
- package/backend/prisma/schema.sqlite.prisma +354 -0
- package/backend/public/assets/index-B4ifIM_G.js +135 -0
- package/backend/public/assets/index-DwOPZrmt.css +2 -0
- package/backend/public/assets/ort-wasm-simd-threaded.jsep-D5Jk56-t.wasm +0 -0
- package/backend/public/assets/ort.bundle.min-CpXgll2e.js +2746 -0
- package/backend/public/assets/ort.bundle.min-OfoG_cy9.mjs +2817 -0
- package/backend/public/assets/ort.webgpu.bundle.min-C1vdBqT7.js +2746 -0
- package/backend/public/assets/ort.webgpu.bundle.min-CEayb2S6.mjs +2817 -0
- package/backend/public/assets/pdf.worker.min-Dswkl-cV.mjs +29 -0
- package/backend/public/favicon.ico +74 -0
- package/backend/public/favicon.svg +74 -0
- package/backend/public/icons.svg +24 -0
- package/backend/public/index.html +34 -0
- package/backend/public/manifest.webmanifest +1 -0
- package/backend/public/maskable-icon.svg +22 -0
- package/backend/public/pwa-192x192.svg +22 -0
- package/backend/public/pwa-512x512.svg +22 -0
- package/backend/public/registerSW.js +1 -0
- package/backend/public/sw.js +1 -0
- package/backend/public/workbox-9c191d2f.js +1 -0
- package/bin/9drive.js +320 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or
|
|
41
|
+
Object form, that is based on (or derived from) the Work and for
|
|
42
|
+
which the editorial revisions, annotations, elaborations, or other
|
|
43
|
+
modifications represent, as a whole, an original work of authorship.
|
|
44
|
+
For the purposes of this License, Derivative Works shall not include
|
|
45
|
+
works that remain separable from, or merely link (or bind by name) to
|
|
46
|
+
the interfaces of, the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute
|
|
108
|
+
must include a readable copy of the attribution notices
|
|
109
|
+
contained within such NOTICE file, excluding those notices
|
|
110
|
+
that do not pertain to any part of the Derivative Works, in
|
|
111
|
+
at least one of the following places: within a NOTICE file
|
|
112
|
+
distributed as part of the Derivative Works; within the Source
|
|
113
|
+
form or documentation, if provided along with the Derivative
|
|
114
|
+
Works; or, within a display generated by the Derivative Works,
|
|
115
|
+
if and wherever such third-party notices normally appear.
|
|
116
|
+
The contents of the NOTICE file are for informational purposes
|
|
117
|
+
only and do not modify the License. You may add Your own
|
|
118
|
+
attribution notices within Derivative Works that You distribute,
|
|
119
|
+
alongside or as an addendum to the NOTICE text from the Work,
|
|
120
|
+
provided that such additional attribution notices cannot be
|
|
121
|
+
construed as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions for
|
|
125
|
+
use, reproduction, or distribution of Your modifications, or for any
|
|
126
|
+
such Derivative Works as a whole, provided Your use, reproduction,
|
|
127
|
+
and distribution of the Work otherwise complies with the conditions
|
|
128
|
+
stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing
|
|
141
|
+
the origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor has
|
|
163
|
+
been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer, and
|
|
167
|
+
charge a fee for, acceptance of support, warranty, indemnity, or
|
|
168
|
+
other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Zenhosta
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# 9Drive — Virtual Cloud Storage & Client-Side Productivity Suite
|
|
4
|
+
|
|
5
|
+
[](package.json)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[]()
|
|
8
|
+
|
|
9
|
+
**9Drive** adalah platform virtual cloud storage gateway modern yang menggabungkan banyak akun **Google Drive** dan **S3-Compatible Storage** (Cloudflare R2, MinIO, Wasabi, AWS S3, Backblaze B2) ke dalam satu dashboard terpadu bergaya **Google Drive Material Design 3 (MD3)**.
|
|
10
|
+
|
|
11
|
+
Dilengkapi dengan **High-Performance CDN Media Gateway**, **External Upload API**, serta **Client-Side Productivity Tools Suite** lengkap (alat olah PDF, AI Hapus Background Gambar, Ekstraksi Audio Video, dan Utilitas Data) yang berjalan 100% di browser secara aman, cepat, dan terintegrasi langsung dengan penyimpanan Drive Anda.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 🌟 Fitur Utama & Pembaruan Terkini
|
|
16
|
+
|
|
17
|
+
Repositori ini telah disesuaikan dan dikembangkan dengan penambahan serangkaian fitur produktivitas mutakhir:
|
|
18
|
+
|
|
19
|
+
### 1. 🎨 Antarmuka Google Drive Material Design 3 (MD3)
|
|
20
|
+
- **Tampilan Otentik Google Drive**: Navigasi sidebar dengan indikator pill aktif, floating search bar, breadcrumbs folder dinamis, surface elevation, dan palet warna resmi Google Drive (`#0B57D0`, background neutral, rounded cards).
|
|
21
|
+
- **Drive Account Selector Terpadu**: Dropdown pemilih akun Drive langsung di navbar untuk memfilter tampilan berkas berdasarkan akun Google Drive tertentu atau menampilkan semua akun sekaligus.
|
|
22
|
+
- **Global Search Bar Cerdas**: Pencarian instan berkas dan folder dilengkapi filter cepat berdasarkan tipe berkas (Dokumen, Gambar, Video, PDF, ZIP), rentang tanggal modifikasi, dan akun penyimpanan.
|
|
23
|
+
- **Sistem Notifikasi Floating Toast (`ToastContext`)**: Notifikasi mengambang yang responsif dan interaktif untuk memberikan konfirmasi aksi (unggah, hapus, salin tautan, mutasi berkas) tanpa mengganggu alur kerja pengguna.
|
|
24
|
+
- **Menu Konteks Klik Kanan Lengkap (*Right-Click Context Menu*)**:
|
|
25
|
+
- **Menu Berkas**: Buka di Tools Suite, Salin Tautan CDN, Pratinjau, Unduh, Ganti Nama, Pindahkan, Bagikan, Berbintang (Star), Laci Detail, Hapus ke Sampah.
|
|
26
|
+
- **Menu Folder**: Buka Folder, Bagikan, Ganti Nama, Pindahkan, Info Detail, Hapus.
|
|
27
|
+
- **Menu Ruang Kosong (*Canvas Area*)**: Klik kanan pada area kosong untuk langsung mengunggah berkas, mengunggah folder, atau membuat folder baru.
|
|
28
|
+
- **Laci Detail Berkas (*File Details Drawer*)**:
|
|
29
|
+
- Menampilkan pratinjau thumbnail visual, metadata teknis (ukuran berkas, tipe MIME, lokasi folder, tanggal pembuatan/modifikasi, akun pemilik).
|
|
30
|
+
- Tombol aksi instan untuk membuka berkas langsung ke dalam modul **Tools Suite** (PDF Tools, Image Tools, Remove BG) atau menyalin tautan publik CDN.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
### 2. 🛠️ Productivity & Tools Suite (100% Client-Side & Privasi Terjaga)
|
|
35
|
+
Pusat alat pengolah dokumen dan multimedia yang berjalan sepenuhnya di browser client (tanpa membebani CPU server atau mengirim berkas pribadi ke pihak ketiga):
|
|
36
|
+
|
|
37
|
+
#### 📄 PDF Suite (`/tools/pdf`)
|
|
38
|
+
- **Merge PDF**: Menggabungkan beberapa berkas PDF menjadi satu dokumen berurutan sesuai susunan yang ditentukan.
|
|
39
|
+
- **Split PDF**: Memecah halaman PDF atau mengekstrak rentang halaman tertentu menjadi berkas tersendiri.
|
|
40
|
+
- **Compress PDF**: Mengurangi ukuran dokumen PDF agar hemat penyimpanan dan cepat dibagikan tanpa merusak keterbacaan teks.
|
|
41
|
+
- **JPG ke PDF**: Mengonversi dan merangkai sekumpulan foto (JPG, PNG, WebP) menjadi satu berkas album PDF yang rapi.
|
|
42
|
+
- **PDF ke Gambar (JPG/PNG)**: Mengekstrak setiap lembar halaman dokumen PDF menjadi berkas gambar resolusi tinggi dengan pratinjau instan.
|
|
43
|
+
- **Rotate PDF**: Memutar orientasi lembar dokumen PDF yang terbalik (90°, 180°, 270°) secara serentak.
|
|
44
|
+
- **Watermark PDF**: Membubuhkan stempel teks hak cipta atau tanda keamanan kustom (contoh: *RAHASIA*, *DRAFT*) pada lembar PDF.
|
|
45
|
+
|
|
46
|
+
#### 🖼️ AI & Image Suite (`/tools/image` & `/tools/remove-bg`)
|
|
47
|
+
- **Hapus Background AI (`/tools/remove-bg`)**:
|
|
48
|
+
- Menghapus latar belakang foto manusia atau produk secara otomatis dan instan menggunakan model AI langsung di browser (`@imgly/background-removal`).
|
|
49
|
+
- Dilengkapi slider perbandingan **Before/After** interaktif.
|
|
50
|
+
- Opsi penggantian background kustom: transparan (PNG), palet warna solid, atau latar belakang gambar kustom.
|
|
51
|
+
- **Kompres Gambar**: Mengecilkan ukuran foto JPG, PNG, dan WebP hingga 80% dengan kualitas visual optimal.
|
|
52
|
+
- **Potong Foto / Pas Foto**: Pemotongan gambar dengan preset rasio resmi (Pas Foto 3:4, 4:6, Persegi 1:1, atau rasio bebas).
|
|
53
|
+
- **Konversi Format Gambar**: Konversi format berkas secara batch antara WebP, PNG, dan JPG.
|
|
54
|
+
- **Ubah Ukuran (Resize)**: Menyesuaikan dimensi piksel atau persentase skala dengan pengunci rasio aspek (*aspect-ratio lock*).
|
|
55
|
+
- **Watermark Foto**: Menambahkan cap teks hak cipta pada posisi tengah atau sudut berkas secara batch.
|
|
56
|
+
|
|
57
|
+
#### 🎬 Video & Audio Suite (`/tools/video`)
|
|
58
|
+
- **Ekstrak Audio Video**: Mengambil dan mengubah suara dari video (MP4, WebM, MOV) menjadi berkas audio jernih (`.wav`) langsung di browser.
|
|
59
|
+
|
|
60
|
+
#### 📊 Utilitas Data & Berkas (`/tools/data`)
|
|
61
|
+
- **CSV ⇄ JSON Converter**: Konversi dua arah data tabel CSV dan format JSON secara instan dengan auto-formatting rapi.
|
|
62
|
+
- **File Hash & Checksum**: Menghitung sidik jari digital (SHA-256) berkas untuk memverifikasi keaslian dan integritas dokumen.
|
|
63
|
+
- **Base64 Encoder / Decoder**: Mengubah berkas atau gambar menjadi teks kode data Base64 untuk kebutuhan embedding web atau konfigurasi.
|
|
64
|
+
|
|
65
|
+
#### 🔄 Integrasi Seamless dengan 9Drive
|
|
66
|
+
- **Drive File Picker Modal**: Ambil berkas langsung dari folder 9Drive untuk langsung diproses di dalam tools tanpa perlu mengunduh ke komputer lokal terlebih dahulu.
|
|
67
|
+
- **Save Destination Modal**: Simpan hasil olahan tools langsung kembali ke folder 9Drive yang dipilih, atau unduh ke perangkat lokal sebagai file tunggal maupun arsip ZIP otomatis.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
### 3. ⚡ High-Performance CDN Media Gateway (`/cdn`)
|
|
72
|
+
Gerbang pengiriman media berkinerja tinggi untuk kebutuhan embedding gambar, video, dan berkas statis:
|
|
73
|
+
- **Tautan Streaming & Pratinjau Publik**:
|
|
74
|
+
- `GET /cdn/view/:id`: Pengiriman berkas dengan header `inline` disposition. Sangat optimal untuk tag HTML `<img>`, `<video>`, audio player, maupun pratinjau dokumen di web eksternal.
|
|
75
|
+
- `GET /cdn/raw/:id`: Pengiriman berkas dengan header `attachment` untuk unduhan langsung.
|
|
76
|
+
- **Dukungan HTTP 206 Partial Content (Range Requests)**: Memungkinkan penonton video atau pendengar audio melakukan seeking/scrubbing timeline tanpa harus mengunduh keseluruhan berkas.
|
|
77
|
+
- **Mekanisme Caching Agresif**: Mendukung header `ETag`, `Last-Modified`, validasi `If-None-Match` (HTTP 304 Not Modified), serta `Cache-Control: public, max-age=31536000, immutable` untuk menghemat bandwidth server.
|
|
78
|
+
- **Dynamic Open CORS**: Mengizinkan akses lintas domain (`*`) khusus untuk jalur `/cdn`, `/api`, dan `/public`.
|
|
79
|
+
- **One-Click CDN Link & Embed Modal**: Generator kode siap pakai di antarmuka (Direct URL, Tag HTML `<img>`, dan sintaks Markdown).
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### 4. 🔌 External Upload API & Developer Hub (`/api`)
|
|
84
|
+
- **Manajemen API Key Terpadu (`/api`)**:
|
|
85
|
+
- Pembuatan API Key aman dengan hashing token (SHA-256) di database dan tampilan rahasia satu kali (*one-time secret modal*).
|
|
86
|
+
- Pembatasan izin akses (*scope permissions*, misalnya `files:upload`).
|
|
87
|
+
- Pemantauan waktu penggunaan terakhir (*last-used tracking*) dan pencabutan kunci (*revocation*).
|
|
88
|
+
- **Endpoint Unggah Publik**: `POST /api/v1/uploads` dengan otentikasi header `X-API-Key` atau `Authorization: Bearer <API_KEY>`.
|
|
89
|
+
- **Dokumentasi SDK Interaktif In-App**: Contoh kode siap pakai untuk cURL, Node.js (fetch & axios), Python, PHP, dan Bash testing script bawaan (`test-external-upload.ts`).
|
|
90
|
+
- **Target Folder & Routing Fleksibel**: Berkas eksternal dapat diarahkan langsung ke ID folder virtual tertentu serta mengikuti kebijakan alokasi akun penyimpanan yang aktif.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
### 5. ☁️ Multi-Account & Storage Gateway
|
|
95
|
+
- **Multi-Account Google Drive**: Hubungkan beberapa akun Google Drive dalam satu akun 9Drive untuk menggabungkan total kapasitas penyimpanan cloud.
|
|
96
|
+
- **S3-Compatible Storage Gateway**: Mendukung integrasi MinIO, Cloudflare R2, Wasabi, Backblaze B2, dan AWS S3.
|
|
97
|
+
- **Upload Routing Policies**: Kebijakan alokasi unggahan cerdas:
|
|
98
|
+
- *Most-Available*: Mengunggah ke akun dengan sisa kuota terbesar.
|
|
99
|
+
- *Round-Robin*: Distribusi bergantian secara merata antar akun.
|
|
100
|
+
- *Priority-Order*: Memenuhi akun utama terlebih dahulu sebelum beralih ke akun sekunder.
|
|
101
|
+
- **Direct Stream Upload**: Berkas dialirkan langsung (*piped stream*) dari pengguna ke Google Drive / S3 storage gateway tanpa pernah disimpan di disk lokal server.
|
|
102
|
+
- **Quota Tracker**: Visualisasi pemakaian penyimpanan, persentase kuota, dan breakdown kapasitas per akun.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
### 6. 🔗 Smart Sharing & Permission System
|
|
107
|
+
- **Dialog Berbagi Interaktif (`ShareModal`)**:
|
|
108
|
+
- Konfigurasi izin akses: *Restricted* (hanya akun tertentu) atau *Anyone with the link* (publik).
|
|
109
|
+
- Penentuan hak akses: *Viewer*, *Commenter*, dan *Editor*.
|
|
110
|
+
- **Deteksi Izin Warisan (*Inherited Permission Origin*)**: Secara otomatis mendeteksi jika suatu berkas mewarisi status publik dari folder induknya, serta menyediakan opsi langsung untuk mengatur izin folder asalnya.
|
|
111
|
+
- **Halaman Berbagi (`/shared`)**: Tampilan tab terpisah untuk berkas yang dibagikan kepada Anda (*Shared with me*) dan berkas yang Anda bagikan ke orang lain (*Shared by me*).
|
|
112
|
+
- **Halaman Berbintang (`/starred`) & Sampah (`/trash`)**: Manajemen berkas favorit yang terhubung ke Google Drive API, serta pemulihan atau penghapusan permanen dari tempat sampah.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
### 7. ⚙️ Manajemen Konfigurasi & Pembaruan Sistem
|
|
117
|
+
- **Konfigurasi Google OAuth via UI**: Input Google Client ID, Client Secret, dan Redirect URI langsung melalui halaman **Settings -> Google Credentials** di dashboard tanpa wajib menjalankan seed manual terminal. Kredensial dienkripsi aman (AES-256) di database MySQL.
|
|
118
|
+
- **Automated In-App Updates (PM2)**: Menu pembaruan sistem sekali klik di UI Settings yang menjalankan git pull, migrasi Prisma, build aset, dan restart layanan backend otomatis dengan monitor log langsung.
|
|
119
|
+
- **Monorepo Dev Runner**: Satu perintah di root workspace untuk menjalankan frontend dan backend secara bersamaan.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## 📁 Struktur Direktori Repositori
|
|
124
|
+
|
|
125
|
+
```txt
|
|
126
|
+
9drive/
|
|
127
|
+
├── backend/ # API Server (Express + TypeScript + Prisma)
|
|
128
|
+
│ ├── prisma/ # Skema database & file migrasi MySQL
|
|
129
|
+
│ └── src/
|
|
130
|
+
│ ├── config/ # Konfigurasi env & Prisma client
|
|
131
|
+
│ ├── middleware/ # Otentikasi JWT, API Key, dan error handler
|
|
132
|
+
│ ├── modules/
|
|
133
|
+
│ │ ├── api-keys/ # Pengelolaan API Key developer
|
|
134
|
+
│ │ ├── audit-logs/ # Pencatatan riwayat aktivitas pengguna
|
|
135
|
+
│ │ ├── auth/ # Registrasi, login, dan refresh token
|
|
136
|
+
│ │ ├── cdn/ # High-performance CDN media streaming gateway
|
|
137
|
+
│ │ ├── connected-accounts/ # Manajemen multi-akun Google Drive
|
|
138
|
+
│ │ ├── files/ # Manipulasi berkas, streaming, dan preview
|
|
139
|
+
│ │ ├── folders/ # Virtual folder tree management
|
|
140
|
+
│ │ ├── google/ # Integrasi Google Drive API & OAuth
|
|
141
|
+
│ │ ├── public-api/ # Endpoint REST API publik (/api/v1/uploads)
|
|
142
|
+
│ │ ├── storage/ # Ringkasan kuota dan manajemen penyimpanan
|
|
143
|
+
│ │ ├── system/ # Updater otomatis & status sistem
|
|
144
|
+
│ │ └── uploads/ # Multi-part upload streaming engine
|
|
145
|
+
│ └── scripts/ # Script pengujian upload eksternal & seeding
|
|
146
|
+
│
|
|
147
|
+
├── frontend/ # Aplikasi Web Client (React 18 + Vite + Tailwind/MD3)
|
|
148
|
+
│ └── src/
|
|
149
|
+
│ ├── components/
|
|
150
|
+
│ │ ├── drive/ # UI Google Drive MD3 (FileGrid, ContextMenu, Drawer, ShareModal, dll)
|
|
151
|
+
│ │ ├── tools/ # UI Tools Suite (Picker, BeforeAfterPreview, SaveDestination, Icons)
|
|
152
|
+
│ │ └── ui/ # Komponen atomik UI (Buttons, Inputs, Dialogs, Cards)
|
|
153
|
+
│ ├── context/ # State context (DriveFilter, UploadManager, ToastNotification)
|
|
154
|
+
│ ├── layouts/ # Layout utama Drive (Sidebar, Header, Main Content Area)
|
|
155
|
+
│ ├── lib/tools/ # Core engine tools (PDF, Image, Video-to-audio, Background removal AI)
|
|
156
|
+
│ └── pages/
|
|
157
|
+
│ ├── tools/ # Halaman Tools Hub, PDF View, Image View, Video View, Data View, RemoveBG
|
|
158
|
+
│ ├── AllFilesPage.tsx
|
|
159
|
+
│ ├── ApiManagementPage.tsx
|
|
160
|
+
│ ├── QuotaTrackerPage.tsx
|
|
161
|
+
│ ├── SettingsPage.tsx
|
|
162
|
+
│ ├── SharedPage.tsx
|
|
163
|
+
│ ├── StarredPage.tsx
|
|
164
|
+
│ └── TrashPage.tsx
|
|
165
|
+
│
|
|
166
|
+
├── setup.ps1 # Script setup otomatis untuk Windows PowerShell
|
|
167
|
+
├── setup.sh # Script setup otomatis untuk Linux/macOS
|
|
168
|
+
├── docker-compose.yml # Orchestration Docker (MySQL + Backend + Frontend)
|
|
169
|
+
└── package.json # Monorepo root dev runner (concurrently)
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## 💻 Prasyarat Sistem
|
|
175
|
+
|
|
176
|
+
- **Node.js**: Versi 20 LTS atau lebih baru
|
|
177
|
+
- **NPM**: Versi 10+
|
|
178
|
+
- **MySQL**: Versi 8.0+ berjalan secara lokal atau via Docker
|
|
179
|
+
- **Google Cloud Project**:
|
|
180
|
+
- Mengaktifkan **Google Drive API**
|
|
181
|
+
- Mengonfigurasi **OAuth Consent Screen**
|
|
182
|
+
- Membuat **OAuth 2.0 Client ID** (Web Application)
|
|
183
|
+
|
|
184
|
+
Default basis data MySQL yang digunakan pada development lokal:
|
|
185
|
+
```txt
|
|
186
|
+
Host: localhost
|
|
187
|
+
Port: 3306
|
|
188
|
+
Database: 9drive
|
|
189
|
+
User: root
|
|
190
|
+
Password: (kosong / sesuaikan dengan konfigurasi MySQL Anda)
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## 🚀 Panduan Instalasi & Menjalankan Proyek
|
|
196
|
+
|
|
197
|
+
### Cara 1: Setup Otomatis Menggunakan Script (Direkomendasikan)
|
|
198
|
+
|
|
199
|
+
Script setup akan secara otomatis memasang seluruh dependensi backend dan frontend, membuat berkas `.env` dengan token acak yang aman, serta membuat skema database Prisma.
|
|
200
|
+
|
|
201
|
+
#### Windows (PowerShell)
|
|
202
|
+
Buka PowerShell di direktori `9drive`:
|
|
203
|
+
```powershell
|
|
204
|
+
powershell -ExecutionPolicy Bypass -File .\setup.ps1
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
#### Linux / macOS
|
|
208
|
+
Buka Terminal di direktori `9drive`:
|
|
209
|
+
```bash
|
|
210
|
+
chmod +x ./setup.sh
|
|
211
|
+
./setup.sh
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
### Cara 2: Setup Manual & Menjalankan Monorepo
|
|
217
|
+
|
|
218
|
+
#### 1. Pasang Dependensi
|
|
219
|
+
Dari direktori root proyek `9drive`:
|
|
220
|
+
```bash
|
|
221
|
+
# Pasang dependensi monorepo runner
|
|
222
|
+
npm install
|
|
223
|
+
|
|
224
|
+
# Pasang dependensi backend dan frontend
|
|
225
|
+
npm run install:all
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
#### 2. Buat Basis Data MySQL
|
|
229
|
+
Pastikan server MySQL Anda telah aktif, lalu buat basis data:
|
|
230
|
+
```sql
|
|
231
|
+
CREATE DATABASE IF NOT EXISTS 9drive;
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
#### 3. Konfigurasi Berkas Environment
|
|
235
|
+
Salin konfigurasi default atau buat berkas `backend/.env`:
|
|
236
|
+
```env
|
|
237
|
+
DATABASE_URL="mysql://root@localhost:3306/9drive"
|
|
238
|
+
APP_PORT=4000
|
|
239
|
+
FRONTEND_URL="http://localhost:5173"
|
|
240
|
+
JWT_ACCESS_SECRET="ganti-dengan-secret-jwt-acak-minimal-32-karakter"
|
|
241
|
+
TOKEN_ENCRYPTION_KEY="kunci-enkripsi-tepat-32-karakter-key!"
|
|
242
|
+
ACCESS_TOKEN_TTL_SECONDS=900
|
|
243
|
+
REFRESH_TOKEN_TTL_DAYS=30
|
|
244
|
+
MAX_UPLOAD_BYTES=5368709120
|
|
245
|
+
RECAPTCHA_SECRET_KEY=""
|
|
246
|
+
|
|
247
|
+
# (Opsional) Kredensial Google OAuth juga dapat diisi langsung via UI Settings
|
|
248
|
+
GOOGLE_CLIENT_ID=""
|
|
249
|
+
GOOGLE_CLIENT_SECRET=""
|
|
250
|
+
GOOGLE_REDIRECT_URI="http://localhost:4000/connected-accounts/google/callback"
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Buat berkas `frontend/.env`:
|
|
254
|
+
```env
|
|
255
|
+
VITE_API_URL=http://localhost:4000
|
|
256
|
+
VITE_RECAPTCHA_SITE_KEY=
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
#### 4. Jalankan Migrasi Database Prisma
|
|
260
|
+
```bash
|
|
261
|
+
cd backend
|
|
262
|
+
npm run prisma:migrate
|
|
263
|
+
cd ..
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
#### 5. Jalankan Development Server (Monorepo)
|
|
267
|
+
Jalankan satu perintah di folder root `9drive` untuk memulai backend dan frontend secara bersamaan:
|
|
268
|
+
```bash
|
|
269
|
+
npm run dev
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Aplikasi dapat langsung diakses pada:
|
|
273
|
+
- **Frontend Dashboard**: [http://localhost:5173](http://localhost:5173)
|
|
274
|
+
- **Backend API & CDN**: [http://localhost:4000](http://localhost:4000)
|
|
275
|
+
|
|
276
|
+
*(Opsional jika ingin menjalankan terpisah: `npm run dev:backend` dan `npm run dev:frontend`)*
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
### Cara 3: Menjalankan Menggunakan Docker Compose
|
|
281
|
+
|
|
282
|
+
1. Siapkan berkas `.env` dari template Docker:
|
|
283
|
+
```bash
|
|
284
|
+
cp .env.docker.example .env
|
|
285
|
+
```
|
|
286
|
+
2. Sesuaikan konfigurasi di `.env` (isi password MySQL, kredensial Google, dan secret token).
|
|
287
|
+
3. Bangun dan jalankan seluruh container:
|
|
288
|
+
```bash
|
|
289
|
+
docker compose up -d --build
|
|
290
|
+
```
|
|
291
|
+
4. Layanan akan berjalan pada:
|
|
292
|
+
- Frontend: `http://localhost:5173`
|
|
293
|
+
- Backend: `http://localhost:4000`
|
|
294
|
+
- MySQL: `localhost:3306`
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## 🌐 Konfigurasi Google Cloud Console
|
|
299
|
+
|
|
300
|
+
1. Buka [Google Cloud Console](https://console.cloud.google.com/).
|
|
301
|
+
2. Buat atau pilih proyek Google Cloud Anda.
|
|
302
|
+
3. Buka **APIs & Services** -> **Library**, cari **Google Drive API**, lalu klik **Enable**.
|
|
303
|
+
4. Buka **APIs & Services** -> **OAuth consent screen**:
|
|
304
|
+
- Pilih jenis pengguna: **External**.
|
|
305
|
+
- Masukkan nama aplikasi dan email dukungan pengembang.
|
|
306
|
+
- Tambahkan scopes berikut:
|
|
307
|
+
```txt
|
|
308
|
+
https://www.googleapis.com/auth/drive
|
|
309
|
+
https://www.googleapis.com/auth/userinfo.email
|
|
310
|
+
https://www.googleapis.com/auth/userinfo.profile
|
|
311
|
+
```
|
|
312
|
+
- Di bagian **Test users**, tambahkan alamat email Google yang akan digunakan untuk pengujian aplikasi.
|
|
313
|
+
5. Buka **APIs & Services** -> **Credentials**:
|
|
314
|
+
- Klik **Create Credentials** -> **OAuth client ID**.
|
|
315
|
+
- Pilih tipe: **Web application**.
|
|
316
|
+
- **Authorized JavaScript origins**:
|
|
317
|
+
```txt
|
|
318
|
+
http://localhost:5173
|
|
319
|
+
```
|
|
320
|
+
- **Authorized redirect URIs**:
|
|
321
|
+
```txt
|
|
322
|
+
http://localhost:4000/connected-accounts/google/callback
|
|
323
|
+
```
|
|
324
|
+
- Simpan dan salin **Client ID** serta **Client Secret**.
|
|
325
|
+
6. Simpan kredensial tersebut ke dalam aplikasi melalui menu **Settings** -> **Google Credentials** pada dashboard 9Drive.
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## 📡 Ringkasan Endpoint API
|
|
330
|
+
|
|
331
|
+
### Otentikasi & Akun
|
|
332
|
+
- `POST /auth/register` — Pendaftaran akun pengguna baru
|
|
333
|
+
- `POST /auth/login` — Masuk dengan email & kata sandi
|
|
334
|
+
- `GET /auth/google/url` — Inisiasi login cepat via Google
|
|
335
|
+
- `POST /auth/google/exchange` — Pertukaran kode otentikasi Google
|
|
336
|
+
- `POST /auth/refresh` — Memperbarui token akses JWT
|
|
337
|
+
- `GET /auth/me` — Mendapatkan profil pengguna saat ini
|
|
338
|
+
|
|
339
|
+
### CDN Media Streaming
|
|
340
|
+
- `GET /cdn/view/:id` — Streaming media publik inline (untuk tag `<img>`, video player, dll)
|
|
341
|
+
- `GET /cdn/raw/:id` — Unduhan langsung berkas publik (attachment disposition)
|
|
342
|
+
- `GET /cdn/:id` — Redirect otomatis ke endpoint view
|
|
343
|
+
|
|
344
|
+
### Developer Public API
|
|
345
|
+
- `POST /api/v1/uploads` — Mengunggah berkas menggunakan API Key (`X-API-Key`)
|
|
346
|
+
|
|
347
|
+
### Manajemen Berkas & Folder
|
|
348
|
+
- `GET /files` — Mendapatkan daftar berkas (mendukung parameter `folderId`, `q`, `mimeType`, `accountId`)
|
|
349
|
+
- `POST /uploads` — Mengunggah berkas ke Drive/S3 via dashboard (multipart streaming)
|
|
350
|
+
- `PATCH /files/:id` — Mengubah nama atau metadata berkas
|
|
351
|
+
- `DELETE /files/:id` — Memindahkan berkas ke sampah atau menghapus permanen
|
|
352
|
+
- `POST /files/:id/share` — Membuat tautan berbagi publik
|
|
353
|
+
- `GET /folders` — Mendapatkan susunan pohon folder virtual
|
|
354
|
+
- `POST /folders` — Membuat folder virtual baru
|
|
355
|
+
|
|
356
|
+
### Penyimpanan & Akun Terhubung
|
|
357
|
+
- `GET /connected-accounts` — Daftar akun Google Drive & S3 yang terhubung
|
|
358
|
+
- `GET /storage/summary` — Statistik agregasi total kuota dan penggunaan penyimpanan
|
|
359
|
+
- `POST /connected-accounts/:id/sync-quota` — Sinkronisasi ulang kuota dari Google Drive
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
## 🔒 Catatan Keamanan
|
|
364
|
+
|
|
365
|
+
1. **Keamanan Streaming**: Berkas unggahan dialirkan langsung (*piped stream*) dari antarmuka ke cloud provider target. Server backend tidak pernah menyimpan salinan berkas di disk lokal.
|
|
366
|
+
2. **Enkripsi Kredensial**: Token akses OAuth, refresh token Google, dan API secret disimpan dalam database MySQL menggunakan enkripsi AES-256 (`TOKEN_ENCRYPTION_KEY`).
|
|
367
|
+
3. **Penyimpanan Token Sesi**: Hash SHA-256 digunakan untuk menyimpan token refresh dan API Key, mencegah kebocoran kredensial mentah saat terjadi database dump.
|
|
368
|
+
4. **Isolasi Lingkungan**: Berkas `.env` telah didaftarkan dalam `.gitignore` dan tidak boleh di-commit ke repositori publik.
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
## 🛠️ Build untuk Produksi
|
|
373
|
+
|
|
374
|
+
Untuk menghasilkan bundle produksi:
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
# Build frontend dan backend secara bersamaan
|
|
378
|
+
npm run build
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
Bundle produksi yang dihasilkan:
|
|
382
|
+
- **Backend**: Berada di `backend/dist` (dijalankan dengan `node dist/server.js`)
|
|
383
|
+
- **Frontend**: Berada di `frontend/dist` (dapat disajikan via Nginx atau static file server)
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
## 📄 Lisensi
|
|
388
|
+
|
|
389
|
+
Didistribusikan di bawah lisensi Apache 2.0. Lihat berkas [LICENSE](LICENSE) untuk informasi lisensi selengkapnya.
|