Developer setup
Clone the repo, configure environment variables, run migrations, and start the app locally.
Prerequisites
- Node.js 18+ (see
.nvmrcif you usenvm) - PostgreSQL connection string (e.g. Neon) for Prisma
- Google OAuth credentials (for NextAuth sign-in)
- Resend API key (for transactional email, if enabled)
Install
npm installCopy .env.example to .env.local and fill in DATABASE_URL, AUTH_SECRET, GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, RESEND_API_KEY, RESEND_FROM_EMAIL, RESEND_FROM_NAME (optional display name), and NEXT_PUBLIC_APP_URL.
Resend (transactional email)
Resend powers magic-link sign-in, password reset, GDPR notices, and optional smoke tests. You need one API key in two places for full-stack email:
| Layer | Env file | Variables | Code path |
|---|---|---|---|
| Next.js (Auth.js, React Email) | .env.local | RESEND_API_KEY, RESEND_FROM_EMAIL, RESEND_FROM_NAME | lib/config/index.ts → lib/email/send.ts, auth.providers.email.ts, lib/gdpr-emails.ts |
| FastAPI + Celery | backend/.env | RESEND_API_KEY, EMAIL_FROM | backend/app/utils/email.py, backend/app/tasks/email_tasks.py, licensing notifications |
Setup checklist
- Create an API key at resend.com/api-keys.
- Add and verify your sending domain in the Resend dashboard (DNS records).
- Set
RESEND_FROM_EMAILto an address on that domain (e.g.noreply@yourdomain.com). - Copy the same
RESEND_API_KEYintobackend/.envand setEMAIL_FROMto the same address asRESEND_FROM_EMAIL. - Smoke test from the repo root:
npm run email:hello(useslib/email.ts).
Until a domain is verified, Resend often only delivers to the account owner’s inbox. Check resend.com/emails for bounces and domain errors.
Production gate: npm run validate:production-env (or tsx scripts/validate-production-env.ts) requires RESEND_API_KEY; set RESEND_FROM_EMAIL before go-live.
Database
npx prisma migrate deploy
npx prisma generateOptional seed data for demo users and sandbox entities:
npm run db:seedDevelopment
npm run devOpen http://localhost:4000. Marketing routes are public; participant, regulator, and digital-sandbox routes require sign-in with the appropriate role.
Production build
npm run lint
npm run build
npm run start