# adityagehlot356/civix architecture

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

- Interactive diagram: https://gitdiagram.com/adityagehlot356/civix
- Repository: https://github.com/adityagehlot356/civix

## Overview

CIVIX is a civic issue-reporting and resolution platform. Residents report, discuss, and track local issues; district administrators review and assign them; workers update assigned issues through resolution. The frontend provides role-specific dashboards and account views, while the Express backend exposes API routes and persists domain records. Chat uses Socket.IO for live message delivery. The README gives no capability detail, and several controllers and frontend screens were not sampled, so unsampled feature wiring is represented only where the route tree supports it.

Main entry points: [`frontend/src/App.js`](https://github.com/adityagehlot356/civix/blob/main/frontend/src/App.js) (Role-based app), [`backend/app.js`](https://github.com/adityagehlot356/civix/blob/main/backend/app.js) (Express API), [`frontend/src/services/api.js`](https://github.com/adityagehlot356/civix/blob/main/frontend/src/services/api.js) (HTTP client), [`backend/controllers/workerController.js`](https://github.com/adityagehlot356/civix/blob/main/backend/controllers/workerController.js) (Worker resolution)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_web["Role-based app<br/>[App.js]"]
  node_issue_ui["Report and browse<br/>[Report.jsx]"]
  node_admin_ui["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_worker_ui["Worker dashboard"]
  node_issue_detail["Issue details<br/>[IssueDetails.jsx]"]
  node_api_client["HTTP client<br/>[api.js]"]
  node_chat_ui["Chat and history<br/>[Chat.jsx]"]
  node_profile_ui["Profile screens<br/>[Profile.jsx]"]
  node_superadmin_ui["Account management"]
end

subgraph group_api["API and access"]
  node_backend["Express API<br/>[app.js]"]
  node_auth_routes["Auth routes<br/>[authRoutes.js]"]
  node_issue_routes["Issue routes<br/>[issueRoutes.js]"]
  node_admin_routes["Admin routes<br/>[adminRoutes.js]"]
  node_worker_routes["Worker routes<br/>[workerRoutes.js]"]
  node_chat_routes["Chat routes<br/>[chatRoutes.js]"]
  node_user_routes["User routes<br/>[userRoutes.js]"]
  node_superadmin_routes["Superadmin routes"]
end

subgraph group_issues["Issue resolution"]
  node_issue_ctrl["Issue handling<br/>[issueController.js]"]
  node_admin_ctrl["District assignment<br/>[adminController.js]"]
  node_worker_ctrl["Worker resolution"]
  node_issue_store[("Issue records<br/>[Issue.js]")]
end

subgraph group_community["Community features"]
  node_notification_store[("Notifications<br/>[Notification.js]")]
  node_server["Socket server<br/>[server.js]"]
  node_message_store[("Messages<br/>[Message.js]")]
end

subgraph group_accounts["Accounts and messaging"]
  node_user_store[("User records<br/>[User.js]")]
end

node_resident(("CIVIX user"))
node_email["Email service"]
node_s3[("AWS S3")]

node_resident -->|"uses"| node_web
node_web -->|"routes to"| node_issue_ui
node_web -->|"routes to"| node_admin_ui
node_web -->|"routes to"| node_worker_ui
node_web -->|"routes to"| node_issue_detail
node_web -->|"routes to"| node_chat_ui
node_web -->|"routes to"| node_profile_ui
node_web -->|"routes to"| node_superadmin_ui
node_issue_ui -->|"requests"| node_api_client
node_issue_detail -->|"requests"| node_api_client
node_admin_ui -->|"requests"| node_api_client
node_worker_ui -->|"requests"| node_api_client
node_profile_ui -->|"requests"| node_api_client
node_superadmin_ui -->|"requests"| node_api_client
node_api_client -->|"HTTP calls"| node_backend
node_backend -->|"dispatches"| node_auth_routes
node_backend -->|"dispatches"| node_issue_routes
node_backend -->|"dispatches"| node_admin_routes
node_backend -->|"dispatches"| node_worker_routes
node_backend -->|"dispatches"| node_user_routes
node_backend -->|"dispatches"| node_chat_routes
node_backend -->|"dispatches"| node_superadmin_routes
node_issue_routes -->|"dispatches"| node_issue_ctrl
node_admin_routes -->|"dispatches"| node_admin_ctrl
node_worker_routes -->|"dispatches"| node_worker_ctrl
node_user_routes -->|"profile access"| node_user_store
node_issue_ctrl -->|"reads and writes"| node_issue_store
node_issue_ctrl -->|"updates counts"| node_user_store
node_issue_ctrl -.->|"uploads images"| node_s3
node_admin_ctrl -->|"reads and assigns"| node_issue_store
node_admin_ctrl -->|"reads and updates"| node_user_store
node_admin_ctrl -.->|"sends updates"| node_email
node_worker_ctrl -->|"reads and updates"| node_issue_store
node_worker_ctrl -->|"updates counts"| node_user_store
node_worker_ctrl -->|"creates alerts"| node_notification_store
node_worker_ctrl -.->|"sends updates"| node_email
node_chat_ui -->|"loads history"| node_api_client
node_chat_ui -->|"socket messages"| node_server
node_chat_routes -->|"reads history"| node_message_store
node_server -->|"saves messages"| node_message_store
node_server -->|"looks up sender"| node_user_store
node_server -->|"emits events"| node_chat_ui

click node_web "https://github.com/adityagehlot356/civix/blob/main/frontend/src/App.js"
click node_issue_ui "https://github.com/adityagehlot356/civix/blob/main/frontend/src/components/Report/Report.jsx"
click node_admin_ui "https://github.com/adityagehlot356/civix/blob/main/frontend/src/components/Admin/AdminDashboard.jsx"
click node_worker_ui "https://github.com/adityagehlot356/civix/blob/main/frontend/src/components/Worker/WorkerDashboard.jsx"
click node_issue_detail "https://github.com/adityagehlot356/civix/blob/main/frontend/src/components/IssueDetails/IssueDetails.jsx"
click node_api_client "https://github.com/adityagehlot356/civix/blob/main/frontend/src/services/api.js"
click node_backend "https://github.com/adityagehlot356/civix/blob/main/backend/app.js"
click node_auth_routes "https://github.com/adityagehlot356/civix/blob/main/backend/routes/authRoutes.js"
click node_issue_routes "https://github.com/adityagehlot356/civix/blob/main/backend/routes/issueRoutes.js"
click node_admin_routes "https://github.com/adityagehlot356/civix/blob/main/backend/routes/adminRoutes.js"
click node_worker_routes "https://github.com/adityagehlot356/civix/blob/main/backend/routes/workerRoutes.js"
click node_issue_ctrl "https://github.com/adityagehlot356/civix/blob/main/backend/controllers/issueController.js"
click node_admin_ctrl "https://github.com/adityagehlot356/civix/blob/main/backend/controllers/adminController.js"
click node_worker_ctrl "https://github.com/adityagehlot356/civix/blob/main/backend/controllers/workerController.js"
click node_issue_store "https://github.com/adityagehlot356/civix/blob/main/backend/models/Issue.js"
click node_user_store "https://github.com/adityagehlot356/civix/blob/main/backend/models/User.js"
click node_notification_store "https://github.com/adityagehlot356/civix/blob/main/backend/models/Notification.js"
click node_chat_ui "https://github.com/adityagehlot356/civix/blob/main/frontend/src/components/Chat/Chat.jsx"
click node_chat_routes "https://github.com/adityagehlot356/civix/blob/main/backend/routes/chatRoutes.js"
click node_server "https://github.com/adityagehlot356/civix/blob/main/backend/server.js"
click node_message_store "https://github.com/adityagehlot356/civix/blob/main/backend/models/Message.js"
click node_profile_ui "https://github.com/adityagehlot356/civix/blob/main/frontend/src/components/Profile/Profile.jsx"
click node_user_routes "https://github.com/adityagehlot356/civix/blob/main/backend/routes/userRoutes.js"
click node_superadmin_ui "https://github.com/adityagehlot356/civix/blob/main/frontend/src/components/Superadmin/SuperadminManageAccounts.jsx"
click node_superadmin_routes "https://github.com/adityagehlot356/civix/blob/main/backend/routes/superadminRoutes.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_web,node_issue_ui,node_admin_ui,node_worker_ui,node_issue_detail,node_api_client,node_chat_ui,node_profile_ui,node_superadmin_ui,node_resident toneBlue
class node_backend,node_auth_routes,node_issue_routes,node_admin_routes,node_worker_routes,node_chat_routes,node_user_routes,node_superadmin_routes,node_s3 toneAmber
class node_issue_ctrl,node_admin_ctrl,node_worker_ctrl,node_issue_store toneMint
class node_notification_store,node_server,node_message_store toneRose
class node_user_store,node_email toneIndigo
```

## Components

### Web application

- [Role-based app](https://github.com/adityagehlot356/civix/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Report and browse](https://github.com/adityagehlot356/civix/blob/main/frontend/src/components/Report/Report.jsx): `frontend/src/components/Report/Report.jsx`
- [Admin dashboard](https://github.com/adityagehlot356/civix/blob/main/frontend/src/components/Admin/AdminDashboard.jsx): `frontend/src/components/Admin/AdminDashboard.jsx`
- [Worker dashboard](https://github.com/adityagehlot356/civix/blob/main/frontend/src/components/Worker/WorkerDashboard.jsx): `frontend/src/components/Worker/WorkerDashboard.jsx`
- [Issue details](https://github.com/adityagehlot356/civix/blob/main/frontend/src/components/IssueDetails/IssueDetails.jsx): `frontend/src/components/IssueDetails/IssueDetails.jsx`
- [HTTP client](https://github.com/adityagehlot356/civix/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Chat and history](https://github.com/adityagehlot356/civix/blob/main/frontend/src/components/Chat/Chat.jsx): `frontend/src/components/Chat/Chat.jsx`
- [Profile screens](https://github.com/adityagehlot356/civix/blob/main/frontend/src/components/Profile/Profile.jsx): `frontend/src/components/Profile/Profile.jsx`
- [Account management](https://github.com/adityagehlot356/civix/blob/main/frontend/src/components/Superadmin/SuperadminManageAccounts.jsx): `frontend/src/components/Superadmin/SuperadminManageAccounts.jsx`

### API and access

- [Express API](https://github.com/adityagehlot356/civix/blob/main/backend/app.js): `backend/app.js`
- [Auth routes](https://github.com/adityagehlot356/civix/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Issue routes](https://github.com/adityagehlot356/civix/blob/main/backend/routes/issueRoutes.js): `backend/routes/issueRoutes.js`
- [Admin routes](https://github.com/adityagehlot356/civix/blob/main/backend/routes/adminRoutes.js): `backend/routes/adminRoutes.js`
- [Worker routes](https://github.com/adityagehlot356/civix/blob/main/backend/routes/workerRoutes.js): `backend/routes/workerRoutes.js`
- [Chat routes](https://github.com/adityagehlot356/civix/blob/main/backend/routes/chatRoutes.js): `backend/routes/chatRoutes.js`
- [User routes](https://github.com/adityagehlot356/civix/blob/main/backend/routes/userRoutes.js): `backend/routes/userRoutes.js`
- [Superadmin routes](https://github.com/adityagehlot356/civix/blob/main/backend/routes/superadminRoutes.js): `backend/routes/superadminRoutes.js`

### Issue resolution

- [Issue handling](https://github.com/adityagehlot356/civix/blob/main/backend/controllers/issueController.js): `backend/controllers/issueController.js`
- [District assignment](https://github.com/adityagehlot356/civix/blob/main/backend/controllers/adminController.js): `backend/controllers/adminController.js`
- [Worker resolution](https://github.com/adityagehlot356/civix/blob/main/backend/controllers/workerController.js): `backend/controllers/workerController.js`
- [Issue records](https://github.com/adityagehlot356/civix/blob/main/backend/models/Issue.js): `backend/models/Issue.js`

### Community features

- [Notifications](https://github.com/adityagehlot356/civix/blob/main/backend/models/Notification.js): `backend/models/Notification.js`
- [Socket server](https://github.com/adityagehlot356/civix/blob/main/backend/server.js): `backend/server.js`
- [Messages](https://github.com/adityagehlot356/civix/blob/main/backend/models/Message.js): `backend/models/Message.js`

### Accounts and messaging

- [User records](https://github.com/adityagehlot356/civix/blob/main/backend/models/User.js): `backend/models/User.js`

### Other components

- **CIVIX user**
- **Email service**
- **AWS S3**

## Connections

- CIVIX user → Role-based app: uses
- Role-based app → Report and browse: routes to
- Role-based app → Admin dashboard: routes to
- Role-based app → Worker dashboard: routes to
- Role-based app → Issue details: routes to
- Role-based app → Chat and history: routes to
- Role-based app → Profile screens: routes to
- Role-based app → Account management: routes to
- Report and browse → HTTP client: requests
- Issue details → HTTP client: requests
- Admin dashboard → HTTP client: requests
- Worker dashboard → HTTP client: requests
- Profile screens → HTTP client: requests
- Account management → HTTP client: requests
- HTTP client → Express API: HTTP calls
- Express API → Auth routes: dispatches
- Express API → Issue routes: dispatches
- Express API → Admin routes: dispatches
- Express API → Worker routes: dispatches
- Express API → User routes: dispatches
- Express API → Chat routes: dispatches
- Express API → Superadmin routes: dispatches
- Issue routes → Issue handling: dispatches
- Admin routes → District assignment: dispatches
- Worker routes → Worker resolution: dispatches
- User routes → User records: profile access
- Issue handling → Issue records: reads and writes
- Issue handling → User records: updates counts
- Issue handling → AWS S3: uploads images
- District assignment → Issue records: reads and assigns
- District assignment → User records: reads and updates
- District assignment → Email service: sends updates
- Worker resolution → Issue records: reads and updates
- Worker resolution → User records: updates counts
- Worker resolution → Notifications: creates alerts
- Worker resolution → Email service: sends updates
- Chat and history → HTTP client: loads history
- Chat and history → Socket server: socket messages
- Chat routes → Messages: reads history
- Socket server → Messages: saves messages
- Socket server → User records: looks up sender
- Socket server → Chat and history: emits events
