# 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.