Production Build
Deploying the application (not the docs — those are covered on the next page).
Build & run
bash
pnpm install
pnpm build # next build
pnpm start # serves the production build on port 3000Before first start in a new environment, apply the schema and (optionally) seed:
bash
pnpm db:push
pnpm db:seed # optional demo dataEnvironment variables
Set these in your host's environment (never commit them):
| Variable | Required | Notes |
|---|---|---|
DATABASE_URL | ✅ | Production PostgreSQL connection string. |
NEXTAUTH_SECRET | ✅ | Long random string (openssl rand -base64 32). |
NEXTAUTH_URL | ✅ | Your public URL, e.g. https://attendance.example.edu. |
RESEND_API_KEY, RESEND_FROM_EMAIL | optional | Only if email features are used. |
See Configuration for the full list.
Hosting notes
- Vercel is the most natural fit for Next.js (the repo includes Vercel/Prisma template env variables). Point it at a managed PostgreSQL provider (Neon, Supabase, RDS, etc.).
- HTTPS is required for QR scanning in the browser, so a production TLS certificate isn't optional — it's needed for the core feature to work off
localhost. @prisma/clientis configured as an external server package innext.config.ts; ensureprisma generateruns during the build (it runs viapostinstall).
Pre-launch checklist
- [ ] Strong, unique
NEXTAUTH_SECRETset - [ ]
NEXTAUTH_URLmatches the real domain - [ ] Database reachable; schema applied (
db:pushor migrations) - [ ] HTTPS enabled and verified
- [ ] Default seed passwords changed (or seed not run in production)
- [ ] A backup/restore procedure in place (see Database Setup)
- [ ] Consider replacing the in-memory login rate limiter for multi-instance deployments (see Limitations)