Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

37 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

CivicConnect Banner

CivicConnect

๐Ÿ›๏ธ AI-Powered Civic Complaint Management Platform

Frontend Backend Database

CivicConnect is a full-stack civic issue reporting platform that helps citizens report local problems, enables authorities to manage complaints efficiently, and improves transparency through dashboards, geolocation, analytics, and AI-assisted complaint processing.


๐Ÿ“Œ Table of Contents


๐Ÿ” Overview

CivicConnect is designed to bridge the gap between citizens and municipal authorities by providing a centralized platform for civic complaint registration, monitoring, and resolution.

What it does

  • Allows citizens to submit civic complaints with descriptions, images, and location details
  • Helps administrators review, classify, assign, and resolve complaints
  • Tracks complaint lifecycle with status updates and SLA monitoring
  • Provides dashboards, analytics, and public visibility into civic issue trends

Why it matters

Traditional complaint systems are often slow, fragmented, and lacking transparency. CivicConnect solves this by creating a structured, digital-first civic reporting workflow that is easier to use, monitor, and scale.


๐Ÿšจ Problem Statement

Urban civic issues such as:

  • Potholes
  • Garbage overflow
  • Water leakage
  • Streetlight failures
  • Drainage problems
  • Public infrastructure damage

are often under-reported, poorly tracked, or delayed in resolution due to disconnected systems and manual workflows.

CivicConnect addresses this challenge through AI-assisted complaint handling, map-based visibility, and role-based administrative management.


โœจ Key Features

  • ๐Ÿ“ Citizen complaint submission with image upload and location capture
  • ๐Ÿค– AI-assisted complaint categorization, priority scoring, and duplicate detection
  • ๐Ÿ—บ๏ธ Interactive map view for visualizing complaint hotspots
  • ๐Ÿ“Š Public and admin analytics dashboards for trend monitoring
  • ๐Ÿข Department assignment and complaint workflow management
  • โฑ๏ธ SLA tracking for time-bound complaint resolution
  • ๐Ÿ” JWT-based authentication with role-based access control
  • ๐Ÿ”” In-app notification system for complaint updates
  • ๐Ÿ“ฌ Email notification support for important complaint status changes
  • ๐Ÿ“ˆ Severity ranking and operational insights for administrators
  • ๐Ÿงพ Citizen dashboard for complaint history and status tracking
  • ๐ŸŒ Public transparency portal for open civic visibility

๐Ÿ› ๏ธ Tech Stack

Frontend

  • โš›๏ธ React 18
  • ๐ŸŸฆ TypeScript
  • โšก Vite
  • ๐ŸŽจ Tailwind CSS
  • ๐Ÿงญ React Router
  • ๐Ÿ“ Leaflet + React Leaflet
  • ๐Ÿ“Š Recharts
  • ๐ŸŒ Axios

Backend

  • ๐ŸŸข Node.js
  • ๐Ÿš Express.js
  • ๐Ÿ” JWT Authentication
  • ๐Ÿ”’ bcrypt
  • โ˜๏ธ Cloudinary
  • ๐Ÿ“ฉ Nodemailer
  • ๐Ÿงช Jest + Supertest

Database

  • ๐Ÿƒ MongoDB
  • ๐Ÿงฉ Mongoose

Additional Capabilities

  • ๐Ÿง  AI complaint processing pipeline
  • ๐Ÿ›ก๏ธ Helmet + Rate Limiting + Validation
  • โฐ Node Cron for SLA monitoring

โš™๏ธ Installation

1. Clone the repository

git clone https://github.com/your-username/civicconnect.git
cd civicconnect

2. Install dependencies

npm install

3. Configure environment variables

Create the required .env files using the sample placeholders below.

4. Start the development servers

npm run dev

This runs:

  • Frontend on http://localhost:5173
  • Backend on http://localhost:5000

5. Build for production

npm run build

6. Run tests

npm run test

๐Ÿ” Environment Variables

Server .env

PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
JWT_EXPIRES_IN=7d
CORS_ORIGIN=http://localhost:5173

CLOUDINARY_CLOUD_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret

MAILTRAP_HOST=your_mailtrap_host
MAILTRAP_PORT=2525
MAILTRAP_USER=your_mailtrap_user
MAILTRAP_PASS=your_mailtrap_password
MAILTRAP_SENDER_EMAIL=no-reply@example.com

RESEND_API_KEY=your_resend_api_key
RESEND_FROM_EMAIL=no-reply@example.com

Client .env

VITE_API_URL=http://localhost:5000/api

๐Ÿš€ Usage

Citizen Flow

  1. Register or log in to the platform
  2. Submit a complaint with title, description, image, and location
  3. Track complaint status from the citizen dashboard
  4. View admin remarks and updates in real time

Admin Flow

  1. Log in with admin credentials
  2. Review complaint queue and analytics
  3. Assign complaints to departments
  4. Update status, add remarks, and monitor SLA risks

Public Portal

  • Browse complaints
  • View category and trend statistics
  • Explore complaints on the city map

๐Ÿ“ก API Endpoints

Base URL: http://localhost:5000/api

Authentication

Method Endpoint Description
POST /auth/register Register a new user
POST /auth/login Log in a user
GET /auth/me Get current authenticated user

User

Method Endpoint Description
GET /user/profile Fetch user profile
PUT /user/profile Update user profile
PUT /user/password Update user password

Complaints

Method Endpoint Description
GET /complaints Get complaints list
GET /complaints/nearby Get nearby complaints
GET /complaints/:id Get complaint by ID
POST /complaints Create a complaint
PATCH /complaints/:id Update complaint
PATCH /complaints/:id/status Update complaint status

Admin

Method Endpoint Description
GET /admin/complaints Get admin complaint queue
GET /admin/dashboard-trends Get admin dashboard trends
PATCH /admin/complaints/:id/assign Assign department
PATCH /admin/complaints/:id/manage Manage complaint workflow
GET /admin/departments Get departments
GET /admin/sla-violations Get SLA violation list

Analytics

Method Endpoint Description
GET /analytics/category Complaint category analytics
GET /analytics/trends Complaint trend analytics
GET /analytics/wards Ward-wise analytics
GET /analytics/severity Severity analytics

Notifications

Method Endpoint Description
GET /notifications Get notifications
PATCH /notifications/read-all Mark all as read
PATCH /notifications/:id/read Mark one as read
DELETE /notifications/selected Delete selected notifications
DELETE /notifications Delete all notifications
DELETE /notifications/:id Delete a notification

Public / Citizen Trends

Method Endpoint Description
GET /public/stats/trends Public dashboard trend metrics
GET /citizen/dashboard-trends Citizen dashboard trend metrics

Health Check

Method Endpoint Description
GET /health API health status

๐Ÿ“ Folder Structure

CivicConnect/
โ”œโ”€โ”€ client/
โ”‚   โ”œโ”€โ”€ public/
โ”‚   โ”‚   โ””โ”€โ”€ images/
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ context/
โ”‚   โ”‚   โ”œโ”€โ”€ hooks/
โ”‚   โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”‚   โ”œโ”€โ”€ pages/
โ”‚   โ”‚   โ”œโ”€โ”€ services/
โ”‚   โ”‚   โ”œโ”€โ”€ styles/
โ”‚   โ”‚   โ”œโ”€โ”€ test/
โ”‚   โ”‚   โ””โ”€โ”€ utils/
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ””โ”€โ”€ vite.config.ts
โ”œโ”€โ”€ server/
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ ai-engine/
โ”‚   โ”‚   โ”œโ”€โ”€ config/
โ”‚   โ”‚   โ”œโ”€โ”€ controllers/
โ”‚   โ”‚   โ”œโ”€โ”€ middleware/
โ”‚   โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”œโ”€โ”€ services/
โ”‚   โ”‚   โ”œโ”€โ”€ types/
โ”‚   โ”‚   โ””โ”€โ”€ utils/
โ”‚   โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ””โ”€โ”€ tsconfig.json
โ”œโ”€โ”€ DESIGNDOC.md
โ”œโ”€โ”€ PRD.md
โ”œโ”€โ”€ TECH.md
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ README.md

๐Ÿ”ฎ Future Improvements

  • ๐Ÿ“ฑ Native mobile application for Android and iOS
  • ๐ŸŒ Multilingual interface support
  • ๐ŸŽค Voice-based complaint submission
  • ๐Ÿง  More advanced ML models for prediction and routing
  • ๐Ÿ›ฐ๏ธ Real-time ward heatmaps and clustering
  • ๐Ÿ“จ SMS and WhatsApp notifications
  • ๐Ÿ—ณ๏ธ Community upvoting for recurring public issues
  • โ˜๏ธ Cloud deployment with CI/CD pipeline
  • ๐Ÿ“„ PDF report generation for municipal review
  • ๐Ÿ”— Integration with government APIs and smart city platforms


๐Ÿ™ Acknowledgements

  • Open-source community for the libraries and frameworks used in this project
  • React, Node.js, MongoDB, Express, and Vite communities
  • Leaflet and OpenStreetMap for geospatial visualization
  • Cloudinary for media storage support
  • Academic mentors, faculty guides, and project reviewers
  • Inspiration from smart city, civic-tech, and e-governance platforms

CivicConnect aims to make civic reporting smarter, faster, and more transparent.
If you find this project useful, consider giving it a โญ on GitHub.

About

Civic Connect is a MERN civic complaint platform with AI-assisted complaint processing, geolocation mapping, SLA monitoring, role-based dashboards, and analytics.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages