A state-of-the-art, real-time grievance redressal and war room dashboard for the Government of NCT of Delhi.
| Portal | Live URL | Access Role | Default Demo Mobile |
|---|---|---|---|
| 🏠 Citizen Portal | citizen.vaani.site | Citizen Filing & Tracking | +91 9800000020 |
| 🏛️ CM War Room | cm.vaani.site | Chief Minister View | +91 9999000001 |
| 🏢 DM Portal | dm.vaani.site | District Magistrate View | +91 9999000003 |
| 📋 Dept Manager | dept.vaani.site | MCD / DJB Agency Manager | +91 9999000004 |
| 👷 Officer Queue | officer.vaani.site | Field Resolution Queue | +91 9999000005 |
| 📡 Main Domain | vaani.site | Global Landing Page | — |
| 📡 Backend API | vaani-ne3t.onrender.com | Live Health Endpoint | — |
All demo accounts bypass actual SMS routing in demo mode via verification OTP: 123456
🎬 System Walkthrough & Demonstration
VAANI.mp4
🖼️ Side-by-Side Visual Overview (Desktop & Responsive Mobile)
| Desktop View | Mobile View | Description |
|---|---|---|
![]() |
![]() |
CM War Room & DEFCON Alerts |
![]() |
![]() |
Citizen Registration & Filing |
![]() |
![]() |
Field Officer Resolution Queue |
![]() |
![]() |
Delhi GIS Heatmap & Hotspots |
- Overview
- System Architecture
- Role-Based Portal Guide
- Departments & SLA Matrix
- Technology Stack
- Database Schema
- Real-Time Features
- Complaint Lifecycle
- Getting Started
- Demo Access Profiles
- Deployment Guide
- Environment Variables Reference
- API Reference
- Contributing
VAANI is a full-stack, production-ready grievance management system built for the Government of NCT of Delhi. It bridges the gap between citizens and governance through a real-time, role-based platform that ensures every complaint is tracked, escalated, and resolved with full accountability.
| Problem | VAANI's Solution |
|---|---|
| Complaints lost in bureaucracy | End-to-end digital tracking with unique Grievance IDs |
| No accountability for delays | SLA enforcement with automatic breach alerts |
| Citizens unaware of progress | Real-time push notifications at every status change |
| CM unable to monitor ground reality | Live war room dashboard with DEFCON alert system |
| Data silos between departments | Unified platform with role-based, isolated data views |
| Corruption / tampering risk | Full audit trail with timestamped activity logs |
To combat spam, fraud, and maintain extreme data integrity, VAANI is equipped with a state-of-the-art Vigilant AI Detection & Authenticity Verification Agent that scans every complaint and piece of evidence upon submission.
When a citizen files a complaint, the AI agent performs real-time heuristic, NLP, and metadata checks:
- Complaint Fraud & Spam Detection: Runs NLP classifiers to inspect text density, repeated character sequences, and a dictionary of test/fake indicators (e.g., gibberish, "asdf", mock text). If flagged, it calculates a Spam/Fraud Probability Score.
- Evidence Authenticity & GPS Verification: Inspects uploaded media metadata. It parses EXIF coordinates and cross-references them with the citizen's declared location coords. If the photo's location is more than 1 kilometer away, it triggers an
EVIDENCE_LOCATION_MISMATCHflag. - Stock & Downloaded Image Analysis: Checks file signatures and name queries for common stock image markers (e.g., preview, stock, download).
- Automated AI Verdict: Assigns a verdict (
PASSED,WARNING,FAILED). FAILED complaints are automatically marked as suspicious and flagged for special manual review.
The AI Agent results are stored directly in the ai_analysis schema, visible in the complaint's immutable timeline:
- Verdict:
PASSED/WARNING/FAILED - Fraud Probability:
0% - 100% - Authenticity Score:
0% - 100% - Detected Flags:
SPAM_KEYWORDS_DETECTED,EXIF_DATA_STRIPPED,EVIDENCE_LOCATION_MISMATCH, etc.
Here is the complete catalog of VAANI's state-of-the-art modules and components that make it the ultimate mission control network:
- False Closure Detection Engine: Prevents field officers from closing complaints prematurely by analyzing text similarity in resolution notes, checking for copy-pasted templates, and flagging after-hours resolutions.
- Citizen Verification Before Closure: Before a complaint is marked as closed, the citizen must verify the resolution via the citizen portal or a dynamic OTP verification workflow.
- CM Executive Dashboard: High-level visual interface for the Chief Minister with real-time KPI counters, DEFCON alerts, and critical alerts.
- Commissioner Dashboard: Isolation dashboard for the municipal commissioner to monitor all active issues across MCD departments.
- District Officer Dashboard: Magisterial portal for district magistrates to review all complaints raised in their respective jurisdictions.
- Department-Specific Dashboards: Custom portals for the 12 active departments (MCD, DJB, PWD, etc.) to manage their respective queues.
- Live Governance Command Center: Direct web sockets command center showing complaint feeds, incoming alerts, and real-time SLA metrics.
- CM Visit Intelligence Mode: A dedicated mode showing geo-coordinates, nearby complaints, and visit logs for the Chief Minister's ground inspection tours.
- Nearby Complaints Discovery: Automatically groups and finds active complaints within 500m of a specified location for inspection planning.
- Visit Logs & Field Inspection Tracking: Logs visits made by inspectors with geo-tagged logs and before/after verification details.
- Emergency War Room Dashboard: Activated during critical events to coordinate disaster relief, water crisis, or power grid failures.
- Chief Minister Mission Control Center: Central system combining command dashboards, digital twins, and direct directive overrides.
- Mobile CM Companion Dashboard: Responsive companion views optimized for mobile screens during live transit.
- AI Auto Complaint Classification: Auto-determines the correct department for a complaint using an N-Gram keyword-weight NLP classifier.
- AI Auto Routing Engine: Automatically assigns the complaint to the most optimal field officer in the correct district and department based on current queue load.
- AI Priority Prediction: Instantly flags DEFCON-level emergencies (e.g. electrocution risk, collapsed flyovers) to bypass regular queues.
- Complaint Severity Scoring: Analyzes risk and urgency factors to assign priority scores (DEFCON Red to Green).
- Complaint Escalation Prediction: Predicts if an issue will breach its SLA based on historical officer resolution speed and queue density.
- Predictive Governance Engine: Anticipates bottleneck periods and projects future complaint patterns.
- Early Warning System: Identifies spike trends in specific zones (e.g. sudden water contamination reports in Shahdara).
- Citizen Sentiment Analysis: Scans feedback text ratings and reviews to calculate citizen satisfaction indexes and department satisfaction scores.
- AI Governance Recommendation Engine: Recommends administrative optimizations and reallocation of personnel to underperforming zones.
- Governance Insights Assistant: Generates readable summaries of weekly district activity and recommendations.
- AI-Powered Decision Support System: Auto-suggests solutions and standard operational procedures (SOPs) to field officers.
- Governance Score Engine: Computes daily health cards for all 11 districts and 12 departments.
- Citizen Trust Index: Tracking metric based on historical citizen ratings and resolved-to-disputed ratios.
- City Health Score: Unified index reflecting the overall municipal functioning state of NCT of Delhi.
- District Health Score: Comparative rating for all 11 districts of Delhi.
- Department Performance Ranking: Live leaderboard comparing departments (e.g., BSES vs DJB) on SLA compliance and resolution speed.
- Officer Performance Ranking: Leaderboard for field staff based on credibility scores, speed, and positive ratings.
- SLA Breach Command Center: Direct view for DMs and CM to track all pending tasks that have violated their SLA timeline.
- Escalation Management Engine: Handles the automated promotion of complaints to DMs (Level 1) or the CM War Room (Level 2) on SLA breaches.
- Officer Workload Intelligence: Monitors the number of active cases assigned to each officer to prevent burnout.
- Resource Capacity Intelligence: Helps planners see if department staffing levels match local complaint volume.
- Public Impact Score: Weights complaints by population density and type of issue (e.g. commercial area water pipe burst vs private line leak).
- Complaint Trend Analytics: Tracks month-on-month increases or decreases in complaint filings.
- Reopened Complaint Analytics: Monitors cases that were closed but disputed by citizens to identify low-quality resolutions.
- Root Cause Analytics: Segregates complaints by sub-categories to find chronic infrastructural problems.
- Department Accountability Dashboard: A performance scorecard view highlighting SLA breach ratios and open disputes.
- Officer Accountability Dashboard: Tracks individual officer metrics including average resolution time and verification dispute history.
- Dynamic KPI Engine: Updates counters (Total Filed, Pending, Resolved, SLA Breached) on all dashboards instantly.
- Real-Time Analytics Engine: Aggregates MongoDB database changes into frontend charts using live-updating Socket.io feeds.
- Officer Bandwidth Monitoring: Displays real-time dashboard grids of active vs maximum limits for field staff.
- Complaint Aging Analysis: Breaks down pending cases into time-buckets (e.g., <24h, 1-3 days, 3-7 days, >7 days).
- SLA Forecasting Engine: Predicts expected completion times for ongoing works.
- Department Benchmarking Engine: Side-by-side performance comparisons of agencies.
- Governance Performance Trends: Historical charts showing long-term trends in resolution times.
- Historical Governance Intelligence: Accesses archived snapshots to compare current seasons with previous years.
- Officer Response Time Intelligence: Computes average hours taken from complaint assignment to field arrival.
- Resolution Quality Scoring: Combined evaluation based on citizen feedback and photo validation.
- Public Service Performance Index: General standard index for public service delivery efficiency.
- Governance Maturity Index: Audits the digitisation level and automation efficiency of NCT departments.
- Complaint Hotspot Intelligence: Identifies spatial clusters of complaints to isolate systemic infrastructure failures.
- Ward-Level Heatmaps: Zoomable GIS maps showing density details at local ward levels.
- District-Level Heatmaps: Colored district overlays demonstrating geographic performance.
- City-Wide Heatmaps: Interactive SVG maps representing the overall complaint density across Delhi.
- Delhi Digital Twin Map: Virtual layout rendering physical complaints directly on coordinate maps.
- GIS-Based Complaint Visualization: Plots active complaints as color-coded pins based on coordinate telemetry.
- Complaint Density Mapping: Renders localized heat signatures.
- Geo-Fencing Based Alerts: Notifies nearby field staff when a new complaint is filed within their geo-fenced region.
- Critical Incident Detection: Auto-detects emergency text inputs and triggers instant war-room SMS alerts.
- High-Risk Area Detection: Flags geographical zones showing recurring hazards (e.g. dangling live wires or open sewers).
- Infrastructure Failure Detection: Flags catastrophic failures (e.g., complete grid blackout or main pipeline burst).
- Flood Risk Intelligence: Aggregates drainage/waterlogging reports during monsoon to warn disaster response.
- Water Crisis Intelligence: Highlights severe water shortage reports.
- Power Outage Intelligence: Maps substation outages based on street light and BSES complaint clusters.
- Sanitation Risk Intelligence: Flags garbage dumping spots near schools or hospitals.
- Road Infrastructure Intelligence: Highlights cave-ins and damaged bridges.
- Duplicate Complaint Clustering: Detects and links multiple filings about the same local issue (e.g. 5 citizens reporting the same pothole).
- Real-Time Complaint Tracking: Follows every state change with instant dashboard notifications.
- Complaint Lifecycle Monitoring: Fully audits the workflow from filing to closure.
- Multi-Department Coordination Engine: Connects MCD and PWD when issues overlap (e.g. road excavation for sewer line laying).
- Cross-Department Complaint Linking: Links related cases for unified tracking.
- Master Issue Management: Allows resolving a parent issue to auto-resolve all linked child complaints.
- VIP/Emergency Escalation Engine: Fast-tracks matters affecting vital infrastructure, hospitals, or transit routes.
- Critical Complaint Fast Track Lane: Bypasses regular queues to assign emergency complaints in under 2 minutes.
- Social Media Complaint Aggregator: Simulates fetching and mapping complaints filed on platforms like X/Twitter.
- WhatsApp Complaint Intake: Integrates WhatsApp intake pipelines.
- Email Complaint Intake: Auto-processes incoming emails into formal tickets.
- Unified Citizen Complaint Feed: Merges inputs from all channels (web, WhatsApp, etc.) into a single, clean workspace.
- Citizen Satisfaction Analytics: Aggregates rating indices across demographics.
- Smart Notification Center: Delivers precise notifications to citizens via email, SMS, and dashboard updates.
- Real-Time Alert Center: Alert hub on dashboards showing instant popups for DEFCON occurrences.
- Public Transparency Dashboard: Public-facing portal detailing resolution metrics and performance scorecards.
- Citizen Resolution Timeline: Clear, bilingual status timeline accessible by citizens.
- Open Data & Reporting Engine: Exposes anonymized complaint datasets for researchers.
- Citizen Engagement Analytics: Measures citizen participation rates.
- Audit Trail System: Logs every action (assignment, notes, verification, closure) with actor name and timestamp.
- Immutable Activity Timeline: An un-editable log embedded in every complaint.
- Geo-Tagged Resolution Verification: Restricts resolving complaints unless photo evidence has matching GPS coordinate proof.
- Before/After Evidence Verification: Shows side-by-side photo comparisons.
- CM Daily Brief Generator: Automatically compiles a clean summary of daily statistics for the CMO.
- Automated Governance Reports: Regularly generates PDF/CSV reports.
- Executive PDF Report Generator: Generates high-quality PDF printouts of district analytics.
┌─────────────────────────────────────────────────────────────────┐
│ VAANI Architecture │
├─────────────────┬───────────────────────┬───────────────────────┤
│ FRONTEND │ BACKEND │ DATABASE │
│ (Next.js) │ (Node/Express) │ (MongoDB) │
│ │ │ │
│ ┌───────────┐ │ ┌─────────────────┐ │ ┌──────────────────┐ │
│ │ CM Panel │──┼─▶│ REST API │──┼─▶│ Complaints │ │
│ │ DM Panel │ │ │ /api/* │ │ │ Users │ │
│ │ Dept Panel│ │ ├─────────────────┤ │ │ Notifications │ │
│ │ Officer │ │ │ Socket.io │ │ │ Escalations │ │
│ │ Citizen │ │ │ Real-time │◀─┼──│ AuditEvents │ │
│ └───────────┘ │ ├─────────────────┤ │ │ Departments │ │
│ │ │ JWT Auth │ │ │ GovernanceScore │ │
│ Socket.io- │ │ Role Guards │ │ │ RiskScores │ │
│ Client ◀───────┼──│ Cron Jobs │ │ └──────────────────┘ │
└─────────────────┴──┴─────────────────┴──┴────────────────────── ┘
├── app/ # Next.js App Router (Frontend)
│ ├── citizen/ # Citizen Portal
│ ├── officer/ # Field Officer Dashboard
│ ├── dashboard/ # Admin Panels (CM, DM, Dept)
│ │ ├── page.js # Main war room overview
│ │ ├── complaints/ # Complaints list + detail view
│ │ ├── analytics/ # Charts & performance metrics
│ │ ├── critical/ # DEFCON Alerts
│ │ ├── escalated/ # Escalated complaints
│ │ ├── heatmap/ # Delhi district heatmap
│ │ ├── leaderboard/ # District & officer rankings
│ │ ├── officers/ # Officer management
│ │ ├── reports/ # Report generation
│ │ └── settings/ # System settings
│ └── lib/
│ └── api.js # Centralized API client
│
├── backend/
│ └── src/
│ ├── controllers/ # Business logic handlers
│ ├── models/ # Mongoose schemas
│ ├── routes/ # Express route definitions
│ ├── middleware/ # Auth, role guards
│ ├── socket/ # Socket.io event handlers
│ ├── jobs/ # Cron jobs (SLA, analytics)
│ ├── services/ # Notification service
│ └── data/seed/ # Database seed scripts
VAANI implements a strict 5-tier role hierarchy with data isolation at every level.
Who: General public of Delhi
Access URL:/citizen
📌 Add screenshot: docs/screenshots/citizen_portal.png
Show: Complaint filing form with category picker and image upload
Features:
- 🌐 Bilingual Filing — Submit grievances in English or Hindi
- 📷 Photo Upload — Attach photos of problems directly from device
- 🔍 Duplicate Detection — System warns if similar complaint exists in your area
- 📡 Live Status Tracking — Real-time status updates with full timeline history
- 🔔 Push Notifications — Notified when officer initiates closure, resolves, or DM verifies
- ⭐ Rating System — Rate resolution quality (1–5 stars) to trigger final complaint closure
- 🔒 OTP Authentication — Secure mobile number + OTP login (no passwords needed)
Complaint Filing Flow:
Select Category → Choose District/Area → Describe Problem → Upload Photo
→ System checks duplicates → Submit → Receive Grievance ID
Closure Notification Flow:
Officer marks "Initiate Closure" → Citizen receives notification
→ Citizen verifies resolution → Provides star rating
→ Complaint status changes to CLOSED
Who: SDMs, Junior Engineers, Field Staff
Access URL:/officer
Data Scope: Only assigned complaints
📌 Add screenshot: docs/screenshots/officer_dashboard.png
Show: Task queue with DEFCON priority badges and scorecard banner
Features:
- 📋 Personal Task Queue — All complaints assigned specifically to this officer
- 🎯 DEFCON Priority Badges — Visual priority levels (DEFCON 1–5) for each task
- 📊 Performance Scorecard — Real-time resolution rate, credibility score, SLA compliance
- ✅ Resolve Complaints — Upload resolution photo + GPS-tagged proof, add notes
- 📁 Add Notes — Add work-in-progress notes visible to all hierarchy levels
- 🔒 Initiate Closure — Trigger the multi-step closure verification workflow
Officer Closure Workflow:
Officer uploads resolution proof
→ Officer clicks "Initiate Closure"
→ Department Manager verifies
→ District Magistrate verifies
→ Citizen gets notified to rate
→ Citizen rates → CLOSED ✓
Who: Department heads (MCD, DJB, PWD, BSES, etc.)
Access URL:/dashboard
Data Scope: Only complaints belonging to their department
📌 Add screenshot: docs/screenshots/dept_panel.png
Show: Department-filtered complaints list and department KPIs
Features:
- 🔒 Department-Isolated View — Managers ONLY see complaints assigned to their department
- 📊 Department KPIs — Total, resolved, pending, breach rate for their department only
- ✅ Dept Verification — Second-step verification in the closure workflow
- 🔀 Reassign Within Dept — Move complaints to different officers within department
- 📝 Add Notes — Annotate complaints with department-level remarks
- 🚨 SLA Monitoring — Track and alert on SLA breaches within department
Departments in System:
| # | Department | Code | Helpline | Categories |
|---|---|---|---|---|
| 1 | Municipal Corporation of Delhi | MCD | 155305 | Sanitation, Garbage, Encroachment, Parks, Stray Dogs, Open Manholes |
| 2 | Delhi Jal Board | DJB | 1916 | Water Supply, Sewage, Drainage, Pipeline |
| 3 | Public Works Department | PWD | 1908 | Roads, Potholes, Flyovers, Bridges, Footpaths |
| 4 | BSES Electricity | BSES | 19123 | Electricity, Power Outage, Transformer, Street Lights |
| 5 | New Delhi Municipal Council | NDMC | 1533 | Sanitation, Water, Roads, Electricity (New Delhi only) |
| 6 | Delhi Development Authority | DDA | 1800110332 | Land, Housing, Park Maintenance, Encroachment |
| 7 | Delhi Transport Corporation | DTC | 1800118181 | Bus Service, Bus Stops, Conductor Behavior |
| 8 | Delhi Police | DP | 112 | Safety, Traffic, Patrolling, Noise Pollution |
| 9 | Delhi Fire Service | DFS | 101 | Fire Safety, NOC, Emergency |
| 10 | Delhi Pollution Control Committee | DPCC | 01123869286 | Air/Water/Noise Pollution, Industrial Waste |
| 11 | Delhi Urban Shelter Improvement Board | DUSIB | 01123378832 | Slum Rehab, Night Shelters, Toilet Complexes |
| 12 | Chief Minister's Office | CMO | 1031 | General, Multi-Department |
📌 Add department-wise screenshots here:
docs/screenshots/dept_mcd.png — MCD Manager panel
docs/screenshots/dept_djb.png — DJB Manager panel
docs/screenshots/dept_pwd.png — PWD Manager panel
docs/screenshots/dept_bses.png — BSES Manager panel
Who: District Magistrates of all 11 Delhi districts
Access URL:/dashboard
Data Scope: Only complaints within their district
📌 Add screenshot: docs/screenshots/dm_panel.png
Show: District-filtered complaints with DM verification button
Features:
- 🗺️ District-Isolated View — DMs ONLY see complaints within their assigned district
- ✅ DM Verification — Third-step verification in the multi-level closure workflow
- ⏱️ Extend SLA — Ability to grant additional resolution time for complex complaints
- 🚨 DEFCON Monitoring — View and track critical/DEFCON-level complaints in district
- 📊 District Analytics — Performance metrics specific to their district
- 🔀 Reassign — Reassign complaints to different officers or departments
- 📈 Escalation View — Track escalated complaints requiring urgent attention
Delhi Districts Covered:
| District | District | District |
|---|---|---|
| Central | East | New Delhi |
| North | North East | North West |
| Shahdara | South | South East |
| South West | West | — |
📌 Add district-wise panel screenshots:
docs/screenshots/dm_central.png — Central District DM panel
docs/screenshots/dm_south.png — South District DM panel
Who: CM, CMO Staff, Super Admin
Access URL:/dashboard
Data Scope: All complaints across all districts and departments
📌 Add screenshot: docs/screenshots/cm_dashboard.png
Show: Real-time KPI counters, DEFCON panel, and analytics charts
Features:
- 📡 Real-Time War Room — Live counters: Active, Resolved, Critical, Escalated
- 🚨 DEFCON Alert System — Highest-priority alerts for life-threatening issues
- 🗺️ Delhi Heatmap — SVG-based district map colored by complaint density
- 📊 Advanced Analytics — Monthly trends, department performance, district comparison
- 🏆 Performance Leaderboard — District and officer rankings by resolution metrics
- 📋 Full Complaints Access — Browse, filter, search ALL complaints statewide
- 🚩 CM Directive — Issue direct orders on any complaint (CM/Super Admin only)
- ⏱️ SLA Extension — Override resolution deadlines (CM and DM only)
- 📄 Report Generation — Download CSV reports with complaint statistics
- 🌐 Bilingual Interface — Toggle between English and Hindi system-wide
SLA = Service Level Agreement. Breach triggers automatic escalation.
| Department | DEFCON/Critical | High Priority | Standard | Low |
|---|---|---|---|---|
| MCD | 4 hours | 24 hours | 7 days | 14 days |
| DJB | 4 hours | 24 hours | 7 days | 14 days |
| PWD | 4 hours | 24 hours | 7 days | 14 days |
| BSES | 2 hours | 12 hours | 3 days | 7 days |
| NDMC | 2 hours | 12 hours | 3 days | 7 days |
| DDA | 8 hours | 48 hours | 10 days | 21 days |
| DTC | 4 hours | 24 hours | 5 days | 10 days |
| Delhi Police | 1 hour | 6 hours | 2 days | 5 days |
| Delhi Fire Service | 1 hour | 4 hours | 1 day | 3 days |
| DPCC | 4 hours | 24 hours | 7 days | 14 days |
| DUSIB | 4 hours | 24 hours | 7 days | 14 days |
| CMO | 1 hour | 4 hours | 1 day | 3 days |
| Technology | Version | Purpose |
|---|---|---|
| Next.js | 16.2.9 | React framework with App Router |
| React | 19.2.4 | UI component library |
| Socket.io-client | 4.8.3 | Real-time WebSocket connection |
| Vanilla CSS | — | Custom design system, dark mode, animations |
| Technology | Version | Purpose |
|---|---|---|
| Node.js | 18+ | JavaScript runtime |
| Express | 4.21 | REST API framework |
| MongoDB | — | NoSQL database |
| Mongoose | 8.5 | MongoDB ODM |
| Socket.io | 4.7.5 | Real-time bidirectional communication |
| jsonwebtoken | 9.0 | JWT-based authentication |
| bcryptjs | 2.4 | Password hashing |
| multer | 1.4.5 | File upload middleware |
| cloudinary | 1.41 | Cloud image storage |
| node-cron | 3.0 | Scheduled jobs (SLA checks) |
| bull | 4.12 | Background job queue |
Complaint Notification User
───────────── ──────────── ────
_id _id _id
grievanceId userId (ref: User) name
title complaintId name_hi
description type phone
category message role: enum[
status: enum[ isRead citizen
FILED, createdAt field_officer
ASSIGNED, dept_manager
IN_PROGRESS, Escalation dm
RESOLVED, ────────── super_admin
CLOSED _id ]
] complaintId department
priority: enum[ level district
critical, reason badge
high, escalatedBy credibilityScore
medium, resolvedAt isActive
low
] AuditEvent GovernanceScore
district ────────── ───────────────
department actor district
assignedTo action totalComplaints
timeline[] target resolved
mediaUrls[] metadata slaCompliance
slaDeadline timestamp avgResolutionHours
slaBreach citizenSatisfaction
rating
ratingText
cmFlagged
cmDirective
VAANI uses Socket.io for instant updates across all connected clients.
| Event | Trigger | Recipients |
|---|---|---|
complaint:updated |
Any status change | All dashboard panels |
complaint:new |
New complaint filed | CM, DM (district), Dept Manager |
notification:new |
Closure initiated | Citizen who filed complaint |
defcon:alert |
Critical complaint filed | CM War Room |
sla:breach |
SLA deadline crossed | Assigned officer, DM, CM |
Backend Controller → Socket.io Emit → All Connected Clients Auto-Refresh
↓
MongoDB save
↓
notifyComplaintUpdate(complaintId) ←── triggers socket broadcast
FILED ──→ ASSIGNED ──→ IN_PROGRESS ──→ RESOLVED ──→ CLOSED
│ │
│ ┌─────────┘
│ │ Multi-step Closure Flow:
│ │ 1. Field Officer → Initiate Closure
└──→ DEFCON/ESCALATED ──→ ────┘ 2. Citizen gets notified
3. Dept Manager verifies
4. DM verifies
5. Citizen rates (⭐ 1-5)
6. Status → CLOSED ✓
Timeline recorded at every step with actor name, role, and timestamp.
Field Officer Department Manager District Magistrate Citizen
───────────── ────────────────── ────────────────── ───────
Upload Resolution Proof → Review & Verify → Final Verify → Receive Notification
Click "Initiate Closure" Click "Dept Verify" Click "DM Verify" Rate Resolution (⭐)
Timeline: "Officer Timeline: "Dept Verified" Timeline: "DM Verified" Timeline: "Citizen Rated"
Initiation" Status → CLOSED
- Node.js v18 or higher
- MongoDB (local instance or MongoDB Atlas cloud)
- Git
git clone https://github.com/YOUR_USERNAME/vaani.git
cd vaani# Navigate to backend
cd backend
# Install dependencies
npm install
# Create environment file
cp .env.example .envEdit backend/.env:
PORT=5001
MONGODB_URI=mongodb://localhost:27017/vaani
JWT_SECRET=your-super-secret-jwt-key-change-in-production
REFRESH_TOKEN_SECRET=your-refresh-token-secret-change-in-production
DEMO_MODE=true
# Optional: Cloudinary (for image uploads)
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret# Seed the database with demo data (departments, districts, users, sample complaints)
npm run seed
# Start backend server
npm run devBackend will run at http://localhost:5001
# From project root
cd ..
# Install frontend dependencies
npm installCreate .env.local in root:
NEXT_PUBLIC_API_URL=http://localhost:5001/api
NEXT_PUBLIC_SOCKET_URL=http://localhost:5001
NEXT_PUBLIC_DEMO_MODE=true# Start Next.js development server
npm run devFrontend will run at http://localhost:3000
Use OTP: 123456 for all demo accounts, or click the Quick Demo Access buttons on the login page.
| Role | Name | Phone | Access Scope |
|---|---|---|---|
| 🔴 Chief Minister | CM Delhi | +91 9999000001 |
All districts, all departments |
| 🏗️ DM Central | DM Central District | +91 9999000003 |
Central District only |
| 🏢 MCD Manager | Dept Manager MCD | +91 9999000004 |
MCD department only |
| 👷 Field Officer | SDM Ramesh Kumar | +91 9999000005 |
Assigned complaints only |
| 👤 Citizen | Rajesh Kumar | +91 9800000020 |
Own complaints only |
This is the recommended strategy for production deployment:
- Vercel hosts the Next.js frontend (with support for edge middleware and subdomains).
- Render hosts the Express backend as a persistent service (required for Socket.io and background Cron Jobs).
- Sign up/log in at MongoDB Atlas and create a free M0 cluster.
- Create a database user and under Network Access whitelist IP
0.0.0.0/0(allowing Render & Vercel to connect). - Copy your connection string:
mongodb+srv://<username>:<password>@cluster0.xxxx.mongodb.net/vaani.
- Go to Render and log in with GitHub.
- Click New + ➔ Web Service.
- Select your repository and configure the service:
- Root Directory:
backend(Important: points to the backend subdirectory) - Runtime:
Node - Build Command:
npm install - Start Command:
node src/server.js
- Root Directory:
- Add the following Environment Variables:
PORT=10000MONGODB_URI=<your-mongodb-atlas-uri>JWT_SECRET=<strong-jwt-secret>JWT_REFRESH_SECRET=<strong-refresh-secret>DEMO_MODE=true
- Click Deploy Web Service and copy your Render service URL (e.g.,
https://vaani-backend.onrender.com).
- Go to vercel.com and sign in with GitHub.
- Click "Add New Project" and import your repository.
- Set Root Directory to
/(the Next.js root). - Add the following environment variables:
NEXT_PUBLIC_API_URL=https://vaani-backend.onrender.com/api NEXT_PUBLIC_SOCKET_URL=https://vaani-backend.onrender.com NEXT_PUBLIC_DEMO_MODE=true
- Click Deploy.
- Configure Custom Subdomains:
- Go to your Project dashboard in Vercel.
- Navigate to Settings ➔ Domains.
- Add your main custom domain, e.g.,
vaani.site. - Add a wildcard domain entry:
*.vaani.site(this enables dynamic subdomains likecitizen.vaani.site,cm.vaani.site,officer.vaani.site, etc.).
- DNS Configuration:
In your domain registrar's DNS panel, add the following records:
- A Record: Host
@pointing to76.76.21.21(Vercel IP). - CNAME Record: Host
wwwpointing tocname.vercel-dns.com. - CNAME Record: Host
*pointing tocname.vercel-dns.com(for wildcard routing).
- A Record: Host
After deploying backend, run the seed script once:
# Set MONGODB_URI to your Atlas URI locally, then:
cd backend
MONGODB_URI=mongodb+srv://user:pass@cluster.mongodb.net/vaani npm run seed- Ubuntu 22.04 LTS
- 2 GB RAM minimum
- Node.js 18+, MongoDB, Nginx, PM2
# Install dependencies
sudo apt update && sudo apt install -y nodejs npm nginx
# Install PM2 globally
sudo npm install -g pm2
# Clone repo
git clone https://github.com/YOUR_USERNAME/vaani.git
cd vaani
# Setup backend
cd backend && npm install
echo "PORT=5001
MONGODB_URI=mongodb://localhost:27017/vaani
JWT_SECRET=your-secret
REFRESH_TOKEN_SECRET=your-refresh-secret
DEMO_MODE=true" > .env
npm run seed
# Start backend with PM2
pm2 start src/server.js --name vaani-backend
pm2 save && pm2 startup
# Setup frontend
cd .. && npm install
echo "NEXT_PUBLIC_API_URL=https://your-domain.com/api
NEXT_PUBLIC_SOCKET_URL=https://your-domain.com" > .env.local
npm run build
# Start frontend with PM2
pm2 start npm --name vaani-frontend -- startserver {
listen 80;
server_name your-domain.com;
# Frontend (Next.js)
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
# Backend API
location /api {
proxy_pass http://localhost:5001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
# Socket.io
location /socket.io {
proxy_pass http://localhost:5001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
}sudo ln -s /etc/nginx/sites-available/vaani /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
# Setup HTTPS with Certbot
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d your-domain.com# docker-compose.yml
version: '3.8'
services:
mongodb:
image: mongo:7
volumes:
- mongo_data:/data/db
environment:
MONGO_INITDB_DATABASE: vaani
backend:
build: ./backend
ports:
- "5001:5001"
environment:
PORT: 5001
MONGODB_URI: mongodb://mongodb:27017/vaani
JWT_SECRET: your-jwt-secret
REFRESH_TOKEN_SECRET: your-refresh-secret
DEMO_MODE: "true"
depends_on:
- mongodb
frontend:
build: .
ports:
- "3000:3000"
environment:
NEXT_PUBLIC_API_URL: http://backend:5001/api
NEXT_PUBLIC_SOCKET_URL: http://backend:5001
depends_on:
- backend
volumes:
mongo_data:docker-compose up -d
docker-compose exec backend npm run seed # seed databaseVAANI is optimized and audited for production deployment across all screen resolutions and multi-tenant subdomains.
The application layout dynamically scales without text overlaps, clipped buttons, or horizontal scrolls on the following resolutions:
- Mobile:
360x640,375x667,390x844,412x915 - Tablet:
768x1024,820x1180,1024x1366 - Laptop:
1366x768,1440x900 - Desktop & Ultra-Wide:
1920x1080,2560x1440
To test the dynamic role-based subdomains locally:
- Edit your system
/etc/hostsfile:sudo nano /etc/hosts
- Add the loopback mappings:
127.0.0.1 vaani.local 127.0.0.1 citizen.vaani.local 127.0.0.1 officer.vaani.local 127.0.0.1 cm.vaani.local - Run the Next.js local server on port 3000:
npm run dev
- Access
http://citizen.vaani.local:3000orhttp://cm.vaani.local:3000to verify auto-detection middleware in action.
- Next.js Production Compilation: Validate frontend builds cleanly:
npm run build
- No Horizontal Scrolling: The main wrapper (
.app-layoutand.app-main) enforcesmax-width: 100vw; overflow-x: hidden;to ensure it fits the viewport precisely. - Scrollable Data Tables: Tabular data cells are wrapped in overflow scroll elements to support horizontal swipes on smaller mobile displays.
- Full-Screen Mobile Modals: Dialog screens automatically resize to full width/height on screens
<480pxwith vertical body scrolling, keeping confirmation buttons visible. - Adaptive Accountability Podium: Gold/Silver/Bronze leaderboard listings automatically stack vertically into horizontal rows under
580pxscreen widths to prevent text cropping.
| Variable | Required | Default | Description |
|---|---|---|---|
PORT |
✅ | 5001 |
Server port |
MONGODB_URI |
✅ | — | MongoDB connection string |
JWT_SECRET |
✅ | — | JWT signing key (use strong random string) |
REFRESH_TOKEN_SECRET |
✅ | — | Refresh token signing key |
DEMO_MODE |
⬜ | false |
Enables OTP bypass (use 123456) |
CLOUDINARY_CLOUD_NAME |
⬜ | — | Cloudinary cloud name (image uploads) |
CLOUDINARY_API_KEY |
⬜ | — | Cloudinary API key |
CLOUDINARY_API_SECRET |
⬜ | — | Cloudinary API secret |
| Variable | Required | Default | Description |
|---|---|---|---|
NEXT_PUBLIC_API_URL |
✅ | — | Backend REST API base URL |
NEXT_PUBLIC_SOCKET_URL |
✅ | — | Backend Socket.io URL |
NEXT_PUBLIC_DEMO_MODE |
⬜ | false |
Shows demo login buttons |
POST /api/auth/send-otp Send OTP to phone number
POST /api/auth/verify-otp Verify OTP & receive JWT tokens
POST /api/auth/refresh Refresh access token
POST /api/auth/logout Invalidate token
GET /api/complaints List complaints (role-filtered)
POST /api/complaints File new complaint (citizen)
GET /api/complaints/:id Get complaint details
PUT /api/complaints/:id/assign Assign to officer
PUT /api/complaints/:id/resolve Field officer resolve
PUT /api/complaints/:id/dept-verify Dept manager verify
PUT /api/complaints/:id/dm-verify DM verify
POST /api/complaints/:id/timeline Add note to timeline
PUT /api/complaints/:id/rate Citizen rate & close
PUT /api/complaints/:id/extend-sla Extend SLA deadline
PUT /api/complaints/:id/reassign Reassign complaint
PUT /api/complaints/:id/cm-flag CM flag complaint
PUT /api/complaints/:id/cm-directive CM directive
POST /api/complaints/duplicate-check Check for duplicates
GET /api/dashboard/kpis Main KPI counters
GET /api/dashboard/recent Recent complaints feed
GET /api/dashboard/defcon DEFCON alert list
GET /api/analytics/detailed Full analytics aggregation
GET /api/analytics/leaderboard District & officer rankings
GET /api/analytics/heatmap District complaint density
GET /api/officers List field officers
GET /api/users/me Current user profile
GET /api/notifications User notifications
PUT /api/notifications/:id/read Mark notification read
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Use ES6+ syntax
- Follow existing naming conventions
- Add JSDoc comments for new API endpoints
- Test all role-based access scenarios before submitting
This project is licensed under the MIT License — see the LICENSE file for details.
- Government of NCT of Delhi for the grievance management framework
- Next.js, MongoDB, and Socket.io open source communities
- All contributors and beta testers
Built with ❤️ for the citizens of Delhi
VAANI — जनता की आवाज़, सरकार का जवाब (The voice of the people, the response of the government)
⭐ If this project helped you, please give it a star! ⭐







