# rajatrawal-06/floodapp architecture

> Architecture diagram of the GitHub repository rajatrawal-06/floodapp, 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/rajatrawal-06/floodapp
- Repository: https://github.com/rajatrawal-06/floodapp

## Overview

FLUX combines a mobile disaster-response dashboard with a FastAPI backend for satellite flood detection, geospatial hazard analysis, evacuation planning, reports, alerts, and conversational assistance. The main workflow is a user-initiated detection or location query, followed by flood inference and physical-context enrichment; hazards can then inform triage and evacuation routes shown to responders. The README documents the broader capability flow, while sampled excerpts confirm selected routing, triage, inference, and API behavior; unsampled subsystem wiring is represented only where documented.

Main entry points: [`dell-flood-app/App.tsx`](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-app/App.tsx) (Mobile app), [`dell-flood-backend/app/api/endpoints.py`](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/api/endpoints.py) (HTTP API), [`dell-flood-backend/app/flux/routing/evacuation_engine.py`](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/flux/routing/evacuation_engine.py) (Evacuation planner), [`dell-flood-backend/app/agent/flood_agent.py`](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/agent/flood_agent.py) (Flood agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Mobile dashboard"]
  node_app["Mobile app<br/>[App.tsx]"]
  node_map["Map view<br/>[MapView.tsx]"]
  node_reportform["Crowd reports<br/>[ReportForm.tsx]"]
  node_triageui["Triage panel<br/>[TriagePanel.tsx]"]
  node_chatui["Chat panel<br/>[ChatbotPanel.tsx]"]
  node_clientapi["API client<br/>[api.ts]"]
end

subgraph group_service["Backend service"]
  node_api["HTTP API<br/>[endpoints.py]"]
end

subgraph group_hazards["Hazard analysis"]
  node_inference["Flood inference<br/>[inference.py]"]
  node_postprocess["Mask postprocessing<br/>[postprocess.py]"]
  node_mireye["MirEye physical data<br/>[client.py]"]
  node_hazardengine["TWI and susceptibility"]
  node_prediction["Predictive hazards"]
  node_clustering["Population clusters<br/>[cluster.py]"]
end

subgraph group_response["Response planning"]
  node_triage["Priority and allocation<br/>[triage_engine.py]"]
  node_evacuation["Evacuation planner"]
  node_roadgraph["Elevation-aware routes<br/>[graph_router.py]"]
  node_shelters["Shelter discovery<br/>[finder.py]"]
  node_visualization["Tactical maps<br/>[map_plotter.py]"]
end

subgraph group_assistant["AI assistance"]
  node_agent["Flood agent<br/>[flood_agent.py]"]
  node_chatbot["MirEye chatbot<br/>[mireye_chatbot.py]"]
  node_tools["Agent tools<br/>[tools.py]"]
  node_generator["RAG report generator<br/>[generator.py]"]
  node_vectorstore[("Report knowledge store<br/>[vector_store.py]")]
end

node_user(("Responder or resident"))
node_external["MirEye API"]
node_llm["LLM provider"]

node_user -->|"uses"| node_app
node_app -->|"requests"| node_clientapi
node_clientapi -->|"calls"| node_api
node_app -->|"displays"| node_map
node_app -->|"presents"| node_reportform
node_app -->|"presents"| node_triageui
node_app -->|"presents"| node_chatui
node_api -->|"runs inference"| node_inference
node_inference -->|"produces mask"| node_postprocess
node_hazardengine -->|"enriches context"| node_mireye
node_mireye -->|"fetches data"| node_external
node_prediction -->|"computes hazards"| node_hazardengine
node_prediction -->|"clusters points"| node_clustering
node_triage -->|"uses risk tiers"| node_prediction
node_evacuation -->|"finds candidates"| node_shelters
node_evacuation -->|"requests routes"| node_roadgraph
node_evacuation -->|"renders plans"| node_visualization
node_api -->|"routes chat"| node_agent
node_api -->|"generates reports"| node_generator
node_api -->|"queries context"| node_vectorstore
node_agent -->|"dispatches tools"| node_tools
node_chatbot -->|"queries context"| node_mireye
node_generator -->|"retrieves reports"| node_vectorstore
node_agent -.->|"consults model"| node_llm
node_chatbot -.->|"consults model"| node_llm

click node_app "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-app/App.tsx"
click node_map "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-app/src/components/MapView.tsx"
click node_reportform "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-app/src/components/ReportForm.tsx"
click node_triageui "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-app/src/components/TriagePanel.tsx"
click node_chatui "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-app/src/components/ChatbotPanel.tsx"
click node_clientapi "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-app/src/services/api.ts"
click node_api "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/api/endpoints.py"
click node_inference "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/ml/inference.py"
click node_postprocess "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/ml/postprocess.py"
click node_mireye "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/flux/api/client.py"
click node_hazardengine "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/flux/pipeline/physical_data_hazard_engine.py"
click node_prediction "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/flux/pipeline/flood_prediction_pipeline.py"
click node_clustering "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/flux/pipeline/cluster.py"
click node_triage "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/flux/pipeline/triage_engine.py"
click node_evacuation "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/flux/routing/evacuation_engine.py"
click node_roadgraph "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/flux/routing/graph_router.py"
click node_shelters "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/flux/shelters/finder.py"
click node_visualization "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/flux/visualization/map_plotter.py"
click node_agent "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/agent/flood_agent.py"
click node_chatbot "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/agent/mireye_chatbot.py"
click node_tools "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/agent/tools.py"
click node_generator "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/RAG/generator.py"
click node_vectorstore "https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/RAG/vector_store.py"

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_map,node_reportform,node_triageui,node_chatui,node_clientapi toneBlue
class node_api toneAmber
class node_inference,node_postprocess,node_mireye,node_hazardengine,node_prediction,node_clustering,node_external toneMint
class node_triage,node_evacuation,node_roadgraph,node_shelters,node_visualization toneRose
class node_agent,node_chatbot,node_tools,node_generator,node_vectorstore,node_user,node_llm toneIndigo
```

## Components

### Mobile dashboard

- [Mobile app](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-app/App.tsx): `dell-flood-app/App.tsx`
- [Map view](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-app/src/components/MapView.tsx): `dell-flood-app/src/components/MapView.tsx`
- [Crowd reports](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-app/src/components/ReportForm.tsx): `dell-flood-app/src/components/ReportForm.tsx`
- [Triage panel](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-app/src/components/TriagePanel.tsx): `dell-flood-app/src/components/TriagePanel.tsx`
- [Chat panel](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-app/src/components/ChatbotPanel.tsx): `dell-flood-app/src/components/ChatbotPanel.tsx`
- [API client](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-app/src/services/api.ts): `dell-flood-app/src/services/api.ts`

### Backend service

- [HTTP API](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/api/endpoints.py): `dell-flood-backend/app/api/endpoints.py`

### Hazard analysis

- [Flood inference](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/ml/inference.py): `dell-flood-backend/app/ml/inference.py`
- [Mask postprocessing](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/ml/postprocess.py): `dell-flood-backend/app/ml/postprocess.py`
- [MirEye physical data](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/flux/api/client.py): `dell-flood-backend/app/flux/api/client.py`
- [TWI and susceptibility](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/flux/pipeline/physical_data_hazard_engine.py): `dell-flood-backend/app/flux/pipeline/physical_data_hazard_engine.py`
- [Predictive hazards](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/flux/pipeline/flood_prediction_pipeline.py): `dell-flood-backend/app/flux/pipeline/flood_prediction_pipeline.py`
- [Population clusters](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/flux/pipeline/cluster.py): `dell-flood-backend/app/flux/pipeline/cluster.py`

### Response planning

- [Priority and allocation](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/flux/pipeline/triage_engine.py): `dell-flood-backend/app/flux/pipeline/triage_engine.py`
- [Evacuation planner](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/flux/routing/evacuation_engine.py): `dell-flood-backend/app/flux/routing/evacuation_engine.py`
- [Elevation-aware routes](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/flux/routing/graph_router.py): `dell-flood-backend/app/flux/routing/graph_router.py`
- [Shelter discovery](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/flux/shelters/finder.py): `dell-flood-backend/app/flux/shelters/finder.py`
- [Tactical maps](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/flux/visualization/map_plotter.py): `dell-flood-backend/app/flux/visualization/map_plotter.py`

### AI assistance

- [Flood agent](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/agent/flood_agent.py): `dell-flood-backend/app/agent/flood_agent.py`
- [MirEye chatbot](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/agent/mireye_chatbot.py): `dell-flood-backend/app/agent/mireye_chatbot.py`
- [Agent tools](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/agent/tools.py): `dell-flood-backend/app/agent/tools.py`
- [RAG report generator](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/RAG/generator.py): `dell-flood-backend/app/RAG/generator.py`
- [Report knowledge store](https://github.com/rajatrawal-06/floodapp/blob/final_project/dell-flood-backend/app/RAG/vector_store.py): `dell-flood-backend/app/RAG/vector_store.py`

### Other components

- **Responder or resident**
- **MirEye API**
- **LLM provider**

## Connections

- Responder or resident → Mobile app: uses
- Mobile app → API client: requests
- API client → HTTP API: calls
- Mobile app → Map view: displays
- Mobile app → Crowd reports: presents
- Mobile app → Triage panel: presents
- Mobile app → Chat panel: presents
- HTTP API → Flood inference: runs inference
- Flood inference → Mask postprocessing: produces mask
- TWI and susceptibility → MirEye physical data: enriches context
- MirEye physical data → MirEye API: fetches data
- Predictive hazards → TWI and susceptibility: computes hazards
- Predictive hazards → Population clusters: clusters points
- Priority and allocation → Predictive hazards: uses risk tiers
- Evacuation planner → Shelter discovery: finds candidates
- Evacuation planner → Elevation-aware routes: requests routes
- Evacuation planner → Tactical maps: renders plans
- HTTP API → Flood agent: routes chat
- HTTP API → RAG report generator: generates reports
- HTTP API → Report knowledge store: queries context
- Flood agent → Agent tools: dispatches tools
- MirEye chatbot → MirEye physical data: queries context
- RAG report generator → Report knowledge store: retrieves reports
- Flood agent → LLM provider: consults model
- MirEye chatbot → LLM provider: consults model
