# sraaaas/orchestration_airflow architecture

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

## Overview

This repository is an hourly weather-data ELT pipeline. Airflow schedules extraction from Open-Meteo, loading into PostgreSQL, dbt transformations, dbt tests, and a final data check. The README also documents Metabase visualization. The main scripts and DAG are excerpted; the Metabase connection and some deployment wiring are not shown, so that integration is represented as unverified.

Main entry points: [`dags/etl_dags.py`](https://github.com/sraaaas/orchestration_airflow/blob/main/dags/etl_dags.py) (Weather DAG), [`scripts/extract.py`](https://github.com/sraaaas/orchestration_airflow/blob/main/scripts/extract.py) (Weather extraction), [`scripts/run_dbt.py`](https://github.com/sraaaas/orchestration_airflow/blob/main/scripts/run_dbt.py) (dbt runner), [`scripts/load.py`](https://github.com/sraaaas/orchestration_airflow/blob/main/scripts/load.py) (Weather loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Orchestration"]
  node_dag["Weather DAG<br/>[etl_dags.py]"]
end

subgraph group_ingestion["Ingestion"]
  node_extract["Weather extraction<br/>[extract.py]"]
  node_csv["Weather CSV"]
  node_load["Weather loader<br/>[load.py]"]
end

subgraph group_analytics["Analytics"]
  node_postgres[("PostgreSQL weather DB")]
  node_dbtrun["dbt runner<br/>[run_dbt.py]"]
  node_staging["Weather staging<br/>[stg_weather.sql]"]
  node_daily["Daily temperature mart"]
  node_dbttest["dbt tests<br/>[test_dbt.py]"]
  node_check["Data verification<br/>[check_data.py]"]
end

node_scheduler(("Airflow scheduler"))
node_openmeteo{{"Open-Meteo API"}}
node_metabase["Metabase"]

node_scheduler -->|"schedules"| node_dag
node_dag -->|"runs first"| node_extract
node_dag -->|"runs next"| node_load
node_dag -->|"runs next"| node_dbtrun
node_dag -->|"runs next"| node_dbttest
node_dag -->|"runs last"| node_check
node_extract -->|"reads latest date"| node_postgres
node_extract -->|"requests observations"| node_openmeteo
node_extract -->|"writes CSV"| node_csv
node_csv -->|"supplies rows"| node_load
node_load -->|"upserts rows"| node_postgres
node_dbtrun -->|"runs models"| node_staging
node_dbtrun -->|"runs models"| node_daily
node_staging -->|"prepares data"| node_daily
node_postgres -->|"stores model data"| node_staging
node_postgres -->|"stores model data"| node_daily
node_dag -->|"tests after run"| node_dbttest
node_dbttest -.->|"tests models"| node_postgres
node_check -->|"queries tables"| node_postgres
node_postgres -.->|"serves analytics"| node_metabase

click node_dag "https://github.com/sraaaas/orchestration_airflow/blob/main/dags/etl_dags.py"
click node_extract "https://github.com/sraaaas/orchestration_airflow/blob/main/scripts/extract.py"
click node_csv "https://github.com/sraaaas/orchestration_airflow/blob/main/data/raw_weather_data.csv"
click node_load "https://github.com/sraaaas/orchestration_airflow/blob/main/scripts/load.py"
click node_dbtrun "https://github.com/sraaaas/orchestration_airflow/blob/main/scripts/run_dbt.py"
click node_staging "https://github.com/sraaaas/orchestration_airflow/blob/main/dbt_weather/models/staging/stg_weather.sql"
click node_daily "https://github.com/sraaaas/orchestration_airflow/blob/main/dbt_weather/models/marts/daily_temperature.sql"
click node_dbttest "https://github.com/sraaaas/orchestration_airflow/blob/main/scripts/test_dbt.py"
click node_check "https://github.com/sraaaas/orchestration_airflow/blob/main/scripts/check_data.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_dag toneBlue
class node_extract,node_csv,node_load toneAmber
class node_postgres,node_dbtrun,node_staging,node_daily,node_dbttest,node_check,node_openmeteo toneMint
class node_scheduler toneRose
class node_metabase toneIndigo
```

## Components

### Orchestration

- [Weather DAG](https://github.com/sraaaas/orchestration_airflow/blob/main/dags/etl_dags.py): `dags/etl_dags.py`

### Ingestion

- [Weather extraction](https://github.com/sraaaas/orchestration_airflow/blob/main/scripts/extract.py): `scripts/extract.py`
- [Weather CSV](https://github.com/sraaaas/orchestration_airflow/blob/main/data/raw_weather_data.csv): `data/raw_weather_data.csv`
- [Weather loader](https://github.com/sraaaas/orchestration_airflow/blob/main/scripts/load.py): `scripts/load.py`

### Analytics

- **PostgreSQL weather DB**
- [dbt runner](https://github.com/sraaaas/orchestration_airflow/blob/main/scripts/run_dbt.py): `scripts/run_dbt.py`
- [Weather staging](https://github.com/sraaaas/orchestration_airflow/blob/main/dbt_weather/models/staging/stg_weather.sql): `dbt_weather/models/staging/stg_weather.sql`
- [Daily temperature mart](https://github.com/sraaaas/orchestration_airflow/blob/main/dbt_weather/models/marts/daily_temperature.sql): `dbt_weather/models/marts/daily_temperature.sql`
- [dbt tests](https://github.com/sraaaas/orchestration_airflow/blob/main/scripts/test_dbt.py): `scripts/test_dbt.py`
- [Data verification](https://github.com/sraaaas/orchestration_airflow/blob/main/scripts/check_data.py): `scripts/check_data.py`

### Other components

- **Airflow scheduler**
- **Open-Meteo API**
- **Metabase**

## Connections

- Airflow scheduler → Weather DAG: schedules (evidence: `dags/etl_dags.py`)
- Weather DAG → Weather extraction: runs first (evidence: `dags/etl_dags.py`)
- Weather DAG → Weather loader: runs next (evidence: `dags/etl_dags.py`)
- Weather DAG → dbt runner: runs next (evidence: `dags/etl_dags.py`)
- Weather DAG → dbt tests: runs next (evidence: `dags/etl_dags.py`)
- Weather DAG → Data verification: runs last (evidence: `dags/etl_dags.py`)
- Weather extraction → PostgreSQL weather DB: reads latest date (evidence: `scripts/extract.py`)
- Weather extraction → Open-Meteo API: requests observations (evidence: `scripts/extract.py`)
- Weather extraction → Weather CSV: writes CSV (evidence: `scripts/extract.py`)
- Weather CSV → Weather loader: supplies rows (evidence: `README.md`)
- Weather loader → PostgreSQL weather DB: upserts rows (evidence: `scripts/load.py`)
- dbt runner → Weather staging: runs models (evidence: `README.md`)
- dbt runner → Daily temperature mart: runs models (evidence: `README.md`)
- Weather staging → Daily temperature mart: prepares data (evidence: `README.md`)
- PostgreSQL weather DB → Weather staging: stores model data (evidence: `README.md`)
- PostgreSQL weather DB → Daily temperature mart: stores model data (evidence: `README.md`)
- Weather DAG → dbt tests: tests after run (evidence: `dags/etl_dags.py`)
- dbt tests → PostgreSQL weather DB: tests models
- Data verification → PostgreSQL weather DB: queries tables (evidence: `scripts/check_data.py`)
- PostgreSQL weather DB → Metabase: serves analytics
