Skip to content

About

Manage college events end-to-end - registrations, approvals, attendance scanning, and OD letters. Built with React, Node.js, and PostgreSQL.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

CampusFlow — Campus Event & On-Duty Management System

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.


Technical Stack

  • 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.

Core Features

  1. Interactive Event Directory: Users can filter, search, and register for department events (free or paid).
  2. 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.
  3. FIFO Waitlist Queue: Event cancellation automatically promotes waitlisted students in FIFO order, handles payments (if applicable), and issues notifications.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. Platform Administration: Admins can manage departments, adjust user roles (including Head of Department), and monitor system-wide audits.

Design System (Apple-inspired)

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, 18px for cards and dialogs, 11px for inputs, 8px for compact utility, 0 for full-bleed tiles.
  • Responsive dark mode: light/dark persisted in localStorage, defaulting to the system preference, toggled from the global nav.

Getting Started

Database Configuration

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.local

FRONTEND_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.

Backend Setup

  1. Navigate to the backend directory:
    cd backend
  2. Install dependencies:
    npm install
  3. Run migrations and database seed:
    npx prisma migrate dev
    npx prisma db seed
  4. Start development server:
    npm run dev

Frontend Setup

  1. Navigate to the frontend directory:
    cd ../frontend
  2. Install dependencies:
    npm install
  3. Start development server:
    npm run dev

Security Controls Implemented (In Fix Pass)

  • Lockdown Role Escalations: Registration role is restricted to Role.STUDENT during 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.

About

Manage college events end-to-end - registrations, approvals, attendance scanning, and OD letters. Built with React, Node.js, and PostgreSQL.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages