# daraanjali/fixmycity architecture

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

- Interactive diagram: https://gitdiagram.com/daraanjali/fixmycity
- Repository: https://github.com/daraanjali/fixmycity

## Overview

FixMyCity is a civic-issue reporting and administration platform. Citizens register or sign in, submit a complaint with location and an optional image, and receive AI-derived category and severity; issues are stored and then displayed for tracking, map visualization, and community support. The dashboard also summarizes, searches, and filters issues, while authorized administrators can update status. The README additionally describes real-time notifications, but the sampled source does not establish an implementation path for them, so they are not modeled. Some backend integrations are represented from the README and source index rather than inspected implementation details.

Main entry points: [`client/src/App.jsx`](https://github.com/daraanjali/fixmycity/blob/main/client/src/App.jsx) (Route shell), [`client/src/pages/Dashboard.jsx`](https://github.com/daraanjali/fixmycity/blob/main/client/src/pages/Dashboard.jsx) (Issue dashboard), [`client/src/services/issueService.js`](https://github.com/daraanjali/fixmycity/blob/main/client/src/services/issueService.js) (Issue API client), [`server/src/controllers/issueController.js`](https://github.com/daraanjali/fixmycity/blob/main/server/src/controllers/issueController.js) (Issue controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Route shell<br/>[App.jsx]"]
  node_dashboard["Issue dashboard<br/>[Dashboard.jsx]"]
  node_report["Report form<br/>[ReportIssue.jsx]"]
  node_home["Home page<br/>[Home.jsx]"]
  node_login["Login page<br/>[Login.jsx]"]
  node_register["Registration page<br/>[Register.jsx]"]
  node_authstate["Auth state<br/>[AuthContext.jsx]"]
  node_theme["Theme state<br/>[ThemeContext.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_issuecards["Issue cards<br/>[IssueCard.jsx]"]
  node_issuemap["Issue map<br/>[IssueMap.jsx]"]
  node_stats["Dashboard stats<br/>[StatsCard.jsx]"]
  node_chart["Status chart<br/>[StatusChart.jsx]"]
  node_api["HTTP client<br/>[api.js]"]
end

subgraph group_auth["Identity and access"]
  node_authservice["Auth API client<br/>[authService.js]"]
  node_protected["Route guard<br/>[ProtectedRoute.jsx]"]
  node_authroutes["Auth routes<br/>[authRoutes.js]"]
  node_authcontroller["Auth controller<br/>[authController.js]"]
end

subgraph group_issues["Issue handling"]
  node_issueservice["Issue API client<br/>[issueService.js]"]
  node_issueroutes["Issue routes<br/>[issueRoutes.js]"]
  node_issuecontroller["Issue controller<br/>[issueController.js]"]
  node_issueupload["Image upload"]
  node_categorize["AI categorization<br/>[aiCategorize.js]"]
  node_severity["Severity prediction<br/>[aiSeverity.js]"]
end

subgraph group_platform["Storage and integrations"]
  node_server["Express app<br/>[app.js]"]
  node_userstore[("User records<br/>[User.js]")]
  node_issuemodel[("Issue records<br/>[Issue.js]")]
  node_cloudinary["Image hosting<br/>[cloudinary.js]"]
  node_mongodb[("MongoDB")]
  node_huggingface["Hugging Face API"]
end

node_citizen(("Citizen or admin"))

node_citizen -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_report
node_app -->|"provides"| node_theme
node_dashboard -->|"fetches issues"| node_issueservice
node_dashboard -->|"renders"| node_navbar
node_dashboard -->|"renders"| node_issuecards
node_dashboard -->|"renders"| node_issuemap
node_dashboard -->|"renders"| node_stats
node_dashboard -->|"renders"| node_chart
node_report -->|"submits through"| node_issueservice
node_login -->|"authenticates via"| node_authservice
node_register -->|"registers via"| node_authservice
node_authservice -->|"sends requests"| node_api
node_issueservice -->|"sends requests"| node_api
node_navbar -->|"reads and updates"| node_authstate
node_navbar -->|"toggles"| node_theme
node_protected -->|"checks session"| node_authstate
node_issuecards -->|"runs issue actions"| node_issueservice
node_server -->|"mounts"| node_authroutes
node_server -->|"mounts"| node_issueroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_authcontroller -->|"reads and writes"| node_userstore
node_issueroutes -->|"dispatches"| node_issuecontroller
node_issueroutes -->|"runs upload middleware"| node_issueupload
node_issuecontroller -->|"classifies text"| node_categorize
node_issuecontroller -->|"predicts severity"| node_severity
node_issuecontroller -->|"reads and writes"| node_issuemodel
node_issueupload -->|"configures upload"| node_cloudinary
node_categorize -.->|"uses inference"| node_huggingface
node_userstore -.->|"persists in"| node_mongodb
node_issuemodel -.->|"persists in"| node_mongodb
node_cloudinary -.->|"hosts uploaded images"| node_citizen
node_issueservice -->|"calls issue endpoints"| node_issueroutes
node_authservice -->|"calls auth endpoints"| node_authroutes

click node_app "https://github.com/daraanjali/fixmycity/blob/main/client/src/App.jsx"
click node_dashboard "https://github.com/daraanjali/fixmycity/blob/main/client/src/pages/Dashboard.jsx"
click node_report "https://github.com/daraanjali/fixmycity/blob/main/client/src/pages/ReportIssue.jsx"
click node_home "https://github.com/daraanjali/fixmycity/blob/main/client/src/pages/Home.jsx"
click node_login "https://github.com/daraanjali/fixmycity/blob/main/client/src/pages/Login.jsx"
click node_register "https://github.com/daraanjali/fixmycity/blob/main/client/src/pages/Register.jsx"
click node_authstate "https://github.com/daraanjali/fixmycity/blob/main/client/src/context/AuthContext.jsx"
click node_theme "https://github.com/daraanjali/fixmycity/blob/main/client/src/context/ThemeContext.jsx"
click node_navbar "https://github.com/daraanjali/fixmycity/blob/main/client/src/components/Navbar.jsx"
click node_issuecards "https://github.com/daraanjali/fixmycity/blob/main/client/src/components/IssueCard.jsx"
click node_issuemap "https://github.com/daraanjali/fixmycity/blob/main/client/src/components/IssueMap.jsx"
click node_stats "https://github.com/daraanjali/fixmycity/blob/main/client/src/components/StatsCard.jsx"
click node_chart "https://github.com/daraanjali/fixmycity/blob/main/client/src/components/StatusChart.jsx"
click node_authservice "https://github.com/daraanjali/fixmycity/blob/main/client/src/services/authService.js"
click node_protected "https://github.com/daraanjali/fixmycity/blob/main/client/src/components/ProtectedRoute.jsx"
click node_api "https://github.com/daraanjali/fixmycity/blob/main/client/src/utils/api.js"
click node_issueservice "https://github.com/daraanjali/fixmycity/blob/main/client/src/services/issueService.js"
click node_server "https://github.com/daraanjali/fixmycity/blob/main/server/src/app.js"
click node_authroutes "https://github.com/daraanjali/fixmycity/blob/main/server/src/routes/authRoutes.js"
click node_authcontroller "https://github.com/daraanjali/fixmycity/blob/main/server/src/controllers/authController.js"
click node_userstore "https://github.com/daraanjali/fixmycity/blob/main/server/src/models/User.js"
click node_issueroutes "https://github.com/daraanjali/fixmycity/blob/main/server/src/routes/issueRoutes.js"
click node_issuecontroller "https://github.com/daraanjali/fixmycity/blob/main/server/src/controllers/issueController.js"
click node_issueupload "https://github.com/daraanjali/fixmycity/blob/main/server/src/middleware/uploadMiddleware.js"
click node_issuemodel "https://github.com/daraanjali/fixmycity/blob/main/server/src/models/Issue.js"
click node_categorize "https://github.com/daraanjali/fixmycity/blob/main/server/src/utils/aiCategorize.js"
click node_severity "https://github.com/daraanjali/fixmycity/blob/main/server/src/utils/aiSeverity.js"
click node_cloudinary "https://github.com/daraanjali/fixmycity/blob/main/server/src/config/cloudinary.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_dashboard,node_report,node_home,node_login,node_register,node_authstate,node_theme,node_navbar,node_issuecards,node_issuemap,node_stats,node_chart,node_api toneBlue
class node_authservice,node_protected,node_authroutes,node_authcontroller toneAmber
class node_issueservice,node_issueroutes,node_issuecontroller,node_issueupload,node_categorize,node_severity toneMint
class node_server,node_userstore,node_issuemodel,node_cloudinary,node_mongodb,node_huggingface toneRose
class node_citizen toneIndigo
```

## Components

### Web client

- [Route shell](https://github.com/daraanjali/fixmycity/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Issue dashboard](https://github.com/daraanjali/fixmycity/blob/main/client/src/pages/Dashboard.jsx): `client/src/pages/Dashboard.jsx`
- [Report form](https://github.com/daraanjali/fixmycity/blob/main/client/src/pages/ReportIssue.jsx): `client/src/pages/ReportIssue.jsx`
- [Home page](https://github.com/daraanjali/fixmycity/blob/main/client/src/pages/Home.jsx): `client/src/pages/Home.jsx`
- [Login page](https://github.com/daraanjali/fixmycity/blob/main/client/src/pages/Login.jsx): `client/src/pages/Login.jsx`
- [Registration page](https://github.com/daraanjali/fixmycity/blob/main/client/src/pages/Register.jsx): `client/src/pages/Register.jsx`
- [Auth state](https://github.com/daraanjali/fixmycity/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Theme state](https://github.com/daraanjali/fixmycity/blob/main/client/src/context/ThemeContext.jsx): `client/src/context/ThemeContext.jsx`
- [Navigation](https://github.com/daraanjali/fixmycity/blob/main/client/src/components/Navbar.jsx): `client/src/components/Navbar.jsx`
- [Issue cards](https://github.com/daraanjali/fixmycity/blob/main/client/src/components/IssueCard.jsx): `client/src/components/IssueCard.jsx`
- [Issue map](https://github.com/daraanjali/fixmycity/blob/main/client/src/components/IssueMap.jsx): `client/src/components/IssueMap.jsx`
- [Dashboard stats](https://github.com/daraanjali/fixmycity/blob/main/client/src/components/StatsCard.jsx): `client/src/components/StatsCard.jsx`
- [Status chart](https://github.com/daraanjali/fixmycity/blob/main/client/src/components/StatusChart.jsx): `client/src/components/StatusChart.jsx`
- [HTTP client](https://github.com/daraanjali/fixmycity/blob/main/client/src/utils/api.js): `client/src/utils/api.js`

### Identity and access

- [Auth API client](https://github.com/daraanjali/fixmycity/blob/main/client/src/services/authService.js): `client/src/services/authService.js`
- [Route guard](https://github.com/daraanjali/fixmycity/blob/main/client/src/components/ProtectedRoute.jsx): `client/src/components/ProtectedRoute.jsx`
- [Auth routes](https://github.com/daraanjali/fixmycity/blob/main/server/src/routes/authRoutes.js): `server/src/routes/authRoutes.js`
- [Auth controller](https://github.com/daraanjali/fixmycity/blob/main/server/src/controllers/authController.js): `server/src/controllers/authController.js`

### Issue handling

- [Issue API client](https://github.com/daraanjali/fixmycity/blob/main/client/src/services/issueService.js): `client/src/services/issueService.js`
- [Issue routes](https://github.com/daraanjali/fixmycity/blob/main/server/src/routes/issueRoutes.js): `server/src/routes/issueRoutes.js`
- [Issue controller](https://github.com/daraanjali/fixmycity/blob/main/server/src/controllers/issueController.js): `server/src/controllers/issueController.js`
- [Image upload](https://github.com/daraanjali/fixmycity/blob/main/server/src/middleware/uploadMiddleware.js): `server/src/middleware/uploadMiddleware.js`
- [AI categorization](https://github.com/daraanjali/fixmycity/blob/main/server/src/utils/aiCategorize.js): `server/src/utils/aiCategorize.js`
- [Severity prediction](https://github.com/daraanjali/fixmycity/blob/main/server/src/utils/aiSeverity.js): `server/src/utils/aiSeverity.js`

### Storage and integrations

- [Express app](https://github.com/daraanjali/fixmycity/blob/main/server/src/app.js): `server/src/app.js`
- [User records](https://github.com/daraanjali/fixmycity/blob/main/server/src/models/User.js): `server/src/models/User.js`
- [Issue records](https://github.com/daraanjali/fixmycity/blob/main/server/src/models/Issue.js): `server/src/models/Issue.js`
- [Image hosting](https://github.com/daraanjali/fixmycity/blob/main/server/src/config/cloudinary.js): `server/src/config/cloudinary.js`
- **MongoDB**
- **Hugging Face API**

### Other components

- **Citizen or admin**

## Connections

- Citizen or admin → Route shell: uses (evidence: `client/src/App.jsx`)
- Route shell → Home page: routes to (evidence: `client/src/App.jsx`)
- Route shell → Login page: routes to (evidence: `client/src/App.jsx`)
- Route shell → Registration page: routes to (evidence: `client/src/App.jsx`)
- Route shell → Issue dashboard: routes to (evidence: `client/src/App.jsx`)
- Route shell → Report form: routes to (evidence: `client/src/App.jsx`)
- Route shell → Theme state: provides (evidence: `client/src/App.jsx`)
- Issue dashboard → Issue API client: fetches issues (evidence: `client/src/pages/Dashboard.jsx`)
- Issue dashboard → Navigation: renders (evidence: `client/src/pages/Dashboard.jsx`)
- Issue dashboard → Issue cards: renders (evidence: `client/src/pages/Dashboard.jsx`)
- Issue dashboard → Issue map: renders (evidence: `client/src/pages/Dashboard.jsx`)
- Issue dashboard → Dashboard stats: renders (evidence: `client/src/pages/Dashboard.jsx`)
- Issue dashboard → Status chart: renders (evidence: `client/src/pages/Dashboard.jsx`)
- Report form → Issue API client: submits through (evidence: `client/src/pages/ReportIssue.jsx`)
- Login page → Auth API client: authenticates via (evidence: `client/src/pages/Login.jsx`)
- Registration page → Auth API client: registers via (evidence: `client/src/pages/Register.jsx`)
- Auth API client → HTTP client: sends requests (evidence: `client/src/services/authService.js`)
- Issue API client → HTTP client: sends requests (evidence: `client/src/services/issueService.js`)
- Navigation → Auth state: reads and updates (evidence: `client/src/components/Navbar.jsx`)
- Navigation → Theme state: toggles (evidence: `client/src/components/Navbar.jsx`)
- Route guard → Auth state: checks session (evidence: `client/src/components/ProtectedRoute.jsx`)
- Issue cards → Issue API client: runs issue actions (evidence: `client/src/components/IssueCard.jsx`)
- Express app → Auth routes: mounts (evidence: `server/src/app.js`)
- Express app → Issue routes: mounts (evidence: `server/src/app.js`)
- Auth routes → Auth controller: dispatches (evidence: `server/src/routes/authRoutes.js`)
- Auth controller → User records: reads and writes (evidence: `server/src/controllers/authController.js`)
- Issue routes → Issue controller: dispatches (evidence: `server/src/routes/issueRoutes.js`)
- Issue routes → Image upload: runs upload middleware (evidence: `server/src/routes/issueRoutes.js`)
- Issue controller → AI categorization: classifies text (evidence: `server/src/controllers/issueController.js`)
- Issue controller → Severity prediction: predicts severity (evidence: `server/src/controllers/issueController.js`)
- Issue controller → Issue records: reads and writes (evidence: `server/src/controllers/issueController.js`)
- Image upload → Image hosting: configures upload (evidence: `server/src/middleware/uploadMiddleware.js`)
- AI categorization → Hugging Face API: uses inference (evidence: `README.md`)
- User records → MongoDB: persists in (evidence: `README.md`)
- Issue records → MongoDB: persists in (evidence: `README.md`)
- Image hosting → Citizen or admin: hosts uploaded images (evidence: `README.md`)
- Issue API client → Issue routes: calls issue endpoints (evidence: `client/src/services/issueService.js`)
- Auth API client → Auth routes: calls auth endpoints (evidence: `client/src/services/authService.js`)
