Feature
Description
📋 Smart Check-In/Out
Register new visitors or quick check-in returning ones with auto-detection and visit history
📊 Live Dashboard
Real-time stats — active visitors, today's visits, overstays, blacklisted — auto-refreshes every 30s
🔒 Role-Based Access
3 roles (Admin, Receptionist, Security) with tailored permissions and page restrictions
🚫 Blacklist System
Flag & block visitors with logged audit trails; auto-denied at check-in
🕐 Overstay Detection
Database triggers auto-update status when visitors exceed expected checkout time
📝 Reports & Logs
Verification logs, visit sessions with date/status filters, pagination
🚗 Vehicle Tracking
Vehicle number, type, and parking slot registration
👥 User Management
Admin panel for creating, editing, and managing system users
⚡ Serverless Deploy
Deployed on Vercel with Neon PostgreSQL — zero-config scaling
┌─────────────────────────────────────────────────────┐
│ FRONTEND │
│ HTML5 + Vanilla CSS + JavaScript │
│ (Landing · Login · Dashboard · Check-In · Reports) │
└──────────────────────┬──────────────────────────────┘
│ REST API (JSON)
┌──────────────────────▼──────────────────────────────┐
│ BACKEND (Express.js) │
│ JWT Auth · RBAC Middleware · Validation │
│ Controllers · Routes · Error Handling │
└──────────────────────┬──────────────────────────────┘
│ pg (node-postgres)
┌──────────────────────▼──────────────────────────────┐
│ DATABASE (PostgreSQL / Neon) │
│ 8 Tables · 5 Triggers · 4 Stored Procedures │
│ 3 Views · Indexes · Constraints │
└─────────────────────────────────────────────────────┘
Table
Purpose
USER_ACCOUNT
System users (Admin, Receptionist, Security) with hashed passwords
VISITOR
Visitor profiles with ID verification and blacklist status
VISIT_SESSION
Check-in/out records, host info, purpose, status tracking
VEHICLE
Visitor vehicle details and parking slot assignment
SECURITY_OFFICER
Security officers with shift assignments
VERIFICATION_LOG
Audit trail for all check-in/out/verification actions
BLACKLIST_LOG
History of blacklist add/remove operations
SYSTEM_SETTINGS
Configurable facility settings
Trigger
Function
trg_log_checkin
Auto-logs check-in to VERIFICATION_LOG
trg_log_checkout
Auto-logs check-out to VERIFICATION_LOG
trg_check_overstay
Auto-updates status to Overstay when past expected time
trg_log_blacklist
Auto-logs blacklist add/remove to BLACKLIST_LOG
trg_*_updated_at
Auto-updates Updated_At timestamp on row changes
sp_register_and_checkin() — Register new visitor + create session in one transaction
sp_checkout_visitor() — Check-out with validation
sp_get_active_visitors() — Active visitors with duration calculation
sp_get_visitor_history() — Complete visit history for a visitor
🔐 Role-Based Access Control
Capability
Admin
Receptionist
Security
Dashboard
✅
✅
✅
Check-In Visitors
✅
✅
❌
Check-Out Visitors
✅
✅
❌
View Visitor List
✅
✅
✅
Edit Visitors
✅
✅
❌
Delete Visitors
✅
❌
❌
Blacklist Management
✅
❌
❌
Reports & Logs
✅
❌
❌
User Management
✅
❌
❌
Layer
Technology
Frontend
HTML5, Vanilla CSS, JavaScript
Backend
Node.js, Express.js
Database
PostgreSQL (Neon)
Authentication
JWT + bcrypt.js
Validation
express-validator
Deployment
Vercel (Serverless)
Node.js ≥ 18
PostgreSQL (local) or Neon account
git clone https://github.com/prisha-sh/Visitor-Management-System.git
cd Visitor-Management-System
Create backend/.env:
PORT = 8000
NODE_ENV = development
# Database (Local PostgreSQL)
DATABASE_URL = postgresql://user:password@localhost:5432/visitor_management_system
# JWT
JWT_SECRET = your_super_secret_key_here
JWT_EXPIRE = 7d
# Bcrypt
BCRYPT_ROUNDS = 10
# Create database and run schema
psql -U postgres -f database/schema_pg.sql
# Seed sample data
psql -U postgres -d visitor_management_system -f database/seed_pg.sql
npm run dev
# Server starts at http://localhost:8000
Visit http://localhost:8000 — you'll see the landing page , then navigate to Login .
Role
Username
Password
🔴 Admin
admin
admin123
🟢 Security
security1
admin123
🟡 Receptionist
reception1
admin123
Method
Endpoint
Description
POST
/api/auth/login
User login → returns JWT
GET
/api/auth/verify
Verify token validity
Method
Endpoint
Description
GET
/api/visitors
List all visitors (paginated, filterable)
GET
/api/visitors/:id
Get visitor details
GET
/api/visitors/search?query=
Search by name/contact/ID
GET
/api/visitors/:id/history
Get visit history
POST
/api/visitors
Create visitor
PUT
/api/visitors/:id
Update visitor
DELETE
/api/visitors/:id
Delete visitor (Admin)
POST
/api/visitors/:id/blacklist
Blacklist visitor
DELETE
/api/visitors/:id/blacklist
Remove from blacklist
Method
Endpoint
Description
GET
/api/sessions/active
Get currently checked-in visitors
POST
/api/sessions/checkin
New visitor check-in
POST
/api/sessions/quick-checkin
Returning visitor check-in
PUT
/api/sessions/:id/checkout
Check-out visitor
Method
Endpoint
Description
GET
/api/reports/dashboard
Dashboard statistics
GET
/api/reports/verification-logs
Verification log report
GET
/api/reports/visit-sessions
Visit session report
Method
Endpoint
Description
GET
/api/users
List all users
POST
/api/users
Create user
PUT
/api/users/:id
Update user
PUT
/api/users/:id/toggle-active
Activate/deactivate user
Visitor-Management-System/
├── frontend/
│ ├── index.html # Landing page (project showcase)
│ ├── login.html # Authentication page
│ ├── dashboard.html # Main dashboard with stats
│ ├── checkin.html # Visitor check-in form
│ ├── checkout.html # Visitor check-out
│ ├── visitors.html # Visitor management table
│ ├── reports.html # Reports & verification logs
│ ├── users.html # User management (Admin)
│ └── assets/images/ # Preview images
├── backend/
│ ├── server.js # Express app entry point
│ ├── config/db.js # PostgreSQL connection pool
│ ├── middleware/
│ │ ├── auth.js # JWT authentication
│ │ └── errorHandler.js # Global error handler
│ ├── controllers/ # Business logic
│ ├── routes/ # API route definitions
│ └── utils/ # Validation & helpers
├── database/
│ ├── schema_pg.sql # PostgreSQL schema + triggers
│ └── seed_pg.sql # Sample data
├── api/index.js # Vercel serverless entry
├── vercel.json # Vercel deployment config
└── package.json
The project is configured for Vercel serverless deployment:
Push to GitHub
Import in Vercel → Link your repository
Add Environment Variables in Vercel dashboard:
DATABASE_URL — Neon PostgreSQL connection string
JWT_SECRET — Your JWT signing secret
Deploy — Vercel auto-detects vercel.json config
This project is open source and available under the MIT License .