# ishaq-5012/albedoai architecture

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

- Interactive diagram: https://gitdiagram.com/ishaq-5012/albedoai
- Repository: https://github.com/ishaq-5012/albedoai

## Overview

GeoTrust AI is presented as a district disaster-intelligence dashboard: analysts navigate maps, district assessments, source reliability, conflicts, scores, alerts, and reports, with an assistant for questions. The frontend’s sampled analysis flow selects a district and sources, updates local analysis state, and displays assessment details; the backend separately exposes district, source, analysis, and alert APIs. The UI also relies heavily on bundled demo data. Source excerpts do not establish that the frontend calls the backend, or how backend services are invoked, so those connections are omitted.

Main entry points: [`src/data/demoData.ts`](https://github.com/ishaq-5012/albedoai/blob/main/src/data/demoData.ts) (Bundled demo data), [`src/pages/index.tsx`](https://github.com/ishaq-5012/albedoai/blob/main/src/pages/index.tsx) (Page registry), [`src/store/useStore.ts`](https://github.com/ishaq-5012/albedoai/blob/main/src/store/useStore.ts) (Application state), [`backend/app/models.py`](https://github.com/ishaq-5012/albedoai/blob/main/backend/app/models.py) (Backend data models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Application shell"]
  node_app["Application root<br/>[App.tsx]"]
  node_layout["Navigation layout<br/>[Layout.tsx]"]
  node_page_registry["Page registry<br/>[index.tsx]"]
  node_login["Login page<br/>[LoginPage.tsx]"]
end

subgraph group_workbench["Analyst workbench"]
  node_dashboard["Dashboard<br/>[DashboardPage.tsx]"]
  node_map["District map<br/>[MapPage.tsx]"]
  node_analysis_ui["Analysis workflow<br/>[AnalysisPage.tsx]"]
  node_sources_ui["Source explorer<br/>[SourcesPage.tsx]"]
  node_conflicts_ui["Conflict review<br/>[ConflictsPage.tsx]"]
  node_scores_ui["Trust and risk scores<br/>[ScoresPage.tsx]"]
  node_reports_ui["Reports<br/>[ReportsPage.tsx]"]
  node_chat_ui["Chat page<br/>[ChatPage.tsx]"]
  node_settings_ui["Settings<br/>[SettingsPage.tsx]"]
  node_alert_modal["Alert modal<br/>[AlertModal.tsx]"]
  node_chat_assistant["Chat assistant<br/>[ChatAssistant.tsx]"]
end

subgraph group_frontenddata["Frontend state and data"]
  node_store["Application state<br/>[useStore.ts]"]
  node_demo_data["Bundled demo data<br/>[demoData.ts]"]
  node_frontend_types["Frontend domain types<br/>[index.ts]"]
end

subgraph group_api["Backend API"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_district_api["District API<br/>[districts.py]"]
  node_source_api["Source API<br/>[sources.py]"]
  node_analysis_api["Analysis API<br/>[analysis.py]"]
  node_alert_api["Alert API<br/>[alerts.py]"]
  node_backend_models["Backend data models<br/>[models.py]"]
end

subgraph group_engines["Assessment services"]
  node_risk_engine["Risk engine<br/>[risk_engine.py]"]
  node_trust_engine["Trust engine<br/>[trust_engine.py]"]
  node_zone_classifier["Zone classifier<br/>[zone_classifier.py]"]
  node_conflict_detector["Conflict detector"]
  node_ai_explainer["AI explainer<br/>[ai_explainer.py]"]
end

node_analyst(("Analyst"))

node_analyst -->|"uses"| node_layout
node_layout -->|"selects page"| node_page_registry
node_layout -->|"shows when unauthenticated"| node_login
node_page_registry -->|"maps route"| node_dashboard
node_page_registry -->|"maps route"| node_map
node_page_registry -->|"maps route"| node_analysis_ui
node_page_registry -->|"maps route"| node_sources_ui
node_page_registry -->|"maps route"| node_conflicts_ui
node_page_registry -->|"maps route"| node_scores_ui
node_page_registry -->|"maps route"| node_chat_ui
node_page_registry -->|"maps route"| node_reports_ui
node_page_registry -->|"maps route"| node_settings_ui
node_app -->|"renders"| node_layout
node_app -->|"renders when authenticated"| node_alert_modal
node_app -->|"renders"| node_chat_assistant
node_analysis_ui -->|"updates analysis state"| node_store
node_analysis_ui -->|"reads assessment data"| node_demo_data
node_dashboard -->|"reads state"| node_store
node_dashboard -->|"reads dashboard data"| node_demo_data
node_map -->|"reads state"| node_store
node_map -->|"reads map data"| node_demo_data
node_sources_ui -->|"reads source data"| node_demo_data
node_conflicts_ui -->|"reads conflict data"| node_demo_data
node_scores_ui -->|"reads scores"| node_demo_data
node_reports_ui -->|"reads state"| node_store
node_reports_ui -->|"reads report data"| node_demo_data
node_chat_ui -->|"uses chat state"| node_store
node_chat_ui -->|"reads responses"| node_demo_data
node_settings_ui -->|"updates settings state"| node_store
node_settings_ui -->|"reads settings data"| node_demo_data
node_alert_modal -->|"acknowledges alerts"| node_store
node_alert_modal -->|"enriches alert"| node_demo_data
node_chat_assistant -->|"stores messages"| node_store
node_chat_assistant -->|"looks up replies"| node_demo_data
node_store -->|"initializes alerts and notifications"| node_demo_data
node_store -->|"uses domain types"| node_frontend_types
node_api_app -->|"registers route"| node_district_api
node_api_app -->|"registers route"| node_source_api
node_api_app -->|"registers route"| node_analysis_api
node_api_app -->|"registers route"| node_alert_api
node_district_api -->|"uses models"| node_backend_models
node_source_api -->|"uses models"| node_backend_models
node_analysis_api -->|"uses models"| node_backend_models
node_alert_api -->|"uses models"| node_backend_models
node_conflict_detector -->|"uses models"| node_backend_models
node_ai_explainer -->|"uses models"| node_backend_models

click node_app "https://github.com/ishaq-5012/albedoai/blob/main/src/App.tsx"
click node_layout "https://github.com/ishaq-5012/albedoai/blob/main/src/components/Layout.tsx"
click node_page_registry "https://github.com/ishaq-5012/albedoai/blob/main/src/pages/index.tsx"
click node_login "https://github.com/ishaq-5012/albedoai/blob/main/src/pages/LoginPage.tsx"
click node_dashboard "https://github.com/ishaq-5012/albedoai/blob/main/src/pages/DashboardPage.tsx"
click node_map "https://github.com/ishaq-5012/albedoai/blob/main/src/pages/MapPage.tsx"
click node_analysis_ui "https://github.com/ishaq-5012/albedoai/blob/main/src/pages/AnalysisPage.tsx"
click node_sources_ui "https://github.com/ishaq-5012/albedoai/blob/main/src/pages/SourcesPage.tsx"
click node_conflicts_ui "https://github.com/ishaq-5012/albedoai/blob/main/src/pages/ConflictsPage.tsx"
click node_scores_ui "https://github.com/ishaq-5012/albedoai/blob/main/src/pages/ScoresPage.tsx"
click node_reports_ui "https://github.com/ishaq-5012/albedoai/blob/main/src/pages/ReportsPage.tsx"
click node_chat_ui "https://github.com/ishaq-5012/albedoai/blob/main/src/pages/ChatPage.tsx"
click node_settings_ui "https://github.com/ishaq-5012/albedoai/blob/main/src/pages/SettingsPage.tsx"
click node_alert_modal "https://github.com/ishaq-5012/albedoai/blob/main/src/components/AlertModal.tsx"
click node_chat_assistant "https://github.com/ishaq-5012/albedoai/blob/main/src/components/ChatAssistant.tsx"
click node_store "https://github.com/ishaq-5012/albedoai/blob/main/src/store/useStore.ts"
click node_demo_data "https://github.com/ishaq-5012/albedoai/blob/main/src/data/demoData.ts"
click node_frontend_types "https://github.com/ishaq-5012/albedoai/blob/main/src/types/index.ts"
click node_api_app "https://github.com/ishaq-5012/albedoai/blob/main/backend/app/main.py"
click node_district_api "https://github.com/ishaq-5012/albedoai/blob/main/backend/app/routers/districts.py"
click node_source_api "https://github.com/ishaq-5012/albedoai/blob/main/backend/app/routers/sources.py"
click node_analysis_api "https://github.com/ishaq-5012/albedoai/blob/main/backend/app/routers/analysis.py"
click node_alert_api "https://github.com/ishaq-5012/albedoai/blob/main/backend/app/routers/alerts.py"
click node_backend_models "https://github.com/ishaq-5012/albedoai/blob/main/backend/app/models.py"
click node_risk_engine "https://github.com/ishaq-5012/albedoai/blob/main/backend/app/services/risk_engine.py"
click node_trust_engine "https://github.com/ishaq-5012/albedoai/blob/main/backend/app/services/trust_engine.py"
click node_zone_classifier "https://github.com/ishaq-5012/albedoai/blob/main/backend/app/services/zone_classifier.py"
click node_conflict_detector "https://github.com/ishaq-5012/albedoai/blob/main/backend/app/services/conflict_detector.py"
click node_ai_explainer "https://github.com/ishaq-5012/albedoai/blob/main/backend/app/services/ai_explainer.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_layout,node_page_registry,node_login toneBlue
class node_dashboard,node_map,node_analysis_ui,node_sources_ui,node_conflicts_ui,node_scores_ui,node_reports_ui,node_chat_ui,node_settings_ui,node_alert_modal,node_chat_assistant toneAmber
class node_store,node_demo_data,node_frontend_types toneMint
class node_api_app,node_district_api,node_source_api,node_analysis_api,node_alert_api,node_backend_models toneRose
class node_risk_engine,node_trust_engine,node_zone_classifier,node_conflict_detector,node_ai_explainer,node_analyst toneIndigo
```

## Components

### Application shell

- [Application root](https://github.com/ishaq-5012/albedoai/blob/main/src/App.tsx): `src/App.tsx`
- [Navigation layout](https://github.com/ishaq-5012/albedoai/blob/main/src/components/Layout.tsx): `src/components/Layout.tsx`
- [Page registry](https://github.com/ishaq-5012/albedoai/blob/main/src/pages/index.tsx): `src/pages/index.tsx`
- [Login page](https://github.com/ishaq-5012/albedoai/blob/main/src/pages/LoginPage.tsx): `src/pages/LoginPage.tsx`

### Analyst workbench

- [Dashboard](https://github.com/ishaq-5012/albedoai/blob/main/src/pages/DashboardPage.tsx): `src/pages/DashboardPage.tsx`
- [District map](https://github.com/ishaq-5012/albedoai/blob/main/src/pages/MapPage.tsx): `src/pages/MapPage.tsx`
- [Analysis workflow](https://github.com/ishaq-5012/albedoai/blob/main/src/pages/AnalysisPage.tsx): `src/pages/AnalysisPage.tsx`
- [Source explorer](https://github.com/ishaq-5012/albedoai/blob/main/src/pages/SourcesPage.tsx): `src/pages/SourcesPage.tsx`
- [Conflict review](https://github.com/ishaq-5012/albedoai/blob/main/src/pages/ConflictsPage.tsx): `src/pages/ConflictsPage.tsx`
- [Trust and risk scores](https://github.com/ishaq-5012/albedoai/blob/main/src/pages/ScoresPage.tsx): `src/pages/ScoresPage.tsx`
- [Reports](https://github.com/ishaq-5012/albedoai/blob/main/src/pages/ReportsPage.tsx): `src/pages/ReportsPage.tsx`
- [Chat page](https://github.com/ishaq-5012/albedoai/blob/main/src/pages/ChatPage.tsx): `src/pages/ChatPage.tsx`
- [Settings](https://github.com/ishaq-5012/albedoai/blob/main/src/pages/SettingsPage.tsx): `src/pages/SettingsPage.tsx`
- [Alert modal](https://github.com/ishaq-5012/albedoai/blob/main/src/components/AlertModal.tsx): `src/components/AlertModal.tsx`
- [Chat assistant](https://github.com/ishaq-5012/albedoai/blob/main/src/components/ChatAssistant.tsx): `src/components/ChatAssistant.tsx`

### Frontend state and data

- [Application state](https://github.com/ishaq-5012/albedoai/blob/main/src/store/useStore.ts): `src/store/useStore.ts`
- [Bundled demo data](https://github.com/ishaq-5012/albedoai/blob/main/src/data/demoData.ts): `src/data/demoData.ts`
- [Frontend domain types](https://github.com/ishaq-5012/albedoai/blob/main/src/types/index.ts): `src/types/index.ts`

### Backend API

- [FastAPI application](https://github.com/ishaq-5012/albedoai/blob/main/backend/app/main.py): `backend/app/main.py`
- [District API](https://github.com/ishaq-5012/albedoai/blob/main/backend/app/routers/districts.py): `backend/app/routers/districts.py`
- [Source API](https://github.com/ishaq-5012/albedoai/blob/main/backend/app/routers/sources.py): `backend/app/routers/sources.py`
- [Analysis API](https://github.com/ishaq-5012/albedoai/blob/main/backend/app/routers/analysis.py): `backend/app/routers/analysis.py`
- [Alert API](https://github.com/ishaq-5012/albedoai/blob/main/backend/app/routers/alerts.py): `backend/app/routers/alerts.py`
- [Backend data models](https://github.com/ishaq-5012/albedoai/blob/main/backend/app/models.py): `backend/app/models.py`

### Assessment services

- [Risk engine](https://github.com/ishaq-5012/albedoai/blob/main/backend/app/services/risk_engine.py): `backend/app/services/risk_engine.py`
- [Trust engine](https://github.com/ishaq-5012/albedoai/blob/main/backend/app/services/trust_engine.py): `backend/app/services/trust_engine.py`
- [Zone classifier](https://github.com/ishaq-5012/albedoai/blob/main/backend/app/services/zone_classifier.py): `backend/app/services/zone_classifier.py`
- [Conflict detector](https://github.com/ishaq-5012/albedoai/blob/main/backend/app/services/conflict_detector.py): `backend/app/services/conflict_detector.py`
- [AI explainer](https://github.com/ishaq-5012/albedoai/blob/main/backend/app/services/ai_explainer.py): `backend/app/services/ai_explainer.py`

### Other components

- **Analyst**

## Connections

- Analyst → Navigation layout: uses (evidence: `src/components/Layout.tsx`)
- Navigation layout → Page registry: selects page (evidence: `src/components/Layout.tsx`)
- Navigation layout → Login page: shows when unauthenticated (evidence: `src/components/Layout.tsx`)
- Page registry → Dashboard: maps route (evidence: `src/pages/index.tsx`)
- Page registry → District map: maps route (evidence: `src/pages/index.tsx`)
- Page registry → Analysis workflow: maps route (evidence: `src/pages/index.tsx`)
- Page registry → Source explorer: maps route (evidence: `src/pages/index.tsx`)
- Page registry → Conflict review: maps route (evidence: `src/pages/index.tsx`)
- Page registry → Trust and risk scores: maps route (evidence: `src/pages/index.tsx`)
- Page registry → Chat page: maps route (evidence: `src/pages/index.tsx`)
- Page registry → Reports: maps route (evidence: `src/pages/index.tsx`)
- Page registry → Settings: maps route (evidence: `src/pages/index.tsx`)
- Application root → Navigation layout: renders (evidence: `src/App.tsx`)
- Application root → Alert modal: renders when authenticated (evidence: `src/App.tsx`)
- Application root → Chat assistant: renders (evidence: `src/App.tsx`)
- Analysis workflow → Application state: updates analysis state (evidence: `src/pages/AnalysisPage.tsx`)
- Analysis workflow → Bundled demo data: reads assessment data (evidence: `src/pages/AnalysisPage.tsx`)
- Dashboard → Application state: reads state (evidence: `src/pages/DashboardPage.tsx`)
- Dashboard → Bundled demo data: reads dashboard data (evidence: `src/pages/DashboardPage.tsx`)
- District map → Application state: reads state (evidence: `src/pages/MapPage.tsx`)
- District map → Bundled demo data: reads map data (evidence: `src/pages/MapPage.tsx`)
- Source explorer → Bundled demo data: reads source data (evidence: `src/pages/SourcesPage.tsx`)
- Conflict review → Bundled demo data: reads conflict data (evidence: `src/pages/ConflictsPage.tsx`)
- Trust and risk scores → Bundled demo data: reads scores (evidence: `src/pages/ScoresPage.tsx`)
- Reports → Application state: reads state (evidence: `src/pages/ReportsPage.tsx`)
- Reports → Bundled demo data: reads report data (evidence: `src/pages/ReportsPage.tsx`)
- Chat page → Application state: uses chat state (evidence: `src/pages/ChatPage.tsx`)
- Chat page → Bundled demo data: reads responses (evidence: `src/pages/ChatPage.tsx`)
- Settings → Application state: updates settings state (evidence: `src/pages/SettingsPage.tsx`)
- Settings → Bundled demo data: reads settings data (evidence: `src/pages/SettingsPage.tsx`)
- Alert modal → Application state: acknowledges alerts (evidence: `src/components/AlertModal.tsx`)
- Alert modal → Bundled demo data: enriches alert (evidence: `src/components/AlertModal.tsx`)
- Chat assistant → Application state: stores messages (evidence: `src/components/ChatAssistant.tsx`)
- Chat assistant → Bundled demo data: looks up replies (evidence: `src/components/ChatAssistant.tsx`)
- Application state → Bundled demo data: initializes alerts and notifications (evidence: `src/store/useStore.ts`)
- Application state → Frontend domain types: uses domain types (evidence: `src/store/useStore.ts`)
- FastAPI application → District API: registers route (evidence: `backend/app/main.py`)
- FastAPI application → Source API: registers route (evidence: `backend/app/main.py`)
- FastAPI application → Analysis API: registers route (evidence: `backend/app/main.py`)
- FastAPI application → Alert API: registers route (evidence: `backend/app/main.py`)
- District API → Backend data models: uses models (evidence: `backend/app/routers/districts.py`)
- Source API → Backend data models: uses models (evidence: `backend/app/routers/sources.py`)
- Analysis API → Backend data models: uses models (evidence: `backend/app/routers/analysis.py`)
- Alert API → Backend data models: uses models (evidence: `backend/app/routers/alerts.py`)
- Conflict detector → Backend data models: uses models (evidence: `backend/app/services/conflict_detector.py`)
- AI explainer → Backend data models: uses models (evidence: `backend/app/services/ai_explainer.py`)
