A modern file storage solution with a distributed architecture.
Neup Drive consists of two separate applications:
-
Main Application (Next.js):
- Handles User Interface, Authentication, File Management, and Metadata.
- Generates signed tokens for uploads.
- Located in the root directory.
-
CDN Gateway (Go):
- A high-performance, standalone microservice for handling file uploads and downloads.
- Located in
neupcdn/. - Accepts file chunks directly from the client.
npm install
npm run devStarts the Next.js app on http://localhost:3000.
Open a new terminal:
cd neupcdn
go mod tidy
go run main.goStarts the Go CDN on http://localhost:3001 (ensure PORT is configured in neupcdn/.env).
- Browser -> Main App: Request upload (
POST /bridge/api.v1/drive/upload/init). - Main App: Validates request and returns a signed token.
- Browser -> CDN: Uploads file chunks (
PUT /upload) using the token. - CDN -> Main App: Calls webhook (
POST /bridge/webhook.v1/upload/callback) upon completion. - Main App: Marks file as verified.
The CDN is API-only. Hitting https://neupcdn.com/ returns a JSON 404 response.
PUT /uploadGET /listPOST /operate/movePOST /operate/renamePOST /operate/deleteGET /files/{accountId}/{type}/{relativePath}
Ensure both applications share the same UPLOAD_SECRET_KEY for token verification.
UPLOAD_SECRET_KEY=super-secret-key
CDN_URL=http://localhost:3001/uploadPORT=3001
UPLOAD_SECRET_KEY=super-secret-key
CALLBACK_URL=http://localhost:3000/bridge/webhook.v1/upload/callback
PUBLIC_ROOT=../cdn_data