Express + Prisma backend for user auth and personal notes.
- Copy env file:
cp .env.example .env
- Fill in
DATABASE_URL,JWT_SECRET, andCLIENT_URL. - Install and migrate:
npm install npm run db:migrate npm run db:seed
- Run:
npm run dev
npm install
npm run db:migrate:deploy
npm startSet NODE_ENV=production and provide env vars from your host (do not ship .env).
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /health |
No | Health check |
| POST | /auth/register |
No | Register |
| POST | /auth/login |
No | Login |
| POST | /auth/logout |
No | Clear auth cookie |
| GET | /notes/all-notes |
Yes | List notes (?page=&limit=) |
| GET | /notes/note/:id |
Yes | Get one note |
| POST | /notes/create-note |
Yes | Create note |
| PUT | /notes/update-note/:id |
Yes | Update note |
| DELETE | /notes/delete-note/:id |
Yes | Delete note |
Auth accepts Authorization: Bearer <token> or the jwt httpOnly cookie.