01 · Context
The problem
A civic complaint is only useful when it can move from report to action. The project focuses on that handoff: collecting a location-aware complaint, structuring it for the right department, assigning work, documenting resolution, and keeping the citizen informed.
02 · Product
How it works
Parivartan combines role-specific portals with Firestore-backed state, AI-assisted complaint analysis, maps, push notifications, and worker task APIs. The important part is the workflow, not a single screen: each role sees the same complaint at the stage where they need to act on it.
AI-assisted analysis can pre-fill category, severity, department and related complaint signals.
Location-aware reports use coordinates and Leaflet-based maps to make the issue actionable.
Department assignment uses Firestore transactions to avoid double-booking a worker.
Workers have dedicated task APIs, status updates, and before/after proof uploads.
FCM and Twilio cover push and SMS notification paths.
The app is structured as a PWA rather than a separate native client.
03 · Architecture
The system, broken down
Clients
Separate citizen, SMC, department, and worker experiences share one Next.js application.
Identity
Firebase Authentication supplies user identity; role-aware flows gate access to each portal.
Core data
Cloud Firestore stores users and reports, including status, department, worker, location, media and action history.
AI layer
Genkit + Gemini are used for complaint analysis and the civic chatbot experience.
Operational layer
Worker task route handlers expose accept, reject, status, self-assign, history and proof-upload operations.
Notifications & maps
FCM push, Twilio SMS and Leaflet maps connect backend state to real-world action.
04 · Flow
A request through the system
Report
A citizen submits a complaint with description, coordinates and image evidence.
Analyze
AI-assisted analysis enriches the complaint with structured signals such as category and priority.
Route
The report enters the correct department workflow and can be assigned to a worker.
Resolve
A worker updates task state and uploads before/after proof as the work is completed.
Close the loop
Citizens receive status updates and can rate the resolved complaint.
05 · Engineering
Decisions worth noticing
Role-specific surfaces
The codebase keeps citizen, department, SMC and worker flows separate rather than forcing one generic dashboard on every role.
Firestore-first workflow
Real-time Firestore data fits a workflow where multiple roles may act on the same complaint over time.
Transaction-safe assignment
Worker assignment uses a Firestore transaction in the route layer, which is a concrete concurrency safeguard visible in the repository.
Dedicated worker API
Worker endpoints are intentionally documented as reusable APIs, including a path for a future native client.
06 · Proof
From the actual project



Scope note
This case study intentionally describes only capabilities visible in the uploaded repository and its supporting docs; it does not claim personal ownership of specific subsystems.