# rehan0018/cyclopath architecture

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

- Interactive diagram: https://gitdiagram.com/rehan0018/cyclopath
- Repository: https://github.com/rehan0018/cyclopath

## Overview

Cyclopath AI is a cyclone-impact decision-support command center: authorities inspect coastal infrastructure risk, explore scenarios and hazard maps, then use routing, alerts, multimodal inspection, reports, and AI-generated response plans to guide action. The frontend presents role-oriented views and calls a TypeScript/Express API; the backend combines seeded asset data with risk, cyclone, routing, ML, alert, report, and Gemini services. The excerpts show some service calls and route ownership, but not every UI request-to-handler mapping; those uncertain links are omitted or marked unverified.

Main entry points: [`src/App.tsx`](https://github.com/rehan0018/cyclopath/blob/main/src/App.tsx) (Web Application), [`server.ts`](https://github.com/rehan0018/cyclopath/blob/main/server.ts) (HTTP API Server), [`src/services/api.ts`](https://github.com/rehan0018/cyclopath/blob/main/src/services/api.ts) (API Client), [`server/services/agentService.ts`](https://github.com/rehan0018/cyclopath/blob/main/server/services/agentService.ts) (Agent Orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Command Center"]
  node_app["Web Application<br/>[App.tsx]"]
  node_dashboard["Command Dashboard"]
  node_riskmap["Risk Map<br/>[RiskMap.tsx]"]
  node_catalog["Infrastructure Catalog"]
  node_detail["Asset Detail"]
  node_translations["Localized UI<br/>[translations.ts]"]
end

subgraph group_hazard["Hazard Intelligence"]
  node_cycloneview["Cyclone Intelligence"]
  node_scenario["Scenario Simulator"]
  node_dataview["Data Sources"]
  node_cyclonesvc["Cyclone Service<br/>[cycloneService.ts]"]
end

subgraph group_risk["Risk Analysis"]
  node_riskengine["Risk &amp; XAI Engine<br/>[riskEngine.ts]"]
  node_ml["Surrogate ML<br/>[mlService.ts]"]
end

subgraph group_response["Response Operations"]
  node_routingui["Emergency Routing"]
  node_routing["Safe Route Solver<br/>[routingService.ts]"]
  node_agentui["Response Agent Panel<br/>[AIAgentPanel.tsx]"]
  node_agent["Agent Orchestrator<br/>[agentService.ts]"]
  node_inspector["Multimodal Inspector"]
  node_alerts["Alerts Panel<br/>[AlertsPanel.tsx]"]
  node_alertsvc["Alert Service<br/>[alertService.ts]"]
  node_reports["Reports View<br/>[ReportsView.tsx]"]
  node_reportsvc["Report Service<br/>[reportService.ts]"]
end

subgraph group_backend["Backend Services"]
  node_api["API Client<br/>[api.ts]"]
  node_server["HTTP API Server<br/>[server.ts]"]
  node_seed["Demo Asset Data<br/>[seedData.ts]"]
  node_gemini["Gemini Services<br/>[geminiService.ts]"]
end

node_authority(("Disaster Authority"))
node_externalgemini{{"Google Gemini"}}

node_authority -->|"uses"| node_app
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_riskmap
node_app -->|"renders"| node_catalog
node_app -.->|"renders"| node_cycloneview
node_app -.->|"renders"| node_scenario
node_app -->|"renders"| node_routingui
node_app -.->|"renders"| node_agentui
node_app -->|"renders"| node_inspector
node_app -->|"renders"| node_alerts
node_app -->|"renders"| node_reports
node_app -->|"renders"| node_dataview
node_app -->|"uses"| node_translations
node_dashboard -->|"localizes"| node_translations
node_cycloneview -->|"localizes"| node_translations
node_scenario -->|"requests simulations"| node_api
node_routingui -->|"requests routes"| node_api
node_agentui -->|"submits queries"| node_api
node_inspector -->|"requests analysis"| node_api
node_alerts -->|"loads alerts"| node_api
node_reports -->|"requests reports"| node_api
node_dataview -->|"loads sources"| node_api
node_api -.->|"sends HTTP requests"| node_server
node_server -->|"loads demo data"| node_seed
node_server -->|"uses"| node_cyclonesvc
node_server -->|"uses"| node_riskengine
node_server -->|"uses"| node_ml
node_server -->|"uses"| node_routing
node_server -->|"uses"| node_alertsvc
node_server -->|"uses"| node_reportsvc
node_agent -->|"queries"| node_cyclonesvc
node_agent -->|"queries"| node_routing
node_agent -->|"requests synthesis"| node_gemini
node_agent -->|"reads assets"| node_seed
node_agent -->|"assesses risk"| node_riskengine
node_gemini -->|"calls model"| node_externalgemini
node_routingui -.->|"calculates route"| node_routing
node_inspector -.->|"requests image screening"| node_gemini
node_alerts -.->|"loads alert feed"| node_alertsvc
node_reports -.->|"requests report"| node_reportsvc

click node_app "https://github.com/rehan0018/cyclopath/blob/main/src/App.tsx"
click node_dashboard "https://github.com/rehan0018/cyclopath/blob/main/src/components/CommandCenterDashboard.tsx"
click node_riskmap "https://github.com/rehan0018/cyclopath/blob/main/src/components/RiskMap.tsx"
click node_catalog "https://github.com/rehan0018/cyclopath/blob/main/src/components/InfrastructureCatalog.tsx"
click node_detail "https://github.com/rehan0018/cyclopath/blob/main/src/components/AssetDetailModal.tsx"
click node_cycloneview "https://github.com/rehan0018/cyclopath/blob/main/src/components/CycloneIntelligence.tsx"
click node_scenario "https://github.com/rehan0018/cyclopath/blob/main/src/components/ScenarioSimulator.tsx"
click node_dataview "https://github.com/rehan0018/cyclopath/blob/main/src/components/DataSourcesView.tsx"
click node_translations "https://github.com/rehan0018/cyclopath/blob/main/src/i18n/translations.ts"
click node_api "https://github.com/rehan0018/cyclopath/blob/main/src/services/api.ts"
click node_server "https://github.com/rehan0018/cyclopath/blob/main/server.ts"
click node_seed "https://github.com/rehan0018/cyclopath/blob/main/server/data/seedData.ts"
click node_cyclonesvc "https://github.com/rehan0018/cyclopath/blob/main/server/services/cycloneService.ts"
click node_riskengine "https://github.com/rehan0018/cyclopath/blob/main/server/services/riskEngine.ts"
click node_ml "https://github.com/rehan0018/cyclopath/blob/main/server/services/mlService.ts"
click node_routingui "https://github.com/rehan0018/cyclopath/blob/main/src/components/EmergencyRouting.tsx"
click node_routing "https://github.com/rehan0018/cyclopath/blob/main/server/services/routingService.ts"
click node_agentui "https://github.com/rehan0018/cyclopath/blob/main/src/components/AIAgentPanel.tsx"
click node_agent "https://github.com/rehan0018/cyclopath/blob/main/server/services/agentService.ts"
click node_gemini "https://github.com/rehan0018/cyclopath/blob/main/server/services/geminiService.ts"
click node_inspector "https://github.com/rehan0018/cyclopath/blob/main/src/components/MultimodalInspector.tsx"
click node_alerts "https://github.com/rehan0018/cyclopath/blob/main/src/components/AlertsPanel.tsx"
click node_alertsvc "https://github.com/rehan0018/cyclopath/blob/main/server/services/alertService.ts"
click node_reports "https://github.com/rehan0018/cyclopath/blob/main/src/components/ReportsView.tsx"
click node_reportsvc "https://github.com/rehan0018/cyclopath/blob/main/server/services/reportService.ts"

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_dashboard,node_riskmap,node_catalog,node_detail,node_translations toneBlue
class node_cycloneview,node_scenario,node_dataview,node_cyclonesvc toneAmber
class node_riskengine,node_ml toneMint
class node_routingui,node_routing,node_agentui,node_agent,node_inspector,node_alerts,node_alertsvc,node_reports,node_reportsvc toneRose
class node_api,node_server,node_seed,node_gemini,node_authority,node_externalgemini toneIndigo
```

## Components

### Command Center

- [Web Application](https://github.com/rehan0018/cyclopath/blob/main/src/App.tsx): `src/App.tsx`
- [Command Dashboard](https://github.com/rehan0018/cyclopath/blob/main/src/components/CommandCenterDashboard.tsx): `src/components/CommandCenterDashboard.tsx`
- [Risk Map](https://github.com/rehan0018/cyclopath/blob/main/src/components/RiskMap.tsx): `src/components/RiskMap.tsx`
- [Infrastructure Catalog](https://github.com/rehan0018/cyclopath/blob/main/src/components/InfrastructureCatalog.tsx): `src/components/InfrastructureCatalog.tsx`
- [Asset Detail](https://github.com/rehan0018/cyclopath/blob/main/src/components/AssetDetailModal.tsx): `src/components/AssetDetailModal.tsx`
- [Localized UI](https://github.com/rehan0018/cyclopath/blob/main/src/i18n/translations.ts): `src/i18n/translations.ts`

### Hazard Intelligence

- [Cyclone Intelligence](https://github.com/rehan0018/cyclopath/blob/main/src/components/CycloneIntelligence.tsx): `src/components/CycloneIntelligence.tsx`
- [Scenario Simulator](https://github.com/rehan0018/cyclopath/blob/main/src/components/ScenarioSimulator.tsx): `src/components/ScenarioSimulator.tsx`
- [Data Sources](https://github.com/rehan0018/cyclopath/blob/main/src/components/DataSourcesView.tsx): `src/components/DataSourcesView.tsx`
- [Cyclone Service](https://github.com/rehan0018/cyclopath/blob/main/server/services/cycloneService.ts): `server/services/cycloneService.ts`

### Risk Analysis

- [Risk & XAI Engine](https://github.com/rehan0018/cyclopath/blob/main/server/services/riskEngine.ts): `server/services/riskEngine.ts`
- [Surrogate ML](https://github.com/rehan0018/cyclopath/blob/main/server/services/mlService.ts): `server/services/mlService.ts`

### Response Operations

- [Emergency Routing](https://github.com/rehan0018/cyclopath/blob/main/src/components/EmergencyRouting.tsx): `src/components/EmergencyRouting.tsx`
- [Safe Route Solver](https://github.com/rehan0018/cyclopath/blob/main/server/services/routingService.ts): `server/services/routingService.ts`
- [Response Agent Panel](https://github.com/rehan0018/cyclopath/blob/main/src/components/AIAgentPanel.tsx): `src/components/AIAgentPanel.tsx`
- [Agent Orchestrator](https://github.com/rehan0018/cyclopath/blob/main/server/services/agentService.ts): `server/services/agentService.ts`
- [Multimodal Inspector](https://github.com/rehan0018/cyclopath/blob/main/src/components/MultimodalInspector.tsx): `src/components/MultimodalInspector.tsx`
- [Alerts Panel](https://github.com/rehan0018/cyclopath/blob/main/src/components/AlertsPanel.tsx): `src/components/AlertsPanel.tsx`
- [Alert Service](https://github.com/rehan0018/cyclopath/blob/main/server/services/alertService.ts): `server/services/alertService.ts`
- [Reports View](https://github.com/rehan0018/cyclopath/blob/main/src/components/ReportsView.tsx): `src/components/ReportsView.tsx`
- [Report Service](https://github.com/rehan0018/cyclopath/blob/main/server/services/reportService.ts): `server/services/reportService.ts`

### Backend Services

- [API Client](https://github.com/rehan0018/cyclopath/blob/main/src/services/api.ts): `src/services/api.ts`
- [HTTP API Server](https://github.com/rehan0018/cyclopath/blob/main/server.ts): `server.ts`
- [Demo Asset Data](https://github.com/rehan0018/cyclopath/blob/main/server/data/seedData.ts): `server/data/seedData.ts`
- [Gemini Services](https://github.com/rehan0018/cyclopath/blob/main/server/services/geminiService.ts): `server/services/geminiService.ts`

### Other components

- **Disaster Authority**
- **Google Gemini**

## Connections

- Disaster Authority → Web Application: uses (evidence: `README.md`)
- Web Application → Command Dashboard: renders (evidence: `src/App.tsx`)
- Web Application → Risk Map: renders (evidence: `src/App.tsx`)
- Web Application → Infrastructure Catalog: renders (evidence: `src/App.tsx`)
- Web Application → Cyclone Intelligence: renders (evidence: `src/App.tsx`)
- Web Application → Scenario Simulator: renders (evidence: `src/App.tsx`)
- Web Application → Emergency Routing: renders (evidence: `src/App.tsx`)
- Web Application → Response Agent Panel: renders (evidence: `src/App.tsx`)
- Web Application → Multimodal Inspector: renders (evidence: `src/App.tsx`)
- Web Application → Alerts Panel: renders (evidence: `src/App.tsx`)
- Web Application → Reports View: renders (evidence: `src/App.tsx`)
- Web Application → Data Sources: renders (evidence: `src/App.tsx`)
- Web Application → Localized UI: uses (evidence: `src/App.tsx`)
- Command Dashboard → Localized UI: localizes (evidence: `src/components/CommandCenterDashboard.tsx`)
- Cyclone Intelligence → Localized UI: localizes (evidence: `src/components/CycloneIntelligence.tsx`)
- Scenario Simulator → API Client: requests simulations (evidence: `src/components/ScenarioSimulator.tsx`)
- Emergency Routing → API Client: requests routes (evidence: `src/components/EmergencyRouting.tsx`)
- Response Agent Panel → API Client: submits queries (evidence: `src/components/AIAgentPanel.tsx`)
- Multimodal Inspector → API Client: requests analysis (evidence: `src/components/MultimodalInspector.tsx`)
- Alerts Panel → API Client: loads alerts (evidence: `src/components/AlertsPanel.tsx`)
- Reports View → API Client: requests reports (evidence: `src/components/ReportsView.tsx`)
- Data Sources → API Client: loads sources (evidence: `src/components/DataSourcesView.tsx`)
- API Client → HTTP API Server: sends HTTP requests
- HTTP API Server → Demo Asset Data: loads demo data (evidence: `server.ts`)
- HTTP API Server → Cyclone Service: uses (evidence: `server.ts`)
- HTTP API Server → Risk & XAI Engine: uses (evidence: `server.ts`)
- HTTP API Server → Surrogate ML: uses (evidence: `server.ts`)
- HTTP API Server → Safe Route Solver: uses (evidence: `server.ts`)
- HTTP API Server → Alert Service: uses (evidence: `server.ts`)
- HTTP API Server → Report Service: uses (evidence: `server.ts`)
- Agent Orchestrator → Cyclone Service: queries (evidence: `server/services/agentService.ts`)
- Agent Orchestrator → Safe Route Solver: queries (evidence: `server/services/agentService.ts`)
- Agent Orchestrator → Gemini Services: requests synthesis (evidence: `server/services/agentService.ts`)
- Agent Orchestrator → Demo Asset Data: reads assets (evidence: `server/services/agentService.ts`)
- Agent Orchestrator → Risk & XAI Engine: assesses risk (evidence: `server/services/agentService.ts`)
- Gemini Services → Google Gemini: calls model (evidence: `server/services/geminiService.ts`)
- Emergency Routing → Safe Route Solver: calculates route
- Multimodal Inspector → Gemini Services: requests image screening
- Alerts Panel → Alert Service: loads alert feed
- Reports View → Report Service: requests report
