# saharshasamala1112/disaster_visualization_dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/saharshasamala1112/disaster_visualization_dashboard
- Repository: https://github.com/saharshasamala1112/disaster_visualization_dashboard

## Overview

This is a multi-hazard disaster monitoring and response dashboard. Operators enter through the dashboard, choose operations or analytics, and in operations view review hazard signals, incidents, and a live risk map; live snapshots are served by an API backed by hazard-specific ingestion and fallback logic. The README also describes exports, offline resilience, and accessibility features. Some client-to-API wiring and several documented capabilities are not visible in the excerpts, so those links are marked unverified or omitted rather than inferred as direct calls.

Main entry points: [`components/dashboard/DisasterCommandCenter.tsx`](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/components/dashboard/DisasterCommandCenter.tsx) (Command center), [`lib/realtime/mock-pipeline.ts`](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/lib/realtime/mock-pipeline.ts) (Snapshot ingestion), [`app/(dashboard)/page.tsx`](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/app/(dashboard)/page.tsx) (Dashboard page), [`lib/disaster-data.ts`](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/lib/disaster-data.ts) (Hazard definitions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Dashboard entry"]
  node_dashboard["Dashboard page<br/>[page.tsx]"]
  node_dashboard_shell["Dashboard navigation<br/>[layout.tsx]"]
  node_sidebar["Hazard navigation<br/>[Sidebar.tsx]"]
  node_theme["Theme control<br/>[ThemeToggle.tsx]"]
  node_mode["Mode control<br/>[ModeToggle.tsx]"]
end

subgraph group_operations["Operations center"]
  node_command["Command center"]
  node_tabs["Hazard tabs<br/>[DisasterTabs.tsx]"]
  node_map_loader["Map loader<br/>[LiveMapDynamic.tsx]"]
  node_map["Risk map<br/>[LiveMap.tsx]"]
  node_incidents["Incident feed<br/>[IncidentFeed.tsx]"]
end

subgraph group_data["Live data"]
  node_config["Hazard definitions<br/>[disaster-data.ts]"]
  node_live_api["Live operations API<br/>[route.ts]"]
  node_pipeline["Snapshot ingestion<br/>[mock-pipeline.ts]"]
end

subgraph group_analytics["Analytics"]
  node_analytics_ui["Analytics dashboard"]
  node_viz["Visualization and exports<br/>[viz-utils.ts]"]
end

subgraph group_resilience["Offline resilience"]
  node_app_shell["App shell<br/>[layout.tsx]"]
  node_service_worker["Offline service worker<br/>[sw.js]"]
end

node_operator(("Response operator"))
node_usgs["USGS earthquake feed"]
node_openweather["OpenWeather feed"]
node_openmeteo["Open-Meteo flood feed"]
node_nasa["NASA FIRMS feed"]
node_map_tiles["OpenStreetMap tiles"]

node_operator -->|"opens"| node_dashboard
node_dashboard -->|"renders operations"| node_command
node_dashboard -->|"renders analytics"| node_analytics_ui
node_dashboard -->|"offers mode switch"| node_mode
node_dashboard -->|"offers theme switch"| node_theme
node_dashboard_shell -->|"renders navigation"| node_sidebar
node_sidebar -->|"reads hazard routes"| node_config
node_command -->|"reads hazard definitions"| node_config
node_command -->|"renders"| node_tabs
node_command -->|"renders map"| node_map_loader
node_map_loader -->|"loads"| node_map
node_command -->|"renders incidents"| node_incidents
node_command -.->|"requests snapshot"| node_live_api
node_live_api -->|"builds snapshot"| node_pipeline
node_pipeline -->|"uses hazard definitions"| node_config
node_pipeline -->|"fetches earthquakes"| node_usgs
node_pipeline -->|"fetches cyclone data"| node_openweather
node_pipeline -->|"fetches flood data"| node_openmeteo
node_pipeline -->|"fetches fire data"| node_nasa
node_map -->|"loads tiles"| node_map_tiles
node_analytics_ui -->|"uses visualizations"| node_viz
node_app_shell -->|"registers"| node_service_worker

click node_dashboard "https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/app/(dashboard)/page.tsx"
click node_dashboard_shell "https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/app/(dashboard)/layout.tsx"
click node_sidebar "https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/components/dashboard/Sidebar.tsx"
click node_theme "https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/components/ThemeToggle.tsx"
click node_mode "https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/components/dashboard/ModeToggle.tsx"
click node_command "https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/components/dashboard/DisasterCommandCenter.tsx"
click node_tabs "https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/components/dashboard/DisasterTabs.tsx"
click node_map_loader "https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/components/dashboard/LiveMapDynamic.tsx"
click node_map "https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/components/dashboard/LiveMap.tsx"
click node_incidents "https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/components/dashboard/IncidentFeed.tsx"
click node_config "https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/lib/disaster-data.ts"
click node_live_api "https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/app/api/live-ops/route.ts"
click node_pipeline "https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/lib/realtime/mock-pipeline.ts"
click node_analytics_ui "https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/components/dashboard/AnalyticsDashboard.tsx"
click node_viz "https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/lib/analytics/viz-utils.ts"
click node_app_shell "https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/app/layout.tsx"
click node_service_worker "https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/public/sw.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_dashboard,node_dashboard_shell,node_sidebar,node_theme,node_mode toneBlue
class node_command,node_tabs,node_map_loader,node_map,node_incidents toneAmber
class node_config,node_live_api,node_pipeline toneMint
class node_analytics_ui,node_viz toneRose
class node_app_shell,node_service_worker,node_operator,node_usgs,node_openweather,node_openmeteo,node_nasa,node_map_tiles toneIndigo
```

## Components

### Dashboard entry

- [Dashboard page](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/app/(dashboard)/page.tsx): `app/(dashboard)/page.tsx`
- [Dashboard navigation](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/app/(dashboard)/layout.tsx): `app/(dashboard)/layout.tsx`
- [Hazard navigation](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/components/dashboard/Sidebar.tsx): `components/dashboard/Sidebar.tsx`
- [Theme control](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/components/ThemeToggle.tsx): `components/ThemeToggle.tsx`
- [Mode control](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/components/dashboard/ModeToggle.tsx): `components/dashboard/ModeToggle.tsx`

### Operations center

- [Command center](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/components/dashboard/DisasterCommandCenter.tsx): `components/dashboard/DisasterCommandCenter.tsx`
- [Hazard tabs](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/components/dashboard/DisasterTabs.tsx): `components/dashboard/DisasterTabs.tsx`
- [Map loader](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/components/dashboard/LiveMapDynamic.tsx): `components/dashboard/LiveMapDynamic.tsx`
- [Risk map](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/components/dashboard/LiveMap.tsx): `components/dashboard/LiveMap.tsx`
- [Incident feed](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/components/dashboard/IncidentFeed.tsx): `components/dashboard/IncidentFeed.tsx`

### Live data

- [Hazard definitions](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/lib/disaster-data.ts): `lib/disaster-data.ts`
- [Live operations API](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/app/api/live-ops/route.ts): `app/api/live-ops/route.ts`
- [Snapshot ingestion](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/lib/realtime/mock-pipeline.ts): `lib/realtime/mock-pipeline.ts`

### Analytics

- [Analytics dashboard](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/components/dashboard/AnalyticsDashboard.tsx): `components/dashboard/AnalyticsDashboard.tsx`
- [Visualization and exports](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/lib/analytics/viz-utils.ts): `lib/analytics/viz-utils.ts`

### Offline resilience

- [App shell](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/app/layout.tsx): `app/layout.tsx`
- [Offline service worker](https://github.com/saharshasamala1112/disaster_visualization_dashboard/blob/main/public/sw.js): `public/sw.js`

### Other components

- **Response operator**
- **USGS earthquake feed**
- **OpenWeather feed**
- **Open-Meteo flood feed**
- **NASA FIRMS feed**
- **OpenStreetMap tiles**

## Connections

- Response operator → Dashboard page: opens
- Dashboard page → Command center: renders operations (evidence: `app/(dashboard)/page.tsx`)
- Dashboard page → Analytics dashboard: renders analytics (evidence: `app/(dashboard)/page.tsx`)
- Dashboard page → Mode control: offers mode switch (evidence: `app/(dashboard)/page.tsx`)
- Dashboard page → Theme control: offers theme switch (evidence: `app/(dashboard)/page.tsx`)
- Dashboard navigation → Hazard navigation: renders navigation (evidence: `app/(dashboard)/layout.tsx`)
- Hazard navigation → Hazard definitions: reads hazard routes (evidence: `components/dashboard/Sidebar.tsx`)
- Command center → Hazard definitions: reads hazard definitions (evidence: `components/dashboard/DisasterCommandCenter.tsx`)
- Command center → Hazard tabs: renders (evidence: `components/dashboard/DisasterCommandCenter.tsx`)
- Command center → Map loader: renders map (evidence: `components/dashboard/DisasterCommandCenter.tsx`)
- Map loader → Risk map: loads (evidence: `components/dashboard/LiveMapDynamic.tsx`)
- Command center → Incident feed: renders incidents (evidence: `components/dashboard/DisasterCommandCenter.tsx`)
- Command center → Live operations API: requests snapshot
- Live operations API → Snapshot ingestion: builds snapshot (evidence: `app/api/live-ops/route.ts`)
- Snapshot ingestion → Hazard definitions: uses hazard definitions (evidence: `lib/realtime/mock-pipeline.ts`)
- Snapshot ingestion → USGS earthquake feed: fetches earthquakes (evidence: `lib/realtime/mock-pipeline.ts`)
- Snapshot ingestion → OpenWeather feed: fetches cyclone data (evidence: `lib/realtime/mock-pipeline.ts`)
- Snapshot ingestion → Open-Meteo flood feed: fetches flood data (evidence: `lib/realtime/mock-pipeline.ts`)
- Snapshot ingestion → NASA FIRMS feed: fetches fire data (evidence: `lib/realtime/mock-pipeline.ts`)
- Risk map → OpenStreetMap tiles: loads tiles (evidence: `components/dashboard/LiveMap.tsx`)
- Analytics dashboard → Visualization and exports: uses visualizations (evidence: `components/dashboard/AnalyticsDashboard.tsx`)
- App shell → Offline service worker: registers (evidence: `app/layout.tsx`)
