Ticket registration + QR-based check-in system for DridCon.
client/: Next.js (App Router) frontend (admin, agent, attendee flows)server/: Express + MongoDB backend API (auth, admin, scanning)
- Node.js (recommended: 20+)
- pnpm
- MongoDB (local or hosted)
cd server
pnpm install
cp .env.example .env # if you create one; otherwise create server/.env manually
pnpm devThe backend serves:
- API:
http://localhost:3000/api/v1 - Swagger UI:
http://localhost:3000/api-docs - Uploads:
http://localhost:3000/uploads/...
Run the frontend on a different port than the backend.
cd client
pnpm install
# Option A (recommended): keep backend on 3000, run frontend on 3001
pnpm dev -- -p 3001
# Option B: run backend on 4000 (set server PORT=4000) and keep frontend on 3000Open the frontend:
http://localhost:3001
Backend environment variables are validated at startup in server/src/utils/validateEnv.ts.
Required:
NODE_ENV:development|test|productionPORT: backend port (default:3000)MONGODB_URI: Mongo connection stringFRONTEND_URL: full frontend origin, e.g.http://localhost:3001API_URL: public base URL of the backend, e.g.http://localhost:3000LOG_LEVEL:error|warn|info|http|verbose|debug|silly
JWT:
JWT_ACCESS_SECRETJWT_REFRESH_SECRET
Email (SMTP):
SMTP_HOSTSMTP_PORTSMTP_USERSMTP_PASSEMAIL_FROM: supportsName <email@domain.com>format
Admin bootstrap (used by pnpm seed:admin):
ADMIN_NAMEADMIN_EMAILADMIN_PASSWORD
The frontend reads the API base URL from:
NEXT_PUBLIC_API_URL(preferred)- or
NEXT_PUBLIC_API_BASE
Example:
NEXT_PUBLIC_API_URL=http://localhost:3000/api/v1Note: Next.js remotePatterns for images also relies on NEXT_PUBLIC_API_URL to allow loading uploaded images (e.g. QR codes) from the backend.
cd server
pnpm dev # ts-node + nodemon
pnpm build # tsc -> dist/
pnpm start # node dist/index.js
pnpm lint
pnpm lint:fix
pnpm seed:admincd client
pnpm dev
pnpm build
pnpm start
pnpm lintMounted under /api/v1:
/auth/*: registration/login/refresh/logout and invite flows/admin/*: admin dashboard, agents, attendee management/scan/*: agent QR scanning + check-in endpoints
Swagger UI is exposed at /api-docs.
Registration supports uploading a paymentProof file (JPEG/PNG, max 3MB). Uploaded files are served from /uploads.
- Port conflict: backend defaults to
3000and Next.js also defaults to3000. Run the frontend withpnpm dev -- -p 3001or change backendPORT. - CORS issues: ensure
FRONTEND_URLmatches the exact frontend origin (including port) and useshttp(s)://. - Swagger mismatch:
/api-docsrendersserver/swagger.yaml; if endpoints/servers don’t match/api/v1, update the spec accordingly.
See CONTRIBUTING.md.