DigiPass is a secure, mobile-first web application designed to digitize, streamline, and secure the outpass leave approval process in college dormitories and hostels. It replaces archaic paper slip systems with a secure, cryptographically verifiable, role-based digital workflow.
In residential universities and hostels, tracking the movements of students in and out of campus is vital for safety, accountability, and administration. Traditional systems rely on paper outpasses signed by wardens and collected by security guards.
DigiPass solves these challenges by providing a fully digital process. Students request leave online, wardens approve or reject requests instantly, and security guards verify student exits and entries using a web-camera QR code scanner that validates the outpass token against the database in real-time.
- Forged Signatures: Paper passes are easily forged or tampered with.
- Poor Security Verification: Security guards at the gate cannot easily verify if a warden's signature is authentic or if the pass has expired.
- Lost & Illegible Records: Physical receipts are lost, damaged, or hard to read, creating a compliance and audit nightmare.
- Administrative Friction: Students waste hours searching for wardens to sign slips, and wardens lack high-level visibility over who is currently off-campus.
- Stateless Cryptographic Tokens: Outpasses generate unique, randomly generated 16-byte hex tokens encoded as secure QR codes upon warden approval.
- Real-Time Camera Scan Verification: Security guards scan the student's QR code using any smartphone or web camera. The system automatically cross-references validity windows in the database.
- Tamper-Proof Audit Trail: All entry and exit scans are logged permanently with timestamp, gate number, and guard ID, generating clean audit trails.
- Role-Based Dashboards: Customized interfaces optimized for Students, Wardens, Security Guards, and Administrators.
| Role | Core Responsibilities | Key Views |
|---|---|---|
| Student | Requests permissions, views pass status history, and displays QR codes at the gate. | Leave Request Form, Personal History list, QR Canvas |
| Warden | Reviews pending leave requests, approves/rejects passes, and monitors student records. | Warden Dashboard, Outpass Detail actions |
| Security Guard | Scans QR codes at physical gates, verifies validity, and logs exit and entry events. | Camera Scanner view, Verification Result screen |
| Admin | Manages system accounts, provisions user roles, and monitors system metrics. | Admin Dashboard, User Creator |
DigiPass uses a mobile-first, single-page application frontend that connects to an Express server and MongoDB.
+--------------------------------------------------------------+
| Frontend (React Client) |
| - Login / Dashboards - Outpass Forms - QR Code Canvas |
| - Protected Routing - Camera QR Code Scanner |
+--------------------------------------------------------------+
|
| JSON APIs / HTTPS
v
+--------------------------------------------------------------+
| Backend (Express REST API) |
| - JWT Auth Service - Outpass Coordinator |
| - QR Code Generator - Log & Audit Service |
+--------------------------------------------------------------+
|
| Mongoose ODM
v
+--------------------------------------------------------------+
| Database (MongoDB) |
| - Users Collection - Students/Wardens/Guards Metadata |
| - Outpasses Collection - Logs Collection |
+--------------------------------------------------------------+
For a detailed breakdown of architectural decisions, state-machines, request sequences, and implementation limits, see the Architecture Document.
The database schema utilizes Mongoose relationships. The system model inherits role-specific details from a base User document:
[Student Request] β [Warden Review] β [QR Generation] β [Guard Scan 1: Exit] β [Guard Scan 2: Entry] β [Completed]
- Leave Submission: The Student submits an outpass request specifying location, purpose, and date-time parameters.
- State Initialization: The outpass is saved in the database in a
Pendingstate. - Warden Review: The Warden views the pending list on their dashboard and selects "Approve" or "Reject".
- QR Allocation: If approved, the backend generates a random 16-byte token and saves it in the outpass record as
qrToken. - Dynamic Render: The student's dashboard displays the approved pass and renders a QR code representing the verification URL.
- Exit Scan: At the gate, the Guard scans the QR. The server verifies that the status is
Approvedand the time window is valid, logs anEXITmovement, and allows the student out. - Entry Scan: When the student returns, the Guard scans the QR again. The server checks that one log exists (
EXIT), creates anENTRYmovement log, and marks the outpass status asCompleted.
| Component | Technology | Description |
|---|---|---|
| Frontend | React 19, Vite, Axios | Single-Page Application client client |
| Styling | Vanilla CSS, Framer Motion, GSAP | Fluid layout variables with micro-animations |
| Backend | Node.js, Express.js | REST APIs with route-specific middleware |
| Database | MongoDB, Mongoose ODM | Document database utilizing role relations |
| Authentication | JWT, Bcrypt | Signed stateless authentication tokens (30m) |
| QR Engine | qrcode, html5-qrcode | Dynamic QR generation and browser-camera decoding |
| PDF Generation | html2pdf.js | Exports signed outpass documents locally to PDF |
- Stateless Session Validation: Routes are protected on both the client (via React Router
ProtectedRoute) and server (viavalidateTokenandauthorizeRolesmiddlewares) using JWTs. - Cryptographic Password Salting: Passwords are saved as one-way salted hashes using
bcrypt(10 rounds). - Dynamic Expiry Checking: The outpass validity is evaluated on-demand during scans, automatically expiring passes that exceed the
toTimewindow. - Secure QR Token: QR codes encapsulate a cryptographically random hex token instead of database IDs to prevent URL spoofing.
DigiPass/
βββ backend/ # Node/Express API Server
β βββ src/
β β βββ config/ # DB connection setup
β β βββ constants/ # Error codes
β β βββ controllers/ # Route controllers (Auth, Outpass, User)
β β βββ middleware/ # Token validation & role checks
β β βββ models/ # Mongoose schemas (User, Student, Outpass, Log)
β β βββ routes/ # Express router files
β β βββ utils/ # Shared helper functions
β βββ package.json
βββ frontend/ # React SPA Client
β βββ src/
β β βββ assets/ # Logos, titles, images
β β βββ components/ # Forms, animations, headers, card displays
β β βββ pages/ # View pages (Login, Student, Warden, Guard, Admin)
β β βββ routes/ # Client-side protected route boundaries
β β βββ services/ # API HTTP communication services
β β βββ styles/ # CSS design files
β β βββ utils/ # HTTP and API action utility wrappers
β βββ package.json
βββ docs/ # Project diagrams and documents
βββ assets/ # ER diagrams, logos
βββ ARCHITECTURE.md # Developer architectural deep-dive
βββ API.md # API endpoints and payloads reference
- Node.js (>= 18.0.0)
- npm (>= 9.0.0)
- MongoDB database instance (Local or Atlas)
Clone the repository and configure your environment variables:
Create a .env file inside backend/:
PORT=3000
CONNECTION_STRING=mongodb+srv://<username>:<password>@cluster0.mongodb.net/digipass
ACCESS_TOKEN_SECRET=your_jwt_secret_key_here
FRONTEND_URL=http://localhost:5173Create a .env file inside frontend/:
VITE_API_BASE_URL=http://localhost:3000/apicd backend
npm install
npm run devOpen a new terminal session:
cd frontend
npm install
npm run devNavigate to http://localhost:5173 in your browser.
To build the static assets for deployment:
cd frontend
npm run buildThe compiled files will be output to the frontend/dist folder, ready to be served or hosted on Vercel/Netlify.
