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 .