# mercykal/kenya-weather-aware-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/mercykal/kenya-weather-aware-dashboard
- Repository: https://github.com/mercykal/kenya-weather-aware-dashboard

## Overview

This repository is an ETL project for a Kenya weather-aware e-commerce and agri-logistics dashboard. Its primary workflow collects forecast, product, and customer data, transforms it into four analytical tables, and loads those tables into PostgreSQL for Power BI reporting. The README also describes delivery-risk monitoring, weather forecasting, and planting advisories. The README documents the Mage ETL stages, but the dashboard and its analytical calculations have no implementation files in the supplied tree; those capabilities are represented as documented product components. A separate Python ETL script is also present. നേ

Main entry points: [`Kenya-Weather-Aware-Dashboard/data_loaders/data_extraction.py`](https://github.com/mercykal/kenya-weather-aware-dashboard/blob/main/Kenya-Weather-Aware-Dashboard/data_loaders/data_extraction.py) (API data loader), [`Kenya-Weather-Aware-Dashboard/pipelines/kenya_weather_aware_dashboard_etl_pipeline/__init__.py`](https://github.com/mercykal/kenya-weather-aware-dashboard/blob/main/Kenya-Weather-Aware-Dashboard/pipelines/kenya_weather_aware_dashboard_etl_pipeline/__init__.py) (Mage ETL pipeline), [`scripts/data_processing.py`](https://github.com/mercykal/kenya-weather-aware-dashboard/blob/main/scripts/data_processing.py) (Standalone ETL script), [`Kenya-Weather-Aware-Dashboard/transformers/data_processing.py`](https://github.com/mercykal/kenya-weather-aware-dashboard/blob/main/Kenya-Weather-Aware-Dashboard/transformers/data_processing.py) (Data transformer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["ETL orchestration"]
  node_mage["Mage ETL pipeline<br/>[__init__.py]"]
  node_standalone["Standalone ETL script<br/>[data_processing.py]"]
end

subgraph group_ingestion["Data ingestion"]
  node_loader["API data loader<br/>[data_extraction.py]"]
  node_script_extract["Python API extraction<br/>[data_extraction.py]"]
end

subgraph group_modeling["Data modeling"]
  node_transformer["Data transformer<br/>[data_processing.py]"]
  node_exporter["PostgreSQL exporter<br/>[export_to_pgsql.py]"]
  node_postgres[("PostgreSQL tables")]
end

subgraph group_analytics["Analytics and reporting"]
  node_powerbi["Power BI dashboard"]
  node_risk["Delivery risk views"]
  node_planting["Planting advisories"]
end

node_operator(("Pipeline operator"))
node_openweather["OpenWeather API"]
node_fakestore["Fake Store API"]
node_faker["FakerAPI"]

node_operator -->|"runs"| node_mage
node_mage -->|"runs extraction"| node_loader
node_loader -->|"fetches forecasts"| node_openweather
node_loader -->|"fetches products"| node_fakestore
node_loader -->|"fetches customers"| node_faker
node_mage -->|"runs transformation"| node_transformer
node_transformer -->|"passes tables"| node_exporter
node_exporter -->|"writes tables"| node_postgres
node_standalone -->|"calls extraction"| node_script_extract
node_standalone -->|"writes tables"| node_postgres
node_postgres -.->|"provides analysis data"| node_powerbi
node_powerbi -.->|"shows risk flags"| node_risk
node_powerbi -.->|"shows advisories"| node_planting

click node_mage "https://github.com/mercykal/kenya-weather-aware-dashboard/blob/main/Kenya-Weather-Aware-Dashboard/pipelines/kenya_weather_aware_dashboard_etl_pipeline/__init__.py"
click node_loader "https://github.com/mercykal/kenya-weather-aware-dashboard/blob/main/Kenya-Weather-Aware-Dashboard/data_loaders/data_extraction.py"
click node_transformer "https://github.com/mercykal/kenya-weather-aware-dashboard/blob/main/Kenya-Weather-Aware-Dashboard/transformers/data_processing.py"
click node_exporter "https://github.com/mercykal/kenya-weather-aware-dashboard/blob/main/Kenya-Weather-Aware-Dashboard/data_exporters/export_to_pgsql.py"
click node_standalone "https://github.com/mercykal/kenya-weather-aware-dashboard/blob/main/scripts/data_processing.py"
click node_script_extract "https://github.com/mercykal/kenya-weather-aware-dashboard/blob/main/scripts/data_extraction.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_mage,node_standalone toneBlue
class node_loader,node_script_extract toneAmber
class node_transformer,node_exporter,node_postgres,node_openweather,node_fakestore,node_faker toneMint
class node_powerbi,node_risk,node_planting toneRose
class node_operator toneIndigo
```

## Components

### ETL orchestration

- [Mage ETL pipeline](https://github.com/mercykal/kenya-weather-aware-dashboard/blob/main/Kenya-Weather-Aware-Dashboard/pipelines/kenya_weather_aware_dashboard_etl_pipeline/__init__.py): `Kenya-Weather-Aware-Dashboard/pipelines/kenya_weather_aware_dashboard_etl_pipeline/__init__.py`
- [Standalone ETL script](https://github.com/mercykal/kenya-weather-aware-dashboard/blob/main/scripts/data_processing.py): `scripts/data_processing.py`

### Data ingestion

- [API data loader](https://github.com/mercykal/kenya-weather-aware-dashboard/blob/main/Kenya-Weather-Aware-Dashboard/data_loaders/data_extraction.py): `Kenya-Weather-Aware-Dashboard/data_loaders/data_extraction.py`
- [Python API extraction](https://github.com/mercykal/kenya-weather-aware-dashboard/blob/main/scripts/data_extraction.py): `scripts/data_extraction.py`

### Data modeling

- [Data transformer](https://github.com/mercykal/kenya-weather-aware-dashboard/blob/main/Kenya-Weather-Aware-Dashboard/transformers/data_processing.py): `Kenya-Weather-Aware-Dashboard/transformers/data_processing.py`
- [PostgreSQL exporter](https://github.com/mercykal/kenya-weather-aware-dashboard/blob/main/Kenya-Weather-Aware-Dashboard/data_exporters/export_to_pgsql.py): `Kenya-Weather-Aware-Dashboard/data_exporters/export_to_pgsql.py`
- **PostgreSQL tables**

### Analytics and reporting

- **Power BI dashboard**
- **Delivery risk views**
- **Planting advisories**

### Other components

- **Pipeline operator**
- **OpenWeather API**
- **Fake Store API**
- **FakerAPI**

## Connections

- Pipeline operator → Mage ETL pipeline: runs
- Mage ETL pipeline → API data loader: runs extraction
- API data loader → OpenWeather API: fetches forecasts (evidence: `Kenya-Weather-Aware-Dashboard/data_loaders/data_extraction.py`)
- API data loader → Fake Store API: fetches products (evidence: `Kenya-Weather-Aware-Dashboard/data_loaders/data_extraction.py`)
- API data loader → FakerAPI: fetches customers (evidence: `Kenya-Weather-Aware-Dashboard/data_loaders/data_extraction.py`)
- Mage ETL pipeline → Data transformer: runs transformation
- Data transformer → PostgreSQL exporter: passes tables
- PostgreSQL exporter → PostgreSQL tables: writes tables (evidence: `Kenya-Weather-Aware-Dashboard/data_exporters/export_to_pgsql.py`)
- Standalone ETL script → Python API extraction: calls extraction (evidence: `scripts/data_processing.py`)
- Standalone ETL script → PostgreSQL tables: writes tables (evidence: `scripts/data_processing.py`)
- PostgreSQL tables → Power BI dashboard: provides analysis data
- Power BI dashboard → Delivery risk views: shows risk flags
- Power BI dashboard → Planting advisories: shows advisories
