NestJS + Prisma backend for the Armenia Service Map project.
- NestJS 11
- Prisma 7.5 + PostgreSQL
- JWT auth (access + refresh)
- MinIO/S3 presigned uploads
- SMTP email delivery (Mailcatcher in development)
- Node.js 22+
- npm 10+
- PostgreSQL available locally
- Install dependencies:
npm install- Copy and edit env values:
cp .env.example .envRequired env variables include:
DATABASE_URLJWT_ACCESS_SECRET,JWT_REFRESH_SECRETS3_ENDPOINT,S3_ACCESS_KEY,S3_SECRET_KEY,S3_BUCKET,S3_REGIONUPLOAD_MAX_IMAGE_BYTES,UPLOAD_MAX_DOCUMENT_BYTESMAIL_HOST,MAIL_PORT,MAIL_FROMPORT,CORS_ORIGINAUTO_DB_INITcontrols startup DB initialization (default enabled; setAUTO_DB_INIT=falseto disable)
Apply the current migration set and seed data:
npx prisma migrate reset --force
npx prisma db seedBy default, startup DB initialization is enabled. You can disable it with:
AUTO_DB_INIT=falseAt startup, the backend will:
- Run
prisma migrate deploy - Check
userstable row count - Run
prisma db seedonly when count is0
This prevents reseeding on normal restarts once users already exist.
Check migration status:
npx prisma migrate statusnpm run start:devAPI base URL (default): http://localhost:3000/api
All seeded users use password admin123:
- Super admin:
admin@refugeesupport.am - Org admin:
org-admin@refugeesupport.am - Org member (pending):
org-member@refugeesupport.am
Build and tests:
npm run build
npm test
npm run test:e2eFocused e2e suites for the backend foundation upgrade:
npm run test:e2e -- test/schema-foundation.e2e-spec.ts
npm run test:e2e -- test/auth-status.e2e-spec.ts
npm run test:e2e -- test/org-onboarding.e2e-spec.ts
npm run test:e2e -- test/needs-timeline-notifications.e2e-spec.ts
npm run test:e2e -- test/notifications-api.e2e-spec.ts
npm run test:e2e -- test/seed-smoke.e2e-spec.ts- E2E tests in
test/*.e2e-spec.tsare implemented withpgintegration queries for stable execution in this Jest environment. - The backend follows the layered structure:
api -> usecases -> modules -> infrastructure.