# vishwamr08/civicresolve architecture

> Architecture diagram of the GitHub repository vishwamr08/civicresolve, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vishwamr08/civicresolve
- Repository: https://github.com/vishwamr08/civicresolve

## Overview

CivicResolve is a Tamil Nadu civic-grievance platform: citizens authenticate, submit location-aware reports, and follow them through municipal review to resolution; officers and administrators manage the work. Its backend combines AI triage, duplicate detection, jurisdiction and SLA logic, persistence, and notifications. The graph preserves documented mapping, public dashboards, announcements, and field-resolution capabilities. Source excerpts establish the main server dependencies and selected UI/API calls; some feature links rely on README statements, and unsampled implementation details are not inferred.

Main entry points: [`server/index.js`](https://github.com/vishwamr08/civicresolve/blob/main/server/index.js) (HTTP API), [`client/src/App.jsx`](https://github.com/vishwamr08/civicresolve/blob/main/client/src/App.jsx) (App shell), [`client/src/components/ComplaintFormModal.jsx`](https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/ComplaintFormModal.jsx) (Complaint intake), [`client/src/components/ComplaintTracker.jsx`](https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/ComplaintTracker.jsx) (Complaint tracking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_citizen["Citizen experience"]
  node_app["App shell<br/>[App.jsx]"]
  node_auth["Citizen authentication"]
  node_intake["Complaint intake"]
  node_location["Location picker"]
  node_geo_ui["Jurisdiction data<br/>[tamilnaduGeo.js]"]
  node_tracking["Complaint tracking"]
  node_timeline["Status timeline"]
  node_dashboard["Public dashboard"]
  node_map["Grievance map<br/>[ComplaintMap.jsx]"]
  node_announcements["Announcements"]
  node_services["Services directory<br/>[ServicesPage.jsx]"]
end

subgraph group_operations["Grievance operations"]
  node_admin["Admin command center<br/>[AdminDashboard.jsx]"]
  node_officer["Officer portal<br/>[OfficerPortal.jsx]"]
  node_resolution["Field resolution"]
end

subgraph group_backend["Platform backend"]
  node_api["HTTP API<br/>[index.js]"]
  node_db[("Grievance database<br/>[db.js]")]
  node_ai["AI complaint triage<br/>[gemini-ai.js]"]
  node_duplicates["Duplicate detection"]
  node_sla["SLA calculation<br/>[sla-engine.js]"]
  node_gis["Jurisdiction GIS<br/>[gis-engine.js]"]
  node_geocoder["Reverse geocoding"]
  node_geo_data["Tamil Nadu hierarchy<br/>[tamilnadu-geo.js]"]
  node_notifications["Notifications<br/>[notifications.js]"]
end

subgraph group_integrations["External services"]
  node_google_ai["Google Gemini"]
  node_maps_service["Maps and geocoding"]
end

node_citizens(("Citizens"))

node_citizens -->|"use portal"| node_app
node_app -->|"opens"| node_auth
node_app -->|"opens"| node_intake
node_app -->|"opens"| node_tracking
node_app -->|"opens"| node_admin
node_intake -->|"uses jurisdiction data"| node_geo_ui
node_intake -->|"renders picker"| node_location
node_tracking -->|"renders timeline"| node_timeline
node_app -->|"requests API"| node_api
node_api -->|"queries and updates"| node_db
node_api -->|"analyzes complaints"| node_ai
node_api -->|"checks duplicates"| node_duplicates
node_api -->|"computes deadlines"| node_sla
node_api -.->|"validates jurisdiction"| node_gis
node_api -->|"requests geocoding"| node_geocoder
node_api -->|"loads hierarchy"| node_geo_data
node_api -->|"sends updates"| node_notifications
node_ai -->|"uses Gemini"| node_google_ai
node_geocoder -->|"reverse geocodes"| node_maps_service
node_tracking -->|"fetches status"| node_api
node_admin -->|"displays complaints"| node_map
node_admin -->|"manages complaints"| node_api
node_officer -.->|"updates field work"| node_api
node_resolution -.->|"submits resolution proof"| node_api
node_dashboard -.->|"loads statistics"| node_api
node_announcements -->|"loads announcements"| node_api

click node_app "https://github.com/vishwamr08/civicresolve/blob/main/client/src/App.jsx"
click node_auth "https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/CitizenAuthModal.jsx"
click node_intake "https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/ComplaintFormModal.jsx"
click node_location "https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/LocationPickerMap.jsx"
click node_geo_ui "https://github.com/vishwamr08/civicresolve/blob/main/client/src/data/tamilnaduGeo.js"
click node_tracking "https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/ComplaintTracker.jsx"
click node_timeline "https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/TrackingTimeline.jsx"
click node_dashboard "https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/PublicDashboard.jsx"
click node_map "https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/ComplaintMap.jsx"
click node_announcements "https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/AnnouncementsPage.jsx"
click node_services "https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/ServicesPage.jsx"
click node_admin "https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/AdminDashboard.jsx"
click node_officer "https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/OfficerPortal.jsx"
click node_resolution "https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/AdminManageModal.jsx"
click node_api "https://github.com/vishwamr08/civicresolve/blob/main/server/index.js"
click node_db "https://github.com/vishwamr08/civicresolve/blob/main/server/db.js"
click node_ai "https://github.com/vishwamr08/civicresolve/blob/main/server/gemini-ai.js"
click node_duplicates "https://github.com/vishwamr08/civicresolve/blob/main/server/duplicate-engine.js"
click node_sla "https://github.com/vishwamr08/civicresolve/blob/main/server/sla-engine.js"
click node_gis "https://github.com/vishwamr08/civicresolve/blob/main/server/gis-engine.js"
click node_geocoder "https://github.com/vishwamr08/civicresolve/blob/main/server/geocoding-service.js"
click node_geo_data "https://github.com/vishwamr08/civicresolve/blob/main/server/data/tamilnadu-geo.js"
click node_notifications "https://github.com/vishwamr08/civicresolve/blob/main/server/notifications.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_auth,node_intake,node_location,node_geo_ui,node_tracking,node_timeline,node_dashboard,node_map,node_announcements,node_services toneBlue
class node_admin,node_officer,node_resolution toneAmber
class node_api,node_db,node_ai,node_duplicates,node_sla,node_gis,node_geocoder,node_geo_data,node_notifications toneMint
class node_google_ai,node_maps_service toneRose
class node_citizens toneIndigo
```

## Components

### Citizen experience

- [App shell](https://github.com/vishwamr08/civicresolve/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Citizen authentication](https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/CitizenAuthModal.jsx): `client/src/components/CitizenAuthModal.jsx`
- [Complaint intake](https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/ComplaintFormModal.jsx): `client/src/components/ComplaintFormModal.jsx`
- [Location picker](https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/LocationPickerMap.jsx): `client/src/components/LocationPickerMap.jsx`
- [Jurisdiction data](https://github.com/vishwamr08/civicresolve/blob/main/client/src/data/tamilnaduGeo.js): `client/src/data/tamilnaduGeo.js`
- [Complaint tracking](https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/ComplaintTracker.jsx): `client/src/components/ComplaintTracker.jsx`
- [Status timeline](https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/TrackingTimeline.jsx): `client/src/components/TrackingTimeline.jsx`
- [Public dashboard](https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/PublicDashboard.jsx): `client/src/components/PublicDashboard.jsx`
- [Grievance map](https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/ComplaintMap.jsx): `client/src/components/ComplaintMap.jsx`
- [Announcements](https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/AnnouncementsPage.jsx): `client/src/components/AnnouncementsPage.jsx`
- [Services directory](https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/ServicesPage.jsx): `client/src/components/ServicesPage.jsx`

### Grievance operations

- [Admin command center](https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/AdminDashboard.jsx): `client/src/components/AdminDashboard.jsx`
- [Officer portal](https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/OfficerPortal.jsx): `client/src/components/OfficerPortal.jsx`
- [Field resolution](https://github.com/vishwamr08/civicresolve/blob/main/client/src/components/AdminManageModal.jsx): `client/src/components/AdminManageModal.jsx`

### Platform backend

- [HTTP API](https://github.com/vishwamr08/civicresolve/blob/main/server/index.js): `server/index.js`
- [Grievance database](https://github.com/vishwamr08/civicresolve/blob/main/server/db.js): `server/db.js`
- [AI complaint triage](https://github.com/vishwamr08/civicresolve/blob/main/server/gemini-ai.js): `server/gemini-ai.js`
- [Duplicate detection](https://github.com/vishwamr08/civicresolve/blob/main/server/duplicate-engine.js): `server/duplicate-engine.js`
- [SLA calculation](https://github.com/vishwamr08/civicresolve/blob/main/server/sla-engine.js): `server/sla-engine.js`
- [Jurisdiction GIS](https://github.com/vishwamr08/civicresolve/blob/main/server/gis-engine.js): `server/gis-engine.js`
- [Reverse geocoding](https://github.com/vishwamr08/civicresolve/blob/main/server/geocoding-service.js): `server/geocoding-service.js`
- [Tamil Nadu hierarchy](https://github.com/vishwamr08/civicresolve/blob/main/server/data/tamilnadu-geo.js): `server/data/tamilnadu-geo.js`
- [Notifications](https://github.com/vishwamr08/civicresolve/blob/main/server/notifications.js): `server/notifications.js`

### External services

- **Google Gemini**
- **Maps and geocoding**

### Other components

- **Citizens**

## Connections

- Citizens → App shell: use portal (evidence: `README.md`)
- App shell → Citizen authentication: opens (evidence: `client/src/App.jsx`)
- App shell → Complaint intake: opens (evidence: `client/src/App.jsx`)
- App shell → Complaint tracking: opens (evidence: `client/src/App.jsx`)
- App shell → Admin command center: opens (evidence: `client/src/App.jsx`)
- Complaint intake → Jurisdiction data: uses jurisdiction data (evidence: `client/src/components/ComplaintFormModal.jsx`)
- Complaint intake → Location picker: renders picker (evidence: `client/src/components/ComplaintFormModal.jsx`)
- Complaint tracking → Status timeline: renders timeline (evidence: `client/src/components/ComplaintTracker.jsx`)
- App shell → HTTP API: requests API (evidence: `client/src/App.jsx`)
- HTTP API → Grievance database: queries and updates (evidence: `server/index.js`)
- HTTP API → AI complaint triage: analyzes complaints (evidence: `server/index.js`)
- HTTP API → Duplicate detection: checks duplicates (evidence: `server/index.js`)
- HTTP API → SLA calculation: computes deadlines (evidence: `server/index.js`)
- HTTP API → Jurisdiction GIS: validates jurisdiction (evidence: `server/index.js`)
- HTTP API → Reverse geocoding: requests geocoding (evidence: `server/index.js`)
- HTTP API → Tamil Nadu hierarchy: loads hierarchy (evidence: `server/index.js`)
- HTTP API → Notifications: sends updates (evidence: `server/index.js`)
- AI complaint triage → Google Gemini: uses Gemini (evidence: `README.md`)
- Reverse geocoding → Maps and geocoding: reverse geocodes (evidence: `README.md`)
- Complaint tracking → HTTP API: fetches status (evidence: `client/src/components/ComplaintTracker.jsx`)
- Admin command center → Grievance map: displays complaints (evidence: `client/src/components/AdminDashboard.jsx`)
- Admin command center → HTTP API: manages complaints
- Officer portal → HTTP API: updates field work
- Field resolution → HTTP API: submits resolution proof
- Public dashboard → HTTP API: loads statistics
- Announcements → HTTP API: loads announcements (evidence: `client/src/components/AnnouncementsPage.jsx`)
