# chart-scope/chart architecture

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

## Overview

CHART is a climate-and-health planning platform: an authorised planner selects a place and planning horizon, reviews climate inputs and validated model results, saves a plan, then returns to a dashboard for risk views. The web interface fronts a FastAPI analytical API; climate preparation is supported by Dagster orchestration and data adapters, while model releases and results are backed by the application database. README documents the major product capabilities; connections not evidenced by excerpts or its statements are omitted.

Main entry points: [`core/chart/climate/service.py`](https://github.com/chart-scope/chart/blob/main/core/chart/climate/service.py) (Climate planning), [`core/chart/climate/routes.py`](https://github.com/chart-scope/chart/blob/main/core/chart/climate/routes.py) (Climate endpoints), [`core/chart/risk/routes.py`](https://github.com/chart-scope/chart/blob/main/core/chart/risk/routes.py) (Risk endpoints), [`core/chart/api/app.py`](https://github.com/chart-scope/chart/blob/main/core/chart/api/app.py) (FastAPI application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_planning["Planning experience"]
  node_planning_ui["Planning interface<br/>[PlanningApp.tsx]"]
  node_dashboard_ui["Risk dashboard"]
end

subgraph group_api["Application API"]
  node_api_app["FastAPI application<br/>[app.py]"]
  node_climate_routes["Climate endpoints<br/>[routes.py]"]
  node_risk_routes["Risk endpoints<br/>[routes.py]"]
  node_setup["Installation setup"]
  node_geographies["Geography catalog<br/>[routes.py]"]
  node_learning["Learning library<br/>[service.py]"]
end

subgraph group_analytics["Climate and models"]
  node_prediction_requests["Prediction workflow<br/>[requests.py]"]
  node_climate_service["Climate planning<br/>[service.py]"]
  node_model_registry["Model releases<br/>[service.py]"]
  node_inference["Model inference<br/>[service.py]"]
  node_risk_service["Risk views<br/>[service.py]"]
end

subgraph group_platform["Identity and data"]
  node_auth["Identity and access<br/>[service.py]"]
  node_database[("Application database<br/>[models.py]")]
end

subgraph group_pipelines["Data pipelines"]
  node_orchestration["Climate orchestration<br/>[definitions.py]"]
  node_era5["ERA5 heat adapter"]
  node_projection["Projection adapter<br/>[adapter.py]"]
end

node_planner(("Authorised planner"))
node_copernicus["Copernicus CDS"]

node_planner -->|"plans in"| node_planning_ui
node_planner -->|"reviews results"| node_dashboard_ui
node_planning_ui -->|"uses API"| node_api_app
node_dashboard_ui -->|"reads saved results"| node_api_app
node_api_app -.->|"routes requests"| node_climate_routes
node_api_app -.->|"routes requests"| node_risk_routes
node_climate_routes -->|"checks access"| node_auth
node_risk_routes -->|"checks access"| node_auth
node_climate_routes -->|"dispatches prediction"| node_prediction_requests
node_climate_routes -->|"requests planning data"| node_climate_service
node_prediction_requests -->|"uses climate inputs"| node_climate_service
node_climate_service -->|"resolves release"| node_model_registry
node_climate_service -.->|"scores inputs"| node_inference
node_risk_routes -->|"loads risk views"| node_risk_service
node_geographies -->|"lists active models"| node_model_registry
node_climate_service -->|"reads climate records"| node_database
node_prediction_requests -->|"stores prediction results"| node_database
node_risk_routes -->|"reads stored records"| node_database
node_orchestration -->|"runs climate adapter"| node_era5
node_orchestration -->|"runs projection adapter"| node_projection
node_era5 -->|"downloads reanalysis"| node_copernicus
node_setup -->|"configures releases"| node_model_registry

click node_planning_ui "https://github.com/chart-scope/chart/blob/main/web/src/features/planning/PlanningApp.tsx"
click node_dashboard_ui "https://github.com/chart-scope/chart/tree/main/web/src/features/dashboard"
click node_auth "https://github.com/chart-scope/chart/blob/main/core/chart/auth/service.py"
click node_api_app "https://github.com/chart-scope/chart/blob/main/core/chart/api/app.py"
click node_climate_routes "https://github.com/chart-scope/chart/blob/main/core/chart/climate/routes.py"
click node_risk_routes "https://github.com/chart-scope/chart/blob/main/core/chart/risk/routes.py"
click node_prediction_requests "https://github.com/chart-scope/chart/blob/main/core/chart/climate/requests.py"
click node_climate_service "https://github.com/chart-scope/chart/blob/main/core/chart/climate/service.py"
click node_model_registry "https://github.com/chart-scope/chart/blob/main/core/chart/model_registry/service.py"
click node_inference "https://github.com/chart-scope/chart/blob/main/core/chart/inference/service.py"
click node_risk_service "https://github.com/chart-scope/chart/blob/main/core/chart/risk/service.py"
click node_setup "https://github.com/chart-scope/chart/tree/main/core/chart/setup"
click node_geographies "https://github.com/chart-scope/chart/blob/main/core/chart/geographies/routes.py"
click node_learning "https://github.com/chart-scope/chart/blob/main/core/chart/learning/service.py"
click node_database "https://github.com/chart-scope/chart/blob/main/core/chart/shared/db/models.py"
click node_orchestration "https://github.com/chart-scope/chart/blob/main/orchestration/src/chart_pipeline/definitions.py"
click node_era5 "https://github.com/chart-scope/chart/tree/main/pipelines/era5_heat/src/era5_heat"
click node_projection "https://github.com/chart-scope/chart/blob/main/pipelines/isimip_projection/src/isimip_projection/adapter.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_planning_ui,node_dashboard_ui toneBlue
class node_api_app,node_climate_routes,node_risk_routes,node_setup,node_geographies,node_learning toneAmber
class node_prediction_requests,node_climate_service,node_model_registry,node_inference,node_risk_service toneMint
class node_auth,node_database toneRose
class node_orchestration,node_era5,node_projection,node_planner,node_copernicus toneIndigo
```

## Components

### Planning experience

- [Planning interface](https://github.com/chart-scope/chart/blob/main/web/src/features/planning/PlanningApp.tsx): `web/src/features/planning/PlanningApp.tsx`
- [Risk dashboard](https://github.com/chart-scope/chart/tree/main/web/src/features/dashboard): `web/src/features/dashboard`

### Application API

- [FastAPI application](https://github.com/chart-scope/chart/blob/main/core/chart/api/app.py): `core/chart/api/app.py`
- [Climate endpoints](https://github.com/chart-scope/chart/blob/main/core/chart/climate/routes.py): `core/chart/climate/routes.py`
- [Risk endpoints](https://github.com/chart-scope/chart/blob/main/core/chart/risk/routes.py): `core/chart/risk/routes.py`
- [Installation setup](https://github.com/chart-scope/chart/tree/main/core/chart/setup): `core/chart/setup`
- [Geography catalog](https://github.com/chart-scope/chart/blob/main/core/chart/geographies/routes.py): `core/chart/geographies/routes.py`
- [Learning library](https://github.com/chart-scope/chart/blob/main/core/chart/learning/service.py): `core/chart/learning/service.py`

### Climate and models

- [Prediction workflow](https://github.com/chart-scope/chart/blob/main/core/chart/climate/requests.py): `core/chart/climate/requests.py`
- [Climate planning](https://github.com/chart-scope/chart/blob/main/core/chart/climate/service.py): `core/chart/climate/service.py`
- [Model releases](https://github.com/chart-scope/chart/blob/main/core/chart/model_registry/service.py): `core/chart/model_registry/service.py`
- [Model inference](https://github.com/chart-scope/chart/blob/main/core/chart/inference/service.py): `core/chart/inference/service.py`
- [Risk views](https://github.com/chart-scope/chart/blob/main/core/chart/risk/service.py): `core/chart/risk/service.py`

### Identity and data

- [Identity and access](https://github.com/chart-scope/chart/blob/main/core/chart/auth/service.py): `core/chart/auth/service.py`
- [Application database](https://github.com/chart-scope/chart/blob/main/core/chart/shared/db/models.py): `core/chart/shared/db/models.py`

### Data pipelines

- [Climate orchestration](https://github.com/chart-scope/chart/blob/main/orchestration/src/chart_pipeline/definitions.py): `orchestration/src/chart_pipeline/definitions.py`
- [ERA5 heat adapter](https://github.com/chart-scope/chart/tree/main/pipelines/era5_heat/src/era5_heat): `pipelines/era5_heat/src/era5_heat`
- [Projection adapter](https://github.com/chart-scope/chart/blob/main/pipelines/isimip_projection/src/isimip_projection/adapter.py): `pipelines/isimip_projection/src/isimip_projection/adapter.py`

### Other components

- **Authorised planner**
- **Copernicus CDS**

## Connections

- Authorised planner → Planning interface: plans in
- Authorised planner → Risk dashboard: reviews results
- Planning interface → FastAPI application: uses API
- Risk dashboard → FastAPI application: reads saved results
- FastAPI application → Climate endpoints: routes requests
- FastAPI application → Risk endpoints: routes requests
- Climate endpoints → Identity and access: checks access (evidence: `core/chart/climate/routes.py`)
- Risk endpoints → Identity and access: checks access (evidence: `core/chart/risk/routes.py`)
- Climate endpoints → Prediction workflow: dispatches prediction (evidence: `core/chart/climate/routes.py`)
- Climate endpoints → Climate planning: requests planning data (evidence: `core/chart/climate/routes.py`)
- Prediction workflow → Climate planning: uses climate inputs (evidence: `core/chart/climate/requests.py`)
- Climate planning → Model releases: resolves release (evidence: `core/chart/climate/service.py`)
- Climate planning → Model inference: scores inputs
- Risk endpoints → Risk views: loads risk views (evidence: `core/chart/risk/routes.py`)
- Geography catalog → Model releases: lists active models (evidence: `core/chart/geographies/routes.py`)
- Climate planning → Application database: reads climate records (evidence: `core/chart/climate/service.py`)
- Prediction workflow → Application database: stores prediction results (evidence: `core/chart/climate/requests.py`)
- Risk endpoints → Application database: reads stored records (evidence: `core/chart/risk/routes.py`)
- Climate orchestration → ERA5 heat adapter: runs climate adapter (evidence: `orchestration/src/chart_pipeline/definitions.py`)
- Climate orchestration → Projection adapter: runs projection adapter (evidence: `orchestration/src/chart_pipeline/definitions.py`)
- ERA5 heat adapter → Copernicus CDS: downloads reanalysis (evidence: `pipelines/era5_heat/src/era5_heat/cds_client.py`)
- Installation setup → Model releases: configures releases (evidence: `core/chart/setup/model_configs.py`)
