# afnan-0206/nammafix-ai architecture

> Architecture diagram of the GitHub repository afnan-0206/nammafix-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/afnan-0206/nammafix-ai
- Repository: https://github.com/afnan-0206/nammafix-ai

## Overview

NammaFix AI is a Bengaluru civic-grievance portal for reporting infrastructure defects, triaging reports, and supporting public and municipal follow-up. Citizens submit a report, receive locally computed category, severity, department, and response guidance, and can review grievances; municipal staff use an operations console to inspect status and risk. Separate public capabilities include a 3D Bengaluru infrastructure view, municipal-machinery inspector, impact/SLA reporting, and citizen leaderboard. State is persisted in browser localStorage. The sampled evidence shows no backend service; unsampled page details and some data wiring are therefore not represented as confirmed calls.

Main entry points: [`src/App.jsx`](https://github.com/afnan-0206/nammafix-ai/blob/main/src/App.jsx) (App Routing & State), [`src/pages/ReportIssue.jsx`](https://github.com/afnan-0206/nammafix-ai/blob/main/src/pages/ReportIssue.jsx) (Report Intake), [`src/utils/issues.js`](https://github.com/afnan-0206/nammafix-ai/blob/main/src/utils/issues.js) (Issue Utilities), [`src/pages/Dashboard.jsx`](https://github.com/afnan-0206/nammafix-ai/blob/main/src/pages/Dashboard.jsx) (Grievance Registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Grievance Intake"]
  node_report_form["Report Intake<br/>[ReportIssue.jsx]"]
  node_ai_triage["Report Triage<br/>[geminiService.js]"]
  node_issue_rules["Issue Utilities<br/>[issues.js]"]
  node_seed_issues["Initial Issue Data<br/>[initialIssues.js]"]
  node_issue_store[("Browser Issue Store<br/>[issues.js]")]
end

subgraph group_operations["Civic Operations"]
  node_dashboard["Grievance Registry<br/>[Dashboard.jsx]"]
  node_issue_detail["Grievance Detail<br/>[IssueDetail.jsx]"]
  node_authority_console["Authority Console"]
end

subgraph group_insights["City Insights"]
  node_city_twin["Bengaluru Digital Twin"]
  node_geo_layers["Geo Twin Data"]
  node_hotspots["Civic Hotspots<br/>[CivicHotspots.jsx]"]
  node_machinery["Machinery Inspector"]
  node_impact["Impact &amp; SLAs<br/>[Impact.jsx]"]
  node_leaderboard["Citizen Leaderboard<br/>[Leaderboard.jsx]"]
end

subgraph group_experience["Portal Experience"]
  node_app_shell["App Routing &amp; State<br/>[App.jsx]"]
  node_home["Civic Portal Home<br/>[Home.jsx]"]
  node_toast["Toast Notifications<br/>[Toast.jsx]"]
  node_tilt["3D Tilt Hook<br/>[use3DTilt.js]"]
end

node_citizen(("Citizen"))
node_municipal_staff(("Municipal Staff"))

node_citizen -.->|"files report"| node_report_form
node_report_form -->|"requests triage"| node_ai_triage
node_report_form -->|"checks duplicates"| node_issue_rules
node_issue_rules -->|"loads defaults"| node_seed_issues
node_app_shell -->|"persists issues"| node_issue_store
node_app_shell -->|"loads and persists"| node_issue_rules
node_app_shell -->|"routes to"| node_report_form
node_app_shell -->|"routes to"| node_dashboard
node_app_shell -->|"routes to"| node_issue_detail
node_app_shell -->|"routes to"| node_authority_console
node_app_shell -->|"routes to"| node_home
node_app_shell -->|"routes to"| node_impact
node_app_shell -->|"routes to"| node_leaderboard
node_municipal_staff -.->|"reviews dockets"| node_authority_console
node_home -->|"renders"| node_city_twin
node_home -->|"renders"| node_machinery
node_dashboard -->|"uses categories"| node_issue_rules
node_authority_console -->|"uses statuses"| node_issue_rules
node_report_form -->|"uses notifications"| node_toast
node_dashboard -->|"uses notifications"| node_toast
node_authority_console -->|"uses tilt"| node_tilt
node_dashboard -->|"uses tilt"| node_tilt
node_home -->|"uses tilt"| node_tilt

click node_app_shell "https://github.com/afnan-0206/nammafix-ai/blob/main/src/App.jsx"
click node_report_form "https://github.com/afnan-0206/nammafix-ai/blob/main/src/pages/ReportIssue.jsx"
click node_ai_triage "https://github.com/afnan-0206/nammafix-ai/blob/main/src/services/geminiService.js"
click node_issue_rules "https://github.com/afnan-0206/nammafix-ai/blob/main/src/utils/issues.js"
click node_seed_issues "https://github.com/afnan-0206/nammafix-ai/blob/main/src/data/initialIssues.js"
click node_issue_store "https://github.com/afnan-0206/nammafix-ai/blob/main/src/utils/issues.js"
click node_dashboard "https://github.com/afnan-0206/nammafix-ai/blob/main/src/pages/Dashboard.jsx"
click node_issue_detail "https://github.com/afnan-0206/nammafix-ai/blob/main/src/pages/IssueDetail.jsx"
click node_authority_console "https://github.com/afnan-0206/nammafix-ai/blob/main/src/pages/AuthorityConsole.jsx"
click node_home "https://github.com/afnan-0206/nammafix-ai/blob/main/src/pages/Home.jsx"
click node_city_twin "https://github.com/afnan-0206/nammafix-ai/blob/main/src/components/BengaluruDigitalTwin.jsx"
click node_geo_layers "https://github.com/afnan-0206/nammafix-ai/blob/main/src/data/bengaluruGeoTwin.js"
click node_hotspots "https://github.com/afnan-0206/nammafix-ai/blob/main/src/components/CivicHotspots.jsx"
click node_machinery "https://github.com/afnan-0206/nammafix-ai/blob/main/src/components/ThreeMachineryViewer.jsx"
click node_impact "https://github.com/afnan-0206/nammafix-ai/blob/main/src/pages/Impact.jsx"
click node_leaderboard "https://github.com/afnan-0206/nammafix-ai/blob/main/src/pages/Leaderboard.jsx"
click node_toast "https://github.com/afnan-0206/nammafix-ai/blob/main/src/components/Toast.jsx"
click node_tilt "https://github.com/afnan-0206/nammafix-ai/blob/main/src/hooks/use3DTilt.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_report_form,node_ai_triage,node_issue_rules,node_seed_issues,node_issue_store toneBlue
class node_dashboard,node_issue_detail,node_authority_console toneAmber
class node_city_twin,node_geo_layers,node_hotspots,node_machinery,node_impact,node_leaderboard toneMint
class node_app_shell,node_home,node_toast,node_tilt toneRose
class node_citizen,node_municipal_staff toneIndigo
```

## Components

### Grievance Intake

- [Report Intake](https://github.com/afnan-0206/nammafix-ai/blob/main/src/pages/ReportIssue.jsx): `src/pages/ReportIssue.jsx`
- [Report Triage](https://github.com/afnan-0206/nammafix-ai/blob/main/src/services/geminiService.js): `src/services/geminiService.js`
- [Issue Utilities](https://github.com/afnan-0206/nammafix-ai/blob/main/src/utils/issues.js): `src/utils/issues.js`
- [Initial Issue Data](https://github.com/afnan-0206/nammafix-ai/blob/main/src/data/initialIssues.js): `src/data/initialIssues.js`
- [Browser Issue Store](https://github.com/afnan-0206/nammafix-ai/blob/main/src/utils/issues.js): `src/utils/issues.js`

### Civic Operations

- [Grievance Registry](https://github.com/afnan-0206/nammafix-ai/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Grievance Detail](https://github.com/afnan-0206/nammafix-ai/blob/main/src/pages/IssueDetail.jsx): `src/pages/IssueDetail.jsx`
- [Authority Console](https://github.com/afnan-0206/nammafix-ai/blob/main/src/pages/AuthorityConsole.jsx): `src/pages/AuthorityConsole.jsx`

### City Insights

- [Bengaluru Digital Twin](https://github.com/afnan-0206/nammafix-ai/blob/main/src/components/BengaluruDigitalTwin.jsx): `src/components/BengaluruDigitalTwin.jsx`
- [Geo Twin Data](https://github.com/afnan-0206/nammafix-ai/blob/main/src/data/bengaluruGeoTwin.js): `src/data/bengaluruGeoTwin.js`
- [Civic Hotspots](https://github.com/afnan-0206/nammafix-ai/blob/main/src/components/CivicHotspots.jsx): `src/components/CivicHotspots.jsx`
- [Machinery Inspector](https://github.com/afnan-0206/nammafix-ai/blob/main/src/components/ThreeMachineryViewer.jsx): `src/components/ThreeMachineryViewer.jsx`
- [Impact & SLAs](https://github.com/afnan-0206/nammafix-ai/blob/main/src/pages/Impact.jsx): `src/pages/Impact.jsx`
- [Citizen Leaderboard](https://github.com/afnan-0206/nammafix-ai/blob/main/src/pages/Leaderboard.jsx): `src/pages/Leaderboard.jsx`

### Portal Experience

- [App Routing & State](https://github.com/afnan-0206/nammafix-ai/blob/main/src/App.jsx): `src/App.jsx`
- [Civic Portal Home](https://github.com/afnan-0206/nammafix-ai/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Toast Notifications](https://github.com/afnan-0206/nammafix-ai/blob/main/src/components/Toast.jsx): `src/components/Toast.jsx`
- [3D Tilt Hook](https://github.com/afnan-0206/nammafix-ai/blob/main/src/hooks/use3DTilt.js): `src/hooks/use3DTilt.js`

### Other components

- **Citizen**
- **Municipal Staff**

## Connections

- Citizen → Report Intake: files report (evidence: `README.md`)
- Report Intake → Report Triage: requests triage (evidence: `src/pages/ReportIssue.jsx`)
- Report Intake → Issue Utilities: checks duplicates (evidence: `src/pages/ReportIssue.jsx`)
- Issue Utilities → Initial Issue Data: loads defaults (evidence: `src/utils/issues.js`)
- App Routing & State → Browser Issue Store: persists issues (evidence: `src/App.jsx`)
- App Routing & State → Issue Utilities: loads and persists (evidence: `src/App.jsx`)
- App Routing & State → Report Intake: routes to (evidence: `src/App.jsx`)
- App Routing & State → Grievance Registry: routes to (evidence: `src/App.jsx`)
- App Routing & State → Grievance Detail: routes to (evidence: `src/App.jsx`)
- App Routing & State → Authority Console: routes to (evidence: `src/App.jsx`)
- App Routing & State → Civic Portal Home: routes to (evidence: `src/App.jsx`)
- App Routing & State → Impact & SLAs: routes to (evidence: `src/App.jsx`)
- App Routing & State → Citizen Leaderboard: routes to (evidence: `src/App.jsx`)
- Municipal Staff → Authority Console: reviews dockets (evidence: `README.md`)
- Civic Portal Home → Bengaluru Digital Twin: renders (evidence: `src/pages/Home.jsx`)
- Civic Portal Home → Machinery Inspector: renders (evidence: `src/pages/Home.jsx`)
- Grievance Registry → Issue Utilities: uses categories (evidence: `src/pages/Dashboard.jsx`)
- Authority Console → Issue Utilities: uses statuses (evidence: `src/pages/AuthorityConsole.jsx`)
- Report Intake → Toast Notifications: uses notifications (evidence: `src/pages/ReportIssue.jsx`)
- Grievance Registry → Toast Notifications: uses notifications (evidence: `src/pages/Dashboard.jsx`)
- Authority Console → 3D Tilt Hook: uses tilt (evidence: `src/pages/AuthorityConsole.jsx`)
- Grievance Registry → 3D Tilt Hook: uses tilt (evidence: `src/pages/Dashboard.jsx`)
- Civic Portal Home → 3D Tilt Hook: uses tilt (evidence: `src/pages/Home.jsx`)
