From 0d17401286dd3b1d01b0940d2f0355a2ac95bb26 Mon Sep 17 00:00:00 2001 From: arsam Date: Fri, 18 Sep 2026 23:15:34 +0330 Subject: [PATCH] Import documentation: backend/README.md Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality. --- backend/README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 backend/README.md diff --git a/backend/README.md b/backend/README.md new file mode 100644 index 0000000..3cdce58 --- /dev/null +++ b/backend/README.md @@ -0,0 +1,30 @@ +# CShare Backend + +This is the local production-path API scaffold from `CONTINUE.md`. It uses Express 5 and TypeScript with local JSON metadata plus disk storage so upload, share, preview, download, dashboard, and auth flows work without external infrastructure. + +## Commands + +```sh +npm install +npm run dev +npm run check +npm test +npm run build +``` + +The API listens on `http://localhost:4001` by default. Frontend requests use `VITE_API_BASE_URL`; in production, the frontend falls back to same-origin API calls when the variable is omitted. + +## Implemented Locally + +- `GET /health` +- `POST /api/auth/register`, `POST /api/auth/login`, `POST /api/auth/refresh`, `POST /api/auth/logout`, `GET /api/auth/me` +- `POST /api/v1/files/upload` +- `GET /api/v1/files`, `GET /api/v1/files/:id`, `DELETE /api/v1/files/:id` +- `GET /api/v1/links/:linkId`, `GET /api/v1/links/:linkId/download` +- `GET /api/v1/links/:linkId/preview` +- `GET /api/v1/dashboard/stats` +- `GET /api/admin/overview`, `/api/admin/files`, `/api/admin/users`, `/api/admin/events` protected by `x-admin-key` + +## Production Adapters Still Needed + +The remaining roadmap items require provisioned services and credentials: PostgreSQL/Drizzle migrations, Redis/BullMQ, Cloudflare R2, Resend, Stripe, Sentry, PM2, Nginx, TLS, firewall rules, backups, and DNS. The local API keeps storage and persistence isolated so those adapters can replace the JSON/disk implementation without changing frontend routes.