# abhishekvishwakarma2027/cscrs architecture

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

- Interactive diagram: https://gitdiagram.com/abhishekvishwakarma2027/cscrs
- Repository: https://github.com/abhishekvishwakarma2027/cscrs

## Overview

CSCRS is a civic-issue reporting and municipal resolution platform. Citizens submit image- and location-based reports through web or mobile; the backend verifies and routes issues, administrators dispatch workers, and workers submit resolution evidence for AI or manual review. The platform also provides public dashboards and updates, feedback, notifications, and super-admin governance. The graph combines documented capabilities with sampled route wiring; several service-level links are documented product flows, not inspected call sites.

Main entry points: [`backend/api/routes.py`](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/api/routes.py) (API Router), [`backend/services/report_service.py`](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/services/report_service.py) (Report Processing), [`backend/database/connection.py`](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/database/connection.py) (Relational Database), [`backend/api/resolution.py`](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/api/resolution.py) (Resolution API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Citizen and Staff Clients"]
  node_web_portal["Web Portal<br/>[router.tsx]"]
  node_mobile_app["Mobile App<br/>[App.tsx]"]
end

subgraph group_api["Backend API"]
  node_api_entry["FastAPI Application<br/>[app.py]"]
  node_api_routes["API Router<br/>[routes.py]"]
  node_report_api["Report API<br/>[report.py]"]
  node_worker_api["Worker API<br/>[worker.py]"]
  node_assignment_api["Assignment API<br/>[assignment.py]"]
  node_resolution_api["Resolution API<br/>[resolution.py]"]
  node_governance_api["Governance APIs<br/>[super_admin.py]"]
end

subgraph group_operations["Issue Operations"]
  node_report_processing["Report Processing<br/>[report_service.py]"]
  node_image_verification["Image Verification<br/>[engine.py]"]
  node_resolution_review["Resolution Review<br/>[engine.py]"]
  node_dispatch["Worker Dispatch<br/>[assignment.py]"]
end

subgraph group_platform["Platform Services"]
  node_authentication["Authentication<br/>[auth_service.py]"]
  node_public_transparency["Public Transparency"]
  node_governance_services["Governance and Audit"]
  node_relational_store[("Relational Database<br/>[connection.py]")]
  node_media_storage["Media Storage<br/>[base.py]"]
end

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

node_citizen -->|"reports issues"| node_mobile_app
node_citizen -->|"uses portal"| node_web_portal
node_municipal_staff -->|"manages operations"| node_web_portal
node_mobile_app -.->|"uses platform API"| node_api_entry
node_web_portal -.->|"uses platform API"| node_api_entry
node_api_entry -->|"mounts routes"| node_api_routes
node_api_routes -->|"registers"| node_report_api
node_api_routes -->|"registers"| node_worker_api
node_api_routes -->|"registers"| node_assignment_api
node_api_routes -->|"registers"| node_resolution_api
node_api_routes -->|"registers"| node_governance_api
node_report_api -.->|"handles reporting"| node_report_processing
node_report_processing -.->|"verifies images"| node_image_verification
node_report_processing -.->|"persists reports"| node_relational_store
node_report_processing -.->|"stores media"| node_media_storage
node_assignment_api -.->|"dispatches workers"| node_dispatch
node_worker_api -.->|"supports field work"| node_dispatch
node_resolution_api -.->|"validates resolution"| node_resolution_review
node_resolution_api -.->|"records outcomes"| node_relational_store
node_api_routes -->|"registers auth routes"| node_authentication
node_governance_api -.->|"governs platform"| node_governance_services
node_governance_services -.->|"records governance data"| node_relational_store
node_api_routes -.->|"registers public routes"| node_public_transparency
node_public_transparency -.->|"reads telemetry"| node_relational_store
node_image_verification -.->|"returns verification"| node_report_processing

click node_web_portal "https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/frontend/src/app/router.tsx"
click node_mobile_app "https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/mobile/src/app/App.tsx"
click node_api_entry "https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/api/app.py"
click node_api_routes "https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/api/routes.py"
click node_report_api "https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/api/report.py"
click node_worker_api "https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/api/worker.py"
click node_assignment_api "https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/api/assignment.py"
click node_resolution_api "https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/api/resolution.py"
click node_governance_api "https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/api/super_admin.py"
click node_report_processing "https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/services/report_service.py"
click node_image_verification "https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/inference/engine.py"
click node_resolution_review "https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/inference/resolution_ai/engine.py"
click node_dispatch "https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/services/assignment.py"
click node_authentication "https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/services/auth_service.py"
click node_public_transparency "https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/services/public_dashboard_service.py"
click node_governance_services "https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/services/super_admin_service.py"
click node_relational_store "https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/database/connection.py"
click node_media_storage "https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/storage/base.py"

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_portal,node_mobile_app toneBlue
class node_api_entry,node_api_routes,node_report_api,node_worker_api,node_assignment_api,node_resolution_api,node_governance_api toneAmber
class node_report_processing,node_image_verification,node_resolution_review,node_dispatch toneMint
class node_authentication,node_public_transparency,node_governance_services,node_relational_store,node_media_storage toneRose
class node_citizen,node_municipal_staff toneIndigo
```

## Components

### Citizen and Staff Clients

- [Web Portal](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/frontend/src/app/router.tsx): `frontend/src/app/router.tsx`
- [Mobile App](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/mobile/src/app/App.tsx): `mobile/src/app/App.tsx`

### Backend API

- [FastAPI Application](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/api/app.py): `backend/api/app.py`
- [API Router](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/api/routes.py): `backend/api/routes.py`
- [Report API](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/api/report.py): `backend/api/report.py`
- [Worker API](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/api/worker.py): `backend/api/worker.py`
- [Assignment API](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/api/assignment.py): `backend/api/assignment.py`
- [Resolution API](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/api/resolution.py): `backend/api/resolution.py`
- [Governance APIs](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/api/super_admin.py): `backend/api/super_admin.py`

### Issue Operations

- [Report Processing](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/services/report_service.py): `backend/services/report_service.py`
- [Image Verification](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/inference/engine.py): `backend/inference/engine.py`
- [Resolution Review](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/inference/resolution_ai/engine.py): `backend/inference/resolution_ai/engine.py`
- [Worker Dispatch](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/services/assignment.py): `backend/services/assignment.py`

### Platform Services

- [Authentication](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/services/auth_service.py): `backend/services/auth_service.py`
- [Public Transparency](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/services/public_dashboard_service.py): `backend/services/public_dashboard_service.py`
- [Governance and Audit](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/services/super_admin_service.py): `backend/services/super_admin_service.py`
- [Relational Database](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/database/connection.py): `backend/database/connection.py`
- [Media Storage](https://github.com/abhishekvishwakarma2027/cscrs/blob/v1.0.1/backend/storage/base.py): `backend/storage/base.py`

### Other components

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

## Connections

- Citizen → Mobile App: reports issues
- Citizen → Web Portal: uses portal
- Municipal Staff → Web Portal: manages operations
- Mobile App → FastAPI Application: uses platform API
- Web Portal → FastAPI Application: uses platform API
- FastAPI Application → API Router: mounts routes (evidence: `backend/api/app.py`)
- API Router → Report API: registers (evidence: `backend/api/routes.py`)
- API Router → Worker API: registers (evidence: `backend/api/routes.py`)
- API Router → Assignment API: registers (evidence: `backend/api/routes.py`)
- API Router → Resolution API: registers (evidence: `backend/api/routes.py`)
- API Router → Governance APIs: registers (evidence: `backend/api/routes.py`)
- Report API → Report Processing: handles reporting
- Report Processing → Image Verification: verifies images
- Report Processing → Relational Database: persists reports
- Report Processing → Media Storage: stores media
- Assignment API → Worker Dispatch: dispatches workers (evidence: `backend/api/assignment.py`)
- Worker API → Worker Dispatch: supports field work
- Resolution API → Resolution Review: validates resolution
- Resolution API → Relational Database: records outcomes
- API Router → Authentication: registers auth routes (evidence: `backend/api/routes.py`)
- Governance APIs → Governance and Audit: governs platform
- Governance and Audit → Relational Database: records governance data
- API Router → Public Transparency: registers public routes
- Public Transparency → Relational Database: reads telemetry
- Image Verification → Report Processing: returns verification
