# blulightningxd/hackingsummer architecture

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

- Interactive diagram: https://gitdiagram.com/blulightningxd/hackingsummer
- Repository: https://github.com/blulightningxd/hackingsummer

## Overview

Disha is described as a transit-navigation app whose principal workflow is route planning with offline metro routing, augmented by crowd estimates and community hazard reports. However, the tree contains no Flutter/Dart `lib` sources, so its route-planning, BLE, authentication, map UI, lost-and-found, and Firebase workflows cannot be traced to implementation paths here. The visible backend implements geospatial hazard reports and route-safety checks; the separate live-navigator server is present, but its role and connections are not established by the available evidence.

Main entry points: [`saferoute_backend/routers/complaints_router.py`](https://github.com/blulightningxd/hackingsummer/blob/main/saferoute_backend/routers/complaints_router.py) (Hazard API), [`saferoute_backend/map_database.py`](https://github.com/blulightningxd/hackingsummer/blob/main/saferoute_backend/map_database.py) (DB sessions), [`saferoute_backend/main.py`](https://github.com/blulightningxd/hackingsummer/blob/main/saferoute_backend/main.py) (FastAPI app), [`saferoute_backend/models/hurdle_model.py`](https://github.com/blulightningxd/hackingsummer/blob/main/saferoute_backend/models/hurdle_model.py) (Hazard model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_backend["Hazard backend"]
  node_api["FastAPI app<br/>[main.py]"]
  node_complaints["Hazard API"]
  node_schema["Request schemas<br/>[hurdle_schema.py]"]
  node_model["Hazard model<br/>[hurdle_model.py]"]
  node_dbsession["DB sessions<br/>[map_database.py]"]
  node_postgres[("PostGIS database")]
end

subgraph group_live["Live navigator"]
  node_navigator["Navigator server<br/>[server.js]"]
  node_schedulecache["Schedule cache"]
end

node_commuter(("Commuter"))

node_api -->|"mounts routes"| node_complaints
node_api -->|"creates tables"| node_dbsession
node_complaints -->|"opens sessions"| node_dbsession
node_complaints -->|"uses request types"| node_schema
node_complaints -->|"queries hazards"| node_model
node_model -->|"uses base"| node_dbsession
node_dbsession -->|"connects to"| node_postgres
node_commuter -.->|"requests hazard data"| node_api

click node_api "https://github.com/blulightningxd/hackingsummer/blob/main/saferoute_backend/main.py"
click node_complaints "https://github.com/blulightningxd/hackingsummer/blob/main/saferoute_backend/routers/complaints_router.py"
click node_schema "https://github.com/blulightningxd/hackingsummer/blob/main/saferoute_backend/schemas/hurdle_schema.py"
click node_model "https://github.com/blulightningxd/hackingsummer/blob/main/saferoute_backend/models/hurdle_model.py"
click node_dbsession "https://github.com/blulightningxd/hackingsummer/blob/main/saferoute_backend/map_database.py"
click node_navigator "https://github.com/blulightningxd/hackingsummer/blob/main/live-navigator/server.js"
click node_schedulecache "https://github.com/blulightningxd/hackingsummer/blob/main/live-navigator/build-schedule-cache.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_api,node_complaints,node_schema,node_model,node_dbsession,node_postgres toneBlue
class node_navigator,node_schedulecache toneAmber
class node_commuter toneIndigo
```

## Components

### Hazard backend

- [FastAPI app](https://github.com/blulightningxd/hackingsummer/blob/main/saferoute_backend/main.py): `saferoute_backend/main.py`
- [Hazard API](https://github.com/blulightningxd/hackingsummer/blob/main/saferoute_backend/routers/complaints_router.py): `saferoute_backend/routers/complaints_router.py`
- [Request schemas](https://github.com/blulightningxd/hackingsummer/blob/main/saferoute_backend/schemas/hurdle_schema.py): `saferoute_backend/schemas/hurdle_schema.py`
- [Hazard model](https://github.com/blulightningxd/hackingsummer/blob/main/saferoute_backend/models/hurdle_model.py): `saferoute_backend/models/hurdle_model.py`
- [DB sessions](https://github.com/blulightningxd/hackingsummer/blob/main/saferoute_backend/map_database.py): `saferoute_backend/map_database.py`
- **PostGIS database**

### Live navigator

- [Navigator server](https://github.com/blulightningxd/hackingsummer/blob/main/live-navigator/server.js): `live-navigator/server.js`
- [Schedule cache](https://github.com/blulightningxd/hackingsummer/blob/main/live-navigator/build-schedule-cache.js): `live-navigator/build-schedule-cache.js`

### Other components

- **Commuter**

## Connections

- FastAPI app → Hazard API: mounts routes (evidence: `saferoute_backend/main.py`)
- FastAPI app → DB sessions: creates tables (evidence: `saferoute_backend/main.py`)
- Hazard API → DB sessions: opens sessions (evidence: `saferoute_backend/routers/complaints_router.py`)
- Hazard API → Request schemas: uses request types (evidence: `saferoute_backend/routers/complaints_router.py`)
- Hazard API → Hazard model: queries hazards (evidence: `saferoute_backend/routers/complaints_router.py`)
- Hazard model → DB sessions: uses base (evidence: `saferoute_backend/models/hurdle_model.py`)
- DB sessions → PostGIS database: connects to (evidence: `saferoute_backend/map_database.py`)
- Commuter → FastAPI app: requests hazard data
