# a-ldnstntng/ligtas architecture

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

- Interactive diagram: https://gitdiagram.com/a-ldnstntng/ligtas
- Repository: https://github.com/a-ldnstntng/ligtas

## Overview

LIGTAS METRO is a flood-safe commute dashboard. Users search or select a Philippine corridor, view rainfall-informed inundation and passability assessments alongside flood and bypass overlays, then inspect street-level imagery or corridor telemetry. The main orchestration and dashboard live in `src/App.jsx`; map rendering and geometry are handled by `src/components/MapViewport.jsx`, while weather and imagery lookups are separate services. README capabilities not fully visible in the sampled excerpts are represented where documented; sensor telemetry implementation details are not assumed.

Main entry points: [`src/App.jsx`](https://github.com/a-ldnstntng/ligtas/blob/main/src/App.jsx) (Dashboard orchestration), [`src/components/MapViewport.jsx`](https://github.com/a-ldnstntng/ligtas/blob/main/src/components/MapViewport.jsx) (Interactive hazard map), [`src/services/mapillaryService.js`](https://github.com/a-ldnstntng/ligtas/blob/main/src/services/mapillaryService.js) (Imagery lookup), [`src/components/StreetViewerModal.jsx`](https://github.com/a-ldnstntng/ligtas/blob/main/src/components/StreetViewerModal.jsx) (Street viewer modal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard workflow"]
  node_app["Dashboard orchestration<br/>[App.jsx]"]
  node_search["Location search<br/>[App.jsx]"]
  node_hazard["Inundation assessment<br/>[weatherService.js]"]
end

subgraph group_spatial["Spatial hazards"]
  node_map["Interactive hazard map<br/>[MapViewport.jsx]"]
  node_flooddata["Flood polygons<br/>[floodPolygons.json]"]
end

subgraph group_services["Live data services"]
  node_weather["Weather forecast<br/>[weatherService.js]"]
  node_imagery["Imagery lookup"]
  node_corridors["Curated imagery corridors"]
end

subgraph group_inspection["Street inspection"]
  node_street["Street viewer modal"]
  node_sensorview["Corridor sensor telemetry"]
end

node_commuter(("Commuter"))
node_openmeteo["Open-Meteo"]
node_nominatim["Nominatim geocoding"]
node_mapillary["Mapillary imagery API"]

node_commuter -->|"searches locations"| node_search
node_search -.->|"geocodes query"| node_nominatim
node_search -->|"submits selection"| node_app
node_app -->|"requests forecast"| node_weather
node_weather -->|"fetches weather and river data"| node_openmeteo
node_app -->|"computes inundation"| node_hazard
node_app -->|"passes location and depth"| node_map
node_map -->|"reads polygons"| node_flooddata
node_commuter -->|"inspects map"| node_map
node_map -->|"dispatches map selection"| node_app
node_app -->|"opens inspection"| node_street
node_app -->|"looks up nearby image"| node_imagery
node_street -->|"resolves image"| node_imagery
node_imagery -->|"queries image nodes"| node_mapillary
node_imagery -->|"checks fallback"| node_corridors
node_street -->|"shows telemetry mode"| node_sensorview

click node_app "https://github.com/a-ldnstntng/ligtas/blob/main/src/App.jsx"
click node_search "https://github.com/a-ldnstntng/ligtas/blob/main/src/App.jsx"
click node_hazard "https://github.com/a-ldnstntng/ligtas/blob/main/src/services/weatherService.js"
click node_weather "https://github.com/a-ldnstntng/ligtas/blob/main/src/services/weatherService.js"
click node_map "https://github.com/a-ldnstntng/ligtas/blob/main/src/components/MapViewport.jsx"
click node_flooddata "https://github.com/a-ldnstntng/ligtas/blob/main/src/data/floodPolygons.json"
click node_street "https://github.com/a-ldnstntng/ligtas/blob/main/src/components/StreetViewerModal.jsx"
click node_imagery "https://github.com/a-ldnstntng/ligtas/blob/main/src/services/mapillaryService.js"
click node_corridors "https://github.com/a-ldnstntng/ligtas/blob/main/src/data/mapillaryCorridors.json"
click node_sensorview "https://github.com/a-ldnstntng/ligtas/blob/main/src/components/StreetViewerModal.jsx"

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_app,node_search,node_hazard toneBlue
class node_map,node_flooddata toneAmber
class node_weather,node_imagery,node_corridors,node_mapillary toneMint
class node_street,node_sensorview toneRose
class node_commuter,node_openmeteo,node_nominatim toneIndigo
```

## Components

### Dashboard workflow

- [Dashboard orchestration](https://github.com/a-ldnstntng/ligtas/blob/main/src/App.jsx): `src/App.jsx`
- [Location search](https://github.com/a-ldnstntng/ligtas/blob/main/src/App.jsx): `src/App.jsx`
- [Inundation assessment](https://github.com/a-ldnstntng/ligtas/blob/main/src/services/weatherService.js): `src/services/weatherService.js`

### Spatial hazards

- [Interactive hazard map](https://github.com/a-ldnstntng/ligtas/blob/main/src/components/MapViewport.jsx): `src/components/MapViewport.jsx`
- [Flood polygons](https://github.com/a-ldnstntng/ligtas/blob/main/src/data/floodPolygons.json): `src/data/floodPolygons.json`

### Live data services

- [Weather forecast](https://github.com/a-ldnstntng/ligtas/blob/main/src/services/weatherService.js): `src/services/weatherService.js`
- [Imagery lookup](https://github.com/a-ldnstntng/ligtas/blob/main/src/services/mapillaryService.js): `src/services/mapillaryService.js`
- [Curated imagery corridors](https://github.com/a-ldnstntng/ligtas/blob/main/src/data/mapillaryCorridors.json): `src/data/mapillaryCorridors.json`

### Street inspection

- [Street viewer modal](https://github.com/a-ldnstntng/ligtas/blob/main/src/components/StreetViewerModal.jsx): `src/components/StreetViewerModal.jsx`
- [Corridor sensor telemetry](https://github.com/a-ldnstntng/ligtas/blob/main/src/components/StreetViewerModal.jsx): `src/components/StreetViewerModal.jsx`

### Other components

- **Commuter**
- **Open-Meteo**
- **Nominatim geocoding**
- **Mapillary imagery API**

## Connections

- Commuter → Location search: searches locations
- Location search → Nominatim geocoding: geocodes query
- Location search → Dashboard orchestration: submits selection
- Dashboard orchestration → Weather forecast: requests forecast
- Weather forecast → Open-Meteo: fetches weather and river data
- Dashboard orchestration → Inundation assessment: computes inundation
- Dashboard orchestration → Interactive hazard map: passes location and depth
- Interactive hazard map → Flood polygons: reads polygons
- Commuter → Interactive hazard map: inspects map
- Interactive hazard map → Dashboard orchestration: dispatches map selection
- Dashboard orchestration → Street viewer modal: opens inspection
- Dashboard orchestration → Imagery lookup: looks up nearby image
- Street viewer modal → Imagery lookup: resolves image
- Imagery lookup → Mapillary imagery API: queries image nodes
- Imagery lookup → Curated imagery corridors: checks fallback
- Street viewer modal → Corridor sensor telemetry: shows telemetry mode
