Skip to main content
NamPost
Back
NamPost sandbox documentation
Docs
Developer setup

Developer setup

Clone the repo, configure environment variables, run migrations, and start the app locally.

Prerequisites

  • Node.js 18+ (see .nvmrc if you use nvm)
  • 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 install

Copy .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:

LayerEnv fileVariablesCode path
Next.js (Auth.js, React Email).env.localRESEND_API_KEY, RESEND_FROM_EMAIL, RESEND_FROM_NAMElib/config/index.tslib/email/send.ts, auth.providers.email.ts, lib/gdpr-emails.ts
FastAPI + Celerybackend/.envRESEND_API_KEY, EMAIL_FROMbackend/app/utils/email.py, backend/app/tasks/email_tasks.py, licensing notifications

Setup checklist

  1. Create an API key at resend.com/api-keys.
  2. Add and verify your sending domain in the Resend dashboard (DNS records).
  3. Set RESEND_FROM_EMAIL to an address on that domain (e.g. noreply@yourdomain.com).
  4. Copy the same RESEND_API_KEY into backend/.env and set EMAIL_FROM to the same address as RESEND_FROM_EMAIL.
  5. Smoke test from the repo root: npm run email:hello (uses lib/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 generate

Optional seed data for demo users and sandbox entities:

npm run db:seed

Development

npm run dev

Open 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