# m4n1kya/argus architecture

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

- Interactive diagram: https://gitdiagram.com/m4n1kya/argus
- Repository: https://github.com/m4n1kya/argus

## Overview

ARGUS is a geospatial urban-hazard reporting and visualization platform. The evidenced workflow is an operator viewing incidents on the 2D map, which fetches and normalizes hazard records from the FastAPI service; submitted reports are persisted as spatial hazard records. The repository also provides a Cesium globe and documents predictive and vision-analysis capabilities, but sampled code does not establish an implemented AI service connection. The architecture below distinguishes documented capabilities from source-evidenced calls.

Main entry points: [`frontend/src/app/components/map/ArgusLeafletMap.tsx`](https://github.com/m4n1kya/argus/blob/main/frontend/src/app/components/map/ArgusLeafletMap.tsx) (2D incident map), [`backend/main.py`](https://github.com/m4n1kya/argus/blob/main/backend/main.py) (Hazard API), [`backend/database.py`](https://github.com/m4n1kya/argus/blob/main/backend/database.py) (Spatial database access), [`frontend/src/app/map/page.tsx`](https://github.com/m4n1kya/argus/blob/main/frontend/src/app/map/page.tsx) (Map page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Operator interface"]
  node_landing["Platform landing<br/>[page.tsx]"]
  node_map_page["Map page<br/>[page.tsx]"]
  node_globe_page["Globe page<br/>[page.tsx]"]
  node_report_page["Report hazard<br/>[page.tsx]"]
end

subgraph group_geo["Geospatial views"]
  node_leaflet["2D incident map"]
  node_map_layers["Map overlays"]
  node_search["Location search<br/>[SearchBar.tsx]"]
  node_street_view["Street inspection"]
  node_cesium_view["3D globe viewer<br/>[CesiumViewer.tsx]"]
  node_cesium_workers["Cesium worker runtime"]
end

subgraph group_services["Incident services"]
  node_incident_adapter["Incident API adapter<br/>[incidentAdapter.ts]"]
  node_geocoder["Geocoding provider"]
  node_map_provider["Map provider<br/>[mapProvider.ts]"]
  node_mapillary["Mapillary provider"]
end

subgraph group_backend["API and persistence"]
  node_api["Hazard API<br/>[main.py]"]
  node_schemas["Hazard schemas<br/>[schemas.py]"]
  node_hazard_model["Hazard model<br/>[models.py]"]
  node_database[("Spatial database access<br/>[database.py]")]
  node_hazard_store[("PostGIS hazard store")]
end

subgraph group_intelligence["Documented intelligence"]
  node_vision["Vision detection"]
  node_forecast["Risk forecasting"]
end

node_operator(("City operator"))

node_operator -->|"opens platform"| node_landing
node_operator -->|"views incidents"| node_map_page
node_operator -->|"opens globe"| node_globe_page
node_operator -.->|"submits report"| node_report_page
node_map_page -->|"renders"| node_leaflet
node_globe_page -->|"renders"| node_cesium_view
node_leaflet -->|"fetches incidents"| node_incident_adapter
node_leaflet -->|"renders overlays"| node_map_layers
node_leaflet -.->|"renders search"| node_search
node_search -->|"queries places"| node_geocoder
node_leaflet -->|"opens inspection"| node_street_view
node_street_view -->|"loads imagery"| node_mapillary
node_leaflet -->|"uses map settings"| node_map_provider
node_cesium_view -.->|"uses worker assets"| node_cesium_workers
node_incident_adapter -->|"requests hazards"| node_api
node_api -->|"opens sessions"| node_database
node_api -->|"queries hazards"| node_hazard_model
node_api -->|"validates responses"| node_schemas
node_hazard_model -->|"uses ORM base"| node_database
node_database -.->|"connects to"| node_hazard_store
node_api -->|"reads and writes"| node_hazard_store
node_vision -.->|"stores detections"| node_hazard_store
node_forecast -.->|"stores risk metrics"| node_hazard_store

click node_landing "https://github.com/m4n1kya/argus/blob/main/frontend/src/app/page.tsx"
click node_map_page "https://github.com/m4n1kya/argus/blob/main/frontend/src/app/map/page.tsx"
click node_globe_page "https://github.com/m4n1kya/argus/blob/main/frontend/src/app/globe/page.tsx"
click node_report_page "https://github.com/m4n1kya/argus/blob/main/frontend/src/app/report/page.tsx"
click node_leaflet "https://github.com/m4n1kya/argus/blob/main/frontend/src/app/components/map/ArgusLeafletMap.tsx"
click node_map_layers "https://github.com/m4n1kya/argus/tree/main/frontend/src/app/components/map"
click node_search "https://github.com/m4n1kya/argus/blob/main/frontend/src/app/components/map/SearchBar.tsx"
click node_street_view "https://github.com/m4n1kya/argus/blob/main/frontend/src/app/components/map/StreetInspectionViewer.tsx"
click node_cesium_view "https://github.com/m4n1kya/argus/blob/main/frontend/src/app/components/CesiumViewer.tsx"
click node_cesium_workers "https://github.com/m4n1kya/argus/tree/main/frontend/public/cesium/Workers"
click node_incident_adapter "https://github.com/m4n1kya/argus/blob/main/frontend/src/app/services/incidentAdapter.ts"
click node_geocoder "https://github.com/m4n1kya/argus/blob/main/frontend/src/app/services/geocodingProvider.ts"
click node_map_provider "https://github.com/m4n1kya/argus/blob/main/frontend/src/app/services/mapProvider.ts"
click node_mapillary "https://github.com/m4n1kya/argus/blob/main/frontend/src/app/services/mapillaryProvider.ts"
click node_api "https://github.com/m4n1kya/argus/blob/main/backend/main.py"
click node_schemas "https://github.com/m4n1kya/argus/blob/main/backend/schemas.py"
click node_hazard_model "https://github.com/m4n1kya/argus/blob/main/backend/models.py"
click node_database "https://github.com/m4n1kya/argus/blob/main/backend/database.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_landing,node_map_page,node_globe_page,node_report_page toneBlue
class node_leaflet,node_map_layers,node_search,node_street_view,node_cesium_view,node_cesium_workers toneAmber
class node_incident_adapter,node_geocoder,node_map_provider,node_mapillary toneMint
class node_api,node_schemas,node_hazard_model,node_database,node_hazard_store toneRose
class node_vision,node_forecast,node_operator toneIndigo
```

## Components

### Operator interface

- [Platform landing](https://github.com/m4n1kya/argus/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Map page](https://github.com/m4n1kya/argus/blob/main/frontend/src/app/map/page.tsx): `frontend/src/app/map/page.tsx`
- [Globe page](https://github.com/m4n1kya/argus/blob/main/frontend/src/app/globe/page.tsx): `frontend/src/app/globe/page.tsx`
- [Report hazard](https://github.com/m4n1kya/argus/blob/main/frontend/src/app/report/page.tsx): `frontend/src/app/report/page.tsx`

### Geospatial views

- [2D incident map](https://github.com/m4n1kya/argus/blob/main/frontend/src/app/components/map/ArgusLeafletMap.tsx): `frontend/src/app/components/map/ArgusLeafletMap.tsx`
- [Map overlays](https://github.com/m4n1kya/argus/tree/main/frontend/src/app/components/map): `frontend/src/app/components/map`
- [Location search](https://github.com/m4n1kya/argus/blob/main/frontend/src/app/components/map/SearchBar.tsx): `frontend/src/app/components/map/SearchBar.tsx`
- [Street inspection](https://github.com/m4n1kya/argus/blob/main/frontend/src/app/components/map/StreetInspectionViewer.tsx): `frontend/src/app/components/map/StreetInspectionViewer.tsx`
- [3D globe viewer](https://github.com/m4n1kya/argus/blob/main/frontend/src/app/components/CesiumViewer.tsx): `frontend/src/app/components/CesiumViewer.tsx`
- [Cesium worker runtime](https://github.com/m4n1kya/argus/tree/main/frontend/public/cesium/Workers): `frontend/public/cesium/Workers`

### Incident services

- [Incident API adapter](https://github.com/m4n1kya/argus/blob/main/frontend/src/app/services/incidentAdapter.ts): `frontend/src/app/services/incidentAdapter.ts`
- [Geocoding provider](https://github.com/m4n1kya/argus/blob/main/frontend/src/app/services/geocodingProvider.ts): `frontend/src/app/services/geocodingProvider.ts`
- [Map provider](https://github.com/m4n1kya/argus/blob/main/frontend/src/app/services/mapProvider.ts): `frontend/src/app/services/mapProvider.ts`
- [Mapillary provider](https://github.com/m4n1kya/argus/blob/main/frontend/src/app/services/mapillaryProvider.ts): `frontend/src/app/services/mapillaryProvider.ts`

### API and persistence

- [Hazard API](https://github.com/m4n1kya/argus/blob/main/backend/main.py): `backend/main.py`
- [Hazard schemas](https://github.com/m4n1kya/argus/blob/main/backend/schemas.py): `backend/schemas.py`
- [Hazard model](https://github.com/m4n1kya/argus/blob/main/backend/models.py): `backend/models.py`
- [Spatial database access](https://github.com/m4n1kya/argus/blob/main/backend/database.py): `backend/database.py`
- **PostGIS hazard store**

### Documented intelligence

- **Vision detection**
- **Risk forecasting**

### Other components

- **City operator**

## Connections

- City operator → Platform landing: opens platform (evidence: `README.md`)
- City operator → Map page: views incidents (evidence: `README.md`)
- City operator → Globe page: opens globe (evidence: `README.md`)
- City operator → Report hazard: submits report
- Map page → 2D incident map: renders (evidence: `frontend/src/app/map/page.tsx`)
- Globe page → 3D globe viewer: renders (evidence: `frontend/src/app/globe/page.tsx`)
- 2D incident map → Incident API adapter: fetches incidents (evidence: `frontend/src/app/components/map/ArgusLeafletMap.tsx`)
- 2D incident map → Map overlays: renders overlays (evidence: `frontend/src/app/components/map/ArgusLeafletMap.tsx`)
- 2D incident map → Location search: renders search
- Location search → Geocoding provider: queries places (evidence: `frontend/src/app/components/map/SearchBar.tsx`)
- 2D incident map → Street inspection: opens inspection (evidence: `frontend/src/app/components/map/ArgusLeafletMap.tsx`)
- Street inspection → Mapillary provider: loads imagery (evidence: `frontend/src/app/components/map/StreetInspectionViewer.tsx`)
- 2D incident map → Map provider: uses map settings (evidence: `frontend/src/app/components/map/ArgusLeafletMap.tsx`)
- 3D globe viewer → Cesium worker runtime: uses worker assets (evidence: `README.md`)
- Incident API adapter → Hazard API: requests hazards (evidence: `frontend/src/app/services/incidentAdapter.ts`)
- Hazard API → Spatial database access: opens sessions (evidence: `backend/main.py`)
- Hazard API → Hazard model: queries hazards (evidence: `backend/main.py`)
- Hazard API → Hazard schemas: validates responses (evidence: `backend/main.py`)
- Hazard model → Spatial database access: uses ORM base (evidence: `backend/models.py`)
- Spatial database access → PostGIS hazard store: connects to
- Hazard API → PostGIS hazard store: reads and writes (evidence: `backend/main.py`)
- Vision detection → PostGIS hazard store: stores detections
- Risk forecasting → PostGIS hazard store: stores risk metrics
