How flukelaster/siahra works
SIAHRA is a Thailand-focused 3D hazard-intelligence platform. Users choose a province and time, explore terrain and hazard layers, and inspect live observations, alerts, flood scenes, and local-authority impacts. The browser app combines API-fed data with preprocessed geospatial assets; the edge API serves observations and derived results, while ETL and the GFM tools prepare base geography and satellite-flood products. The graph preserves the documented capability branches; several internal API and ingestion links are omitted because their wiring was not shown in the excerpts.
Main entry points: hooks Data hooks · routes API endpoints · observation-cache.ts Observation cache · src Geospatial ETL
Components 19
Interactive map
- App state
apps/web/src/App.tsx - Data hooks
apps/web/src/hooks - 3D viewport
apps/web/src/components/layout/Map3DCanvas.tsx - Hazard panels
apps/web/src/components/hazard - Station surfaces
apps/web/src/workers/stationSheet.worker.ts
Edge API
- Request router
apps/api/src/router.ts - API endpoints
apps/api/src/routes - Source ingestion
apps/api/src/ingestion - Observation cache
apps/api/src/durable-objects/observation-cache.ts - Alert engine
apps/api/src/durable-objects/alert-engine.ts - Authority impact
apps/api/src/geo/floodIntersection.ts
Geospatial preparation
- Geospatial ETL
apps/etl/src - Authority boundaries
apps/etl/src/buildLocalAuthorityBoundaries.ts - Exposure baseline
apps/etl/src/buildLocalAuthorityExposure.ts - GFM processing
apps/etl/gfm/gfm/cli.py
Shared contracts
- Domain types
packages/shared-types/src
Other components
- Map user
- Browser API
- Agency sources
Connections 20
- Map user → App state: selects area
README.md - App state → Data hooks: loads data
apps/web/src/App.tsx - Data hooks → Browser API: fetches data
apps/web/src/hooks/useAffectedAuthorities.ts - Browser API → Request router: requests
README.md - Request router → API endpoints: dispatches
apps/api/src/routes/localAuthorities.ts - API endpoints → Observation cache: reads flood data
apps/api/src/routes/localAuthorities.ts - API endpoints → Authority impact: computes impact
apps/api/src/routes/localAuthorities.ts - Alert engine → Observation cache: fetches observations
apps/api/src/durable-objects/alert-engine.ts - Agency sources → Source ingestion: supplies feeds
README.md - Source ingestion → Observation cache: updates observations
- Data hooks → Hazard panels: feeds panels
README.md - Data hooks → 3D viewport: feeds overlays
apps/web/src/hooks/useLayerDescriptors.ts - 3D viewport → Station surfaces: delegates filling
- Geospatial ETL → Authority boundaries: builds boundaries
apps/etl/src/buildLocalAuthorityBoundaries.ts - Geospatial ETL → Exposure baseline: builds exposure
apps/etl/src/buildLocalAuthorityExposure.ts - Authority boundaries → API endpoints: serves polygons
- Exposure baseline → API endpoints: serves baseline
- GFM processing → Data hooks: provides flood scenes
README.md - Domain types → API endpoints: defines contracts
- Domain types → Data hooks: defines contracts