Skip to content
sumit-2007-gitPublic

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🏛️ CivicFix 2.0 - Smart Civic Issue Reporting & Management Platform

Placement Ready Stack Leaflet License

CivicFix 2.0 is an enterprise-grade, placement-level civic issue resolution and infrastructure management platform connecting Citizens, Field Officers, Municipal Department Managers, and City Administrators through real-time reactive workflows, AI-assisted image and text classification, Leaflet geospatial mapping, SLA timers, and verified photographic resolution audits.


🌟 Key Features Breakdown

1. Multi-Role Ecosystem & RBAC

  • 👤 Citizen Portal:
    • Register & Login (JWT authentication).
    • Geotagged issue reporting with GPS auto-locate and manual map pin drop.
    • Media evidence uploader (photos and video support).
    • Live progress timeline: Submitted ➔ Assigned ➔ Accepted ➔ In-Progress ➔ Resolved ➔ Verified/Closed.
    • Reopen feature if repairs are inadequate, upvoting community concerns, and 5-star resolution feedback.
  • 👷 Field Officer App:
    • Mobile-friendly task queue with SLA deadline countdowns.
    • Direct 1-click GPS navigation links (Google Maps).
    • Accept/Reject task workflows with reason logging.
    • Before/after photographic resolution proof uploader.
  • 🏢 Department Manager Dashboard:
    • Review queue for Roads, Sanitation, Electricity, Water, Traffic, and Public Assets.
    • 1-click officer assignment with dynamic SLA targets (6h, 12h, 24h, 48h, 72h).
    • Officer workload balancing & resolution verification.
  • 🛡️ City Administrator Command Center:
    • City-wide KPI dashboard, resolution velocity, and category distribution.
    • User and department role promotion/management.
    • Full immutable security audit log trail.
    • 1-click CSV/Excel master dataset export.

2. Smart Maps & Geolocation

  • Interactive Leaflet.js map with custom color-coded category and priority pins.
  • MongoDB 2dsphere Geospatial Queries for nearby complaints within selectable radii (1km – 30km).
  • OpenStreetMap Nominatim reverse geocoding to auto-fill street addresses.
  • Heatmap density overlay for municipal hotspots.

3. AI-Assisted Classification Engine

  • Automated image and text analysis to detect category (pothole, garbage, streetlight, water, traffic_signal, etc.).
  • Automated severity & priority estimation (critical, high, medium, low).
  • Automated 200m radius duplicate issue detection to prevent redundant municipal dispatch.
  • Executive summary generation for department managers.

4. Real-Time Reactive Architecture

  • Socket.io event dispatching for instant status notifications, officer dispatch alerts, and live comments.
  • In-app notification center with sound/toast alerts.
  • Nodemailer HTML email notifications.

🚀 Instant 1-Click Setup & Running

Prerequisites

  • Node.js (v18 or higher recommended)
  • MongoDB (Local Community Server or free MongoDB Atlas URI)

Quick Start (Single Command)

  1. Clone or Extract the ZIP Archive
  2. Install Dependencies and Start Everything:
    # In project root folder:
    npm install
    npm run install:all
  3. Seed Database with Realistic Demo Data:
    npm run seed
  4. Launch Application:
    npm run dev
    # OR on Windows double-click: start.bat
    # OR on Linux/macOS run: ./start.sh

🔑 Pre-Seeded Demo Accounts (1-Click Login on UI)

Role Email Password
City Administrator [email protected] admin123
Roads Dept Manager [email protected] manager123
Sanitation Manager [email protected] manager123
Field Officer (Roads) [email protected] officer123
Field Officer (Sanitation) [email protected] officer123
Citizen (Rahul) [email protected] citizen123
Citizen (Priya) [email protected] citizen123

💡 Tip: The sticky top bar in the web application has 1-Click buttons to instantly switch between all 4 personas!


🐳 Docker Deployment

To launch the complete application with isolated MongoDB, Backend, and Frontend containers:

docker-compose up --build

Access at http://localhost:5173.


☁️ Cloud Deployment Guide

Frontend Deployment (Vercel)

  1. Push frontend/ to GitHub.
  2. Import project into Vercel.
  3. Set Root Directory to frontend.
  4. Set Environment Variable: VITE_API_URL=https://your-backend-domain.com/api.
  5. Deploy!

Backend Deployment (Render / Railway / Render)

  1. Push backend/ to GitHub.
  2. Create a Web Service on Render or Railway.
  3. Set Root Directory to backend and build command npm install, start command node src/server.js.
  4. Set Environment Variables:
    • MONGODB_URI: Your MongoDB Atlas Connection String
    • JWT_SECRET: A secure random string
    • PORT: 5000
  5. Deploy!

📂 Project Structure

civicfix-2.0/
├── backend/
│   ├── src/
│   │   ├── config/ (MongoDB & Socket.io)
│   │   ├── controllers/ (Auth, Complaints, Departments, Maps, AI, Analytics, Admin)
│   │   ├── middleware/ (JWT RBAC, Multer uploads, Error handling, Rate limiting)
│   │   ├── models/ (User, Complaint, Department, Comment, Notification, Feedback, AuditLog)
│   │   ├── routes/ (Express API endpoints)
│   │   ├── services/ (AI Classifier, Emailer, Database Seeder)
│   │   └── server.js
│   ├── uploads/
│   └── package.json
├── frontend/
│   ├── src/
│   │   ├── components/ (Leaflet Map, Timeline, Badges, AI Modal, Navbar, Sidebar, Uploader)
│   │   ├── context/ (AuthContext & SocketContext)
│   │   ├── pages/ (Home, Login, Register, Citizen, Officer, Manager, Admin)
│   │   ├── services/ (Axios API Client)
│   │   ├── types/ (TypeScript interfaces)
│   │   ├── App.tsx
│   │   └── main.tsx
│   ├── vite.config.ts
│   ├── tailwind.config.js
│   └── package.json
├── docker-compose.yml
├── start.bat (1-Click Windows)
├── start.sh (1-Click Linux/Mac)
├── vercel.json
└── README.md

🎓 Placement Viva / Presentation Talking Points

  1. Geospatial 2dsphere Querying: How MongoDB coordinates [longitude, latitude] indexing enables high-speed $near proximity searches within custom radius boundaries.
  2. State Machine & Lifecycle Governance: Complaint status transitions follow strict rules (e.g., officers cannot mark an issue resolved without uploading photo evidence and resolution coordinates).
  3. AI Fallback Resilience: Built with a dual-layer AI strategy (integrates with Gemini API with automated offline heuristic NLP fallback) guaranteeing 100% uptime without external dependencies.
  4. WebSocket Event Rooms: How Socket.io rooms (user:ID, dept:ID, complaint:ID) minimize network overhead while providing instant reactive toast updates.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages