# utkarshkumar5257/moving_road_inspectors architecture

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

- Interactive diagram: https://gitdiagram.com/utkarshkumar5257/moving_road_inspectors
- Repository: https://github.com/utkarshkumar5257/moving_road_inspectors

## Overview

Drishti is a civic road-and-water incident monitoring product. Users view mapped incidents and fleet activity, while operators can submit reports, run video/GPS simulations, and inspect datasets and service capabilities. The backend processes capture jobs into detections and clustered incidents, then exposes operational data and live updates to the web application. The source index and excerpts support the primary API, frontend, and inference relationships; several listed pages and the parallel `services/services` backend tree were not sampled, so their internal wiring is not inferred.

Main entry points: [`sih_project introduction/services/api/app/pipeline.py`](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/api/app/pipeline.py) (Capture job pipeline), [`sih_project introduction/services/api/app/main.py`](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/api/app/main.py) (API application), [`sih_project introduction/apps/web/src/App.tsx`](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/apps/web/src/App.tsx) (Web app shell), [`sih_project introduction/apps/web/src/pages/Dashboard.tsx`](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/apps/web/src/pages/Dashboard.tsx) (Incident dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_webapp["Web app shell<br/>[App.tsx]"]
  node_dashboard["Incident dashboard<br/>[Dashboard.tsx]"]
  node_webapi["Web API client<br/>[api.ts]"]
  node_cities["City definitions<br/>[cities.ts]"]
  node_hotspots["Incident hotspots<br/>[hotspots.ts]"]
  node_auth["Supabase auth<br/>[auth.ts]"]
  node_webstore["Supabase web client<br/>[supabase.ts]"]
end

subgraph group_api["API and operations"]
  node_apiapp["API application<br/>[main.py]"]
  node_apirouters["API route handlers"]
  node_weather["Weather routes<br/>[weather.py]"]
  node_parallelapi["Parallel API tree"]
end

subgraph group_processing["Detection processing"]
  node_jobpipeline["Capture job pipeline<br/>[pipeline.py]"]
  node_inference["Model inference<br/>[orchestrator.py]"]
  node_severity["Severity scoring<br/>[severity.py]"]
  node_weathergate["Weather gating<br/>[weather_gate.py]"]
  node_clusters["Incident clustering<br/>[clustering.py]"]
end

subgraph group_data["Persistence and integrations"]
  node_db[("API database<br/>[db.py]")]
  node_models["API data models<br/>[models.py]"]
  node_supabaseingest["Supabase ingest<br/>[supabase_ingest.py]"]
end

node_operator(("Public and operators"))

node_operator -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_dashboard
node_webapp -->|"loads session"| node_webapi
node_webapp -->|"selects city"| node_cities
node_dashboard -->|"filters by city"| node_cities
node_dashboard -->|"builds hotspots"| node_hotspots
node_apiapp -->|"registers routes"| node_apirouters
node_apiapp -->|"registers routes"| node_weather
node_jobpipeline -->|"runs detection"| node_inference
node_jobpipeline -->|"scores severity"| node_severity
node_jobpipeline -->|"applies weather gate"| node_weathergate
node_jobpipeline -->|"clusters detections"| node_clusters
node_jobpipeline -->|"updates job state"| node_db
node_jobpipeline -->|"writes incidents"| node_models
node_apiapp -->|"initializes database"| node_db
node_apiapp -.->|"serves API and feed"| node_operator
node_auth -->|"uses auth client"| node_webstore
node_jobpipeline -.->|"optional persistence"| node_supabaseingest

click node_webapp "https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/apps/web/src/App.tsx"
click node_dashboard "https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/apps/web/src/pages/Dashboard.tsx"
click node_webapi "https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/apps/web/src/api.ts"
click node_cities "https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/apps/web/src/cities.ts"
click node_hotspots "https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/apps/web/src/hotspots.ts"
click node_auth "https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/apps/web/src/services/supabase/auth.ts"
click node_webstore "https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/apps/web/src/lib/supabase.ts"
click node_apiapp "https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/api/app/main.py"
click node_apirouters "https://github.com/utkarshkumar5257/moving_road_inspectors/tree/main/sih_project%20introduction/services/api/app/routers"
click node_jobpipeline "https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/api/app/pipeline.py"
click node_inference "https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/detect/inference/orchestrator.py"
click node_severity "https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/detect/severity.py"
click node_weathergate "https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/detect/weather_gate.py"
click node_clusters "https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/api/app/clustering.py"
click node_db "https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/api/app/db.py"
click node_models "https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/api/app/models.py"
click node_weather "https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/api/app/routers/weather.py"
click node_supabaseingest "https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/api/app/supabase_ingest.py"
click node_parallelapi "https://github.com/utkarshkumar5257/moving_road_inspectors/tree/main/sih_project%20introduction/services/services/api/app"

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_webapp,node_dashboard,node_webapi,node_cities,node_hotspots,node_auth,node_webstore toneBlue
class node_apiapp,node_apirouters,node_weather,node_parallelapi toneAmber
class node_jobpipeline,node_inference,node_severity,node_weathergate,node_clusters toneMint
class node_db,node_models,node_supabaseingest toneRose
class node_operator toneIndigo
```

## Components

### Web application

- [Web app shell](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/apps/web/src/App.tsx): `sih_project introduction/apps/web/src/App.tsx`
- [Incident dashboard](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/apps/web/src/pages/Dashboard.tsx): `sih_project introduction/apps/web/src/pages/Dashboard.tsx`
- [Web API client](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/apps/web/src/api.ts): `sih_project introduction/apps/web/src/api.ts`
- [City definitions](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/apps/web/src/cities.ts): `sih_project introduction/apps/web/src/cities.ts`
- [Incident hotspots](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/apps/web/src/hotspots.ts): `sih_project introduction/apps/web/src/hotspots.ts`
- [Supabase auth](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/apps/web/src/services/supabase/auth.ts): `sih_project introduction/apps/web/src/services/supabase/auth.ts`
- [Supabase web client](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/apps/web/src/lib/supabase.ts): `sih_project introduction/apps/web/src/lib/supabase.ts`

### API and operations

- [API application](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/api/app/main.py): `sih_project introduction/services/api/app/main.py`
- [API route handlers](https://github.com/utkarshkumar5257/moving_road_inspectors/tree/main/sih_project%20introduction/services/api/app/routers): `sih_project introduction/services/api/app/routers`
- [Weather routes](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/api/app/routers/weather.py): `sih_project introduction/services/api/app/routers/weather.py`
- [Parallel API tree](https://github.com/utkarshkumar5257/moving_road_inspectors/tree/main/sih_project%20introduction/services/services/api/app): `sih_project introduction/services/services/api/app`

### Detection processing

- [Capture job pipeline](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/api/app/pipeline.py): `sih_project introduction/services/api/app/pipeline.py`
- [Model inference](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/detect/inference/orchestrator.py): `sih_project introduction/services/detect/inference/orchestrator.py`
- [Severity scoring](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/detect/severity.py): `sih_project introduction/services/detect/severity.py`
- [Weather gating](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/detect/weather_gate.py): `sih_project introduction/services/detect/weather_gate.py`
- [Incident clustering](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/api/app/clustering.py): `sih_project introduction/services/api/app/clustering.py`

### Persistence and integrations

- [API database](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/api/app/db.py): `sih_project introduction/services/api/app/db.py`
- [API data models](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/api/app/models.py): `sih_project introduction/services/api/app/models.py`
- [Supabase ingest](https://github.com/utkarshkumar5257/moving_road_inspectors/blob/main/sih_project%20introduction/services/api/app/supabase_ingest.py): `sih_project introduction/services/api/app/supabase_ingest.py`

### Other components

- **Public and operators**

## Connections

- Public and operators → Web app shell: uses (evidence: `sih_project introduction/apps/web/src/App.tsx`)
- Web app shell → Incident dashboard: routes to (evidence: `sih_project introduction/apps/web/src/App.tsx`)
- Web app shell → Web API client: loads session (evidence: `sih_project introduction/apps/web/src/App.tsx`)
- Web app shell → City definitions: selects city (evidence: `sih_project introduction/apps/web/src/App.tsx`)
- Incident dashboard → City definitions: filters by city (evidence: `sih_project introduction/apps/web/src/pages/Dashboard.tsx`)
- Incident dashboard → Incident hotspots: builds hotspots (evidence: `sih_project introduction/apps/web/src/pages/Dashboard.tsx`)
- API application → API route handlers: registers routes (evidence: `sih_project introduction/services/api/app/main.py`)
- API application → Weather routes: registers routes (evidence: `sih_project introduction/services/api/app/main.py`)
- Capture job pipeline → Model inference: runs detection (evidence: `sih_project introduction/services/api/app/pipeline.py`)
- Capture job pipeline → Severity scoring: scores severity (evidence: `sih_project introduction/services/api/app/pipeline.py`)
- Capture job pipeline → Weather gating: applies weather gate (evidence: `sih_project introduction/services/api/app/pipeline.py`)
- Capture job pipeline → Incident clustering: clusters detections (evidence: `sih_project introduction/services/api/app/pipeline.py`)
- Capture job pipeline → API database: updates job state (evidence: `sih_project introduction/services/api/app/pipeline.py`)
- Capture job pipeline → API data models: writes incidents (evidence: `sih_project introduction/services/api/app/pipeline.py`)
- API application → API database: initializes database (evidence: `sih_project introduction/services/api/app/main.py`)
- API application → Public and operators: serves API and feed
- Supabase auth → Supabase web client: uses auth client (evidence: `sih_project introduction/apps/web/src/services/supabase/auth.ts`)
- Capture job pipeline → Supabase ingest: optional persistence (evidence: `sih_project introduction/services/api/app/pipeline.py`)
