# davidmothae3/caresai-test architecture

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

- Interactive diagram: https://gitdiagram.com/davidmothae3/caresai-test
- Repository: https://github.com/davidmothae3/caresai-test

## Overview

CARES is a prototype climate and child-health risk intelligence system for Lesotho. Its documented workflow uses community-month data for preprocessing, model training and explanation; a committed model-output file then feeds a browser dashboard for district and community risk exploration. The notebook’s described export cell is not committed, so the graph does not imply it generates the JSON. Dashboard capabilities and the independent weather forecast are documented in the README; no source excerpts were available to verify further internal wiring.

Main entry points: [`index.html`](https://github.com/davidmothae3/caresai-test/blob/main/index.html) (Web dashboard), [`Climate_Health_Risk_Kids_Under_5.ipynb`](https://github.com/davidmothae3/caresai-test/blob/main/Climate_Health_Risk_Kids_Under_5.ipynb) (SMOTE balancing), [`CARES.csv`](https://github.com/davidmothae3/caresai-test/blob/main/CARES.csv) (Community data), [`care_ai_output.json`](https://github.com/davidmothae3/caresai-test/blob/main/care_ai_output.json) (Risk output)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_modeling["Risk modeling"]
  node_dataset[("Community data<br/>[CARES.csv]")]
  node_preprocess["Preprocessing"]
  node_balance["SMOTE balancing"]
  node_random_forest["Random Forest"]
  node_cnn["1D-CNN"]
  node_explainability["Model explanations"]
  node_validation["Cross-validation"]
end

subgraph group_results["Risk results"]
  node_model_output["Risk output"]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard["Web dashboard<br/>[index.html]"]
  node_risk_map["District risk map<br/>[index.html]"]
  node_trends["Trend analysis<br/>[index.html]"]
  node_alert_feed["Alert feed<br/>[index.html]"]
  node_map_layers["GIS reference layers<br/>[index.html]"]
  node_forecast_panel["Rainfall forecast<br/>[index.html]"]
end

subgraph group_integrations["External services"]
  node_weather_service["OpenWeatherMap"]
end

node_health_user(("Health team"))

node_dataset -->|"supplies rows"| node_preprocess
node_preprocess -->|"prepares training data"| node_balance
node_balance -->|"trains"| node_random_forest
node_balance -->|"trains"| node_cnn
node_cnn -->|"explained by SHAP"| node_explainability
node_random_forest -->|"feature importance"| node_explainability
node_cnn -->|"evaluated by"| node_validation
node_health_user -->|"views"| node_dashboard
node_dashboard -->|"fetches"| node_model_output
node_dashboard -->|"provides view"| node_risk_map
node_dashboard -->|"provides view"| node_trends
node_dashboard -->|"provides view"| node_alert_feed
node_dashboard -->|"embeds"| node_map_layers
node_dashboard -->|"provides panel"| node_forecast_panel
node_forecast_panel -.->|"requests forecast"| node_weather_service

click node_dataset "https://github.com/davidmothae3/caresai-test/blob/main/CARES.csv"
click node_preprocess "https://github.com/davidmothae3/caresai-test/blob/main/Climate_Health_Risk_Kids_Under_5.ipynb"
click node_balance "https://github.com/davidmothae3/caresai-test/blob/main/Climate_Health_Risk_Kids_Under_5.ipynb"
click node_random_forest "https://github.com/davidmothae3/caresai-test/blob/main/Climate_Health_Risk_Kids_Under_5.ipynb"
click node_cnn "https://github.com/davidmothae3/caresai-test/blob/main/Climate_Health_Risk_Kids_Under_5.ipynb"
click node_explainability "https://github.com/davidmothae3/caresai-test/blob/main/Climate_Health_Risk_Kids_Under_5.ipynb"
click node_validation "https://github.com/davidmothae3/caresai-test/blob/main/Climate_Health_Risk_Kids_Under_5.ipynb"
click node_model_output "https://github.com/davidmothae3/caresai-test/blob/main/care_ai_output.json"
click node_dashboard "https://github.com/davidmothae3/caresai-test/blob/main/index.html"
click node_risk_map "https://github.com/davidmothae3/caresai-test/blob/main/index.html"
click node_trends "https://github.com/davidmothae3/caresai-test/blob/main/index.html"
click node_alert_feed "https://github.com/davidmothae3/caresai-test/blob/main/index.html"
click node_map_layers "https://github.com/davidmothae3/caresai-test/blob/main/index.html"
click node_forecast_panel "https://github.com/davidmothae3/caresai-test/blob/main/index.html"

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_dataset,node_preprocess,node_balance,node_random_forest,node_cnn,node_explainability,node_validation toneBlue
class node_model_output toneAmber
class node_dashboard,node_risk_map,node_trends,node_alert_feed,node_map_layers,node_forecast_panel toneMint
class node_weather_service toneRose
class node_health_user toneIndigo
```

## Components

### Risk modeling

- [Community data](https://github.com/davidmothae3/caresai-test/blob/main/CARES.csv): `CARES.csv`
- [Preprocessing](https://github.com/davidmothae3/caresai-test/blob/main/Climate_Health_Risk_Kids_Under_5.ipynb): `Climate_Health_Risk_Kids_Under_5.ipynb`
- [SMOTE balancing](https://github.com/davidmothae3/caresai-test/blob/main/Climate_Health_Risk_Kids_Under_5.ipynb): `Climate_Health_Risk_Kids_Under_5.ipynb`
- [Random Forest](https://github.com/davidmothae3/caresai-test/blob/main/Climate_Health_Risk_Kids_Under_5.ipynb): `Climate_Health_Risk_Kids_Under_5.ipynb`
- [1D-CNN](https://github.com/davidmothae3/caresai-test/blob/main/Climate_Health_Risk_Kids_Under_5.ipynb): `Climate_Health_Risk_Kids_Under_5.ipynb`
- [Model explanations](https://github.com/davidmothae3/caresai-test/blob/main/Climate_Health_Risk_Kids_Under_5.ipynb): `Climate_Health_Risk_Kids_Under_5.ipynb`
- [Cross-validation](https://github.com/davidmothae3/caresai-test/blob/main/Climate_Health_Risk_Kids_Under_5.ipynb): `Climate_Health_Risk_Kids_Under_5.ipynb`

### Risk results

- [Risk output](https://github.com/davidmothae3/caresai-test/blob/main/care_ai_output.json): `care_ai_output.json`

### Dashboard

- [Web dashboard](https://github.com/davidmothae3/caresai-test/blob/main/index.html): `index.html`
- [District risk map](https://github.com/davidmothae3/caresai-test/blob/main/index.html): `index.html`
- [Trend analysis](https://github.com/davidmothae3/caresai-test/blob/main/index.html): `index.html`
- [Alert feed](https://github.com/davidmothae3/caresai-test/blob/main/index.html): `index.html`
- [GIS reference layers](https://github.com/davidmothae3/caresai-test/blob/main/index.html): `index.html`
- [Rainfall forecast](https://github.com/davidmothae3/caresai-test/blob/main/index.html): `index.html`

### External services

- **OpenWeatherMap**

### Other components

- **Health team**

## Connections

- Community data → Preprocessing: supplies rows
- Preprocessing → SMOTE balancing: prepares training data
- SMOTE balancing → Random Forest: trains
- SMOTE balancing → 1D-CNN: trains
- 1D-CNN → Model explanations: explained by SHAP
- Random Forest → Model explanations: feature importance
- 1D-CNN → Cross-validation: evaluated by
- Health team → Web dashboard: views
- Web dashboard → Risk output: fetches
- Web dashboard → District risk map: provides view
- Web dashboard → Trend analysis: provides view
- Web dashboard → Alert feed: provides view
- Web dashboard → GIS reference layers: embeds
- Web dashboard → Rainfall forecast: provides panel
- Rainfall forecast → OpenWeatherMap: requests forecast
