CampusFlow is a secure, premium campus event management application built to streamline department registrations, ticket payments, attendance tracking, and On-Duty (OD) authorization workflows. The project features a photography-first, Apple-inspired design system with modular role dashboards for students, volunteers, coordinators, and administrators.
- Frontend: React (TypeScript), Material UI (MUI), Vite, Axios, React Router.
- Backend: Node.js, Express, TypeScript, Prisma, PostgreSQL, Zod validation.
- Tools & Libraries: PDF-Kit for batch OD generation, QRCode/SVG generator, Docker.
- Interactive Event Directory: Users can filter, search, and register for department events (free or paid).
- Robust Ticketing & Payments:
- Students submit bank/UPI transaction references for paid events.
- Organizers view submissions and approve/reject registrations manually (preventing self-verification bypasses).
- Unpaid seats are automatically expired after 15 minutes to release blocked seats.
- FIFO Waitlist Queue: Event cancellation automatically promotes waitlisted students in FIFO order, handles payments (if applicable), and issues notifications.
- QR Attendance Scanning:
- Students access HMAC-signed QR tickets from their registrations. A ticket is minted once, at registration, and stays valid — it is scannable from 12 hours before the event until 12 hours after it ends, so registering weeks in advance works exactly as expected.
- Assigned gate volunteers scan codes to record attendance. Strict authorization checks ensure only assigned volunteers, hosts, co-hosts, coordinators, HODs, or admins can scan, and duplicate scans are rejected.
- Batch On-Duty (OD) Generation:
- Department heads approve check-in logs.
- Batch generator produces authenticated PDF OD certificates with verification keys, allowing HODs to retry any failed generation attempts individually or in bulk, and to revoke a letter issued in error.
- Public OD Verification: Every certificate carries a verification ID and a scannable QR pointing at
/verify/:verificationId— a public page, requiring no account, that confirms whether a printed letter is genuine and whether it has been revoked. - Automatic Event Lifecycle: A background sweep advances events past their scheduled start and end (
APPROVED → ONGOING → COMPLETED), releases unpaid seat holds after 15 minutes, and sends reminders to registered students the day before. Attendance sign-off and OD issuance stay manual — those are human decisions. - Platform Administration: Admins can manage departments, adjust user roles (including Head of Department), and monitor system-wide audits.
Transcribed from design-template.md. The tokens live in frontend/src/theme/tokens.ts
and the MUI theme is built from them in frontend/src/theme/createAppTheme.ts — nothing
should inline a hex, a radius, or a font size outside those two files.
- One accent, and only one: Action Blue (
#0066cc) on light surfaces, Sky Link Blue (#2997ff) on dark ones, carrying every interactive element. Status colours exist to describe state (a rejected payment, a full event) and never to invite a click. - Surfaces, not shadows: the MUI shadow scale is flattened to
none. Elevation comes from a surface changing colour or a backdrop blur on something that genuinely floats. The single drop shadow in the system is reserved for imagery resting on a tile. - Two navigation strips: a slim always-black global nav (44px) over a frosted parchment sub-nav (52px), with content running full width beneath them.
- Type ladder: 56 / 40 / 34 / 28 / 24 / 21 / 17 / 14 / 12 / 10 at weights 300, 400 and 600 only. Body copy runs at 17px, not 16. SF Pro resolves natively on Apple platforms; Inter is the substitute elsewhere.
- Radii grammar: pill (
9999px) for anything that reads as an action,18pxfor cards and dialogs,11pxfor inputs,8pxfor compact utility,0for full-bleed tiles. - Responsive dark mode: light/dark persisted in
localStorage, defaulting to the system preference, toggled from the global nav.
Ensure a PostgreSQL database is running. Update backend/.env with your connection string:
PORT=5000
DATABASE_URL="postgresql://<user>:<password>@localhost:5432/campusflow_db?schema=public"
JWT_SECRET=your_jwt_secret
JWT_REFRESH_SECRET=your_jwt_refresh_secret
QR_SECRET=your_qr_signing_secret
FRONTEND_URL=http://localhost:5173
ALLOWED_ORIGINS=http://localhost:5173
DISABLE_AUTO_OD_GENERATION=false
UPLOAD_DIR=uploads
# Optional: outbound notification email. Without SMTP configured, development falls
# back to an Ethereal test inbox and logs to the console.
SMTP_HOST=
SMTP_PORT=587
SMTP_USER=
SMTP_PASS=
SMTP_FROM=no-reply@campusflow.localFRONTEND_URL matters in production: it is the origin printed on, and encoded into the
QR of, every On-Duty certificate's public verification link.
See backend/.env.example and frontend/.env.example for the complete list.
- Navigate to the backend directory:
cd backend - Install dependencies:
npm install
- Run migrations and database seed:
npx prisma migrate dev npx prisma db seed
- Start development server:
npm run dev
- Navigate to the frontend directory:
cd ../frontend - Install dependencies:
npm install
- Start development server:
npm run dev
- Lockdown Role Escalations: Registration role is restricted to
Role.STUDENTduring creation to prevent administrative escalations. - Zod Sanitization: Express validation middleware mutates original request objects with parsed schema output.
- CORS Allowed Origins: Strict CORS validation checking incoming request origins against an allowed whitelist.
- Production Guard: Boot verification requiring configuration of secret keys in production environment.
- Scanner Restrictions: Verification of gate scan credentials against assigned active volunteers, event hosts, co-hosts, club coordinators, department heads (HODs), and administrators.