- Node 22+
- Yarn
- Create
.envin project root with:
PORT=3000
NODE_ENV=development
DATABASE_URL=postgresql://neondb_owner:npg_GfUC7lYZ8teR@ep-patient-boat-adpmgbkf-pooler.c-2.us-east-1.aws.neon.tech/neondb?sslmode=require&channel_binding=require
JWT_SECRET=replace-with-a-long-random-secret
- Install dependencies and generate Prisma client:
yarn
yarn prisma:generate
- Run dev server with hot reload:
yarn dev
Swagger UI: http://localhost:3000/docs
Set a production server for Swagger dropdown:
SWAGGER_SERVER_URL=https://api.yourdomain.com
If not set, it defaults to http://localhost:PORT.
- Prisma:
- Edit schema:
prisma/schema.prisma - Push schema to DB:
yarn db:push - Create migration dev:
yarn prisma:migrate - Studio:
yarn prisma:studio
- Edit schema:
- POST
/api/auth/register{ email, password } - POST
/api/auth/login{ email, password } - GET
/api/auth/mewithAuthorization: Bearer <token>