# zmacken/lab_data_warehouse_group_3 architecture

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

- Interactive diagram: https://gitdiagram.com/zmacken/lab_data_warehouse_group_3
- Repository: https://github.com/zmacken/lab_data_warehouse_group_3

## Overview

Flight Punctuality Analytics is a Swedish-airport delay analytics stack. Its workflow gathers Swedavia flight records and Wikipedia reference data, loads both into Snowflake RAW, transforms them with dbt into source-cleaned models, a dimensional fact model and a MARTS view, then presents interactive analysis in Streamlit. Dagster runs the loaders and launches dbt after flight ingestion; the README also documents a daily flight schedule. Dashboard capabilities include delay KPIs, filters, data inspection, time trends and airport/route comparisons. Model-level links follow README descriptions; unsampled dbt internals are represented by their exact model directories.

Main entry points: [`orchestration/definitions.py`](https://github.com/zmacken/lab_data_warehouse_group_3/blob/main/orchestration/definitions.py) (Dagster definitions), [`dbt/dbt_flights/models`](https://github.com/zmacken/lab_data_warehouse_group_3/tree/main/dbt/dbt_flights/models) (Dimensions and fact), [`data_extract_load/load_wikipedia_csv.py`](https://github.com/zmacken/lab_data_warehouse_group_3/blob/main/data_extract_load/load_wikipedia_csv.py) (CSV reference loader), [`data_extract_load/load_api.py`](https://github.com/zmacken/lab_data_warehouse_group_3/blob/main/data_extract_load/load_api.py) (Flight API loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Data ingestion"]
  node_scraper["Reference scraper"]
  node_wiki_loader["CSV reference loader"]
  node_flight_loader["Flight API loader<br/>[load_api.py]"]
end

subgraph group_coordination["Orchestration"]
  node_orchestrator["Dagster definitions<br/>[definitions.py]"]
end

subgraph group_warehouse["Warehouse transforms"]
  node_raw[("Snowflake RAW")]
  node_sources["Cleaned source models"]
  node_star_model["Dimensions and fact"]
  node_mart[("Flight delays mart")]
end

subgraph group_presentation["Analytics dashboard"]
  node_dashboard["Delay analytics<br/>[app.py]"]
end

node_analyst(("Dashboard user"))
node_swedavia(("Swedavia API"))
node_wikipedia(("Wikipedia"))

node_wikipedia -->|"provides tables"| node_scraper
node_scraper -->|"writes CSVs"| node_wiki_loader
node_swedavia -->|"serves flight data"| node_flight_loader
node_orchestrator -->|"runs loader"| node_flight_loader
node_orchestrator -->|"runs loader"| node_wiki_loader
node_flight_loader -->|"loads flights"| node_raw
node_wiki_loader -->|"loads reference data"| node_raw
node_orchestrator -->|"builds dbt models"| node_star_model
node_orchestrator -->|"triggers after flights"| node_star_model
node_raw -->|"read and clean"| node_sources
node_sources -->|"build dimensions and fact"| node_star_model
node_star_model -->|"feeds mart"| node_mart
node_mart -->|"queried by dashboard"| node_dashboard
node_analyst -->|"filters and explores"| node_dashboard

click node_scraper "https://github.com/zmacken/lab_data_warehouse_group_3/blob/main/scraping/scrape_wikipedia.py"
click node_wiki_loader "https://github.com/zmacken/lab_data_warehouse_group_3/blob/main/data_extract_load/load_wikipedia_csv.py"
click node_flight_loader "https://github.com/zmacken/lab_data_warehouse_group_3/blob/main/data_extract_load/load_api.py"
click node_orchestrator "https://github.com/zmacken/lab_data_warehouse_group_3/blob/main/orchestration/definitions.py"
click node_sources "https://github.com/zmacken/lab_data_warehouse_group_3/tree/main/dbt/dbt_flights/models/src"
click node_star_model "https://github.com/zmacken/lab_data_warehouse_group_3/tree/main/dbt/dbt_flights/models"
click node_mart "https://github.com/zmacken/lab_data_warehouse_group_3/blob/main/dbt/dbt_flights/models/marts/mart_flight_delays.sql"
click node_dashboard "https://github.com/zmacken/lab_data_warehouse_group_3/blob/main/dashboard/app.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_scraper,node_wiki_loader,node_flight_loader,node_analyst toneBlue
class node_orchestrator toneAmber
class node_raw,node_sources,node_star_model,node_mart,node_swedavia toneMint
class node_dashboard toneRose
class node_wikipedia toneIndigo
```

## Components

### Data ingestion

- [Reference scraper](https://github.com/zmacken/lab_data_warehouse_group_3/blob/main/scraping/scrape_wikipedia.py): `scraping/scrape_wikipedia.py`
- [CSV reference loader](https://github.com/zmacken/lab_data_warehouse_group_3/blob/main/data_extract_load/load_wikipedia_csv.py): `data_extract_load/load_wikipedia_csv.py`
- [Flight API loader](https://github.com/zmacken/lab_data_warehouse_group_3/blob/main/data_extract_load/load_api.py): `data_extract_load/load_api.py`

### Orchestration

- [Dagster definitions](https://github.com/zmacken/lab_data_warehouse_group_3/blob/main/orchestration/definitions.py): `orchestration/definitions.py`

### Warehouse transforms

- **Snowflake RAW**
- [Cleaned source models](https://github.com/zmacken/lab_data_warehouse_group_3/tree/main/dbt/dbt_flights/models/src): `dbt/dbt_flights/models/src`
- [Dimensions and fact](https://github.com/zmacken/lab_data_warehouse_group_3/tree/main/dbt/dbt_flights/models): `dbt/dbt_flights/models`
- [Flight delays mart](https://github.com/zmacken/lab_data_warehouse_group_3/blob/main/dbt/dbt_flights/models/marts/mart_flight_delays.sql): `dbt/dbt_flights/models/marts/mart_flight_delays.sql`

### Analytics dashboard

- [Delay analytics](https://github.com/zmacken/lab_data_warehouse_group_3/blob/main/dashboard/app.py): `dashboard/app.py`

### Other components

- **Dashboard user**
- **Swedavia API**
- **Wikipedia**

## Connections

- Wikipedia → Reference scraper: provides tables (evidence: `README.md`)
- Reference scraper → CSV reference loader: writes CSVs (evidence: `README.md`)
- Swedavia API → Flight API loader: serves flight data (evidence: `README.md`)
- Dagster definitions → Flight API loader: runs loader (evidence: `orchestration/definitions.py`)
- Dagster definitions → CSV reference loader: runs loader (evidence: `orchestration/definitions.py`)
- Flight API loader → Snowflake RAW: loads flights (evidence: `README.md`)
- CSV reference loader → Snowflake RAW: loads reference data (evidence: `README.md`)
- Dagster definitions → Dimensions and fact: builds dbt models (evidence: `orchestration/definitions.py`)
- Dagster definitions → Dimensions and fact: triggers after flights (evidence: `orchestration/definitions.py`)
- Snowflake RAW → Cleaned source models: read and clean (evidence: `README.md`)
- Cleaned source models → Dimensions and fact: build dimensions and fact (evidence: `README.md`)
- Dimensions and fact → Flight delays mart: feeds mart (evidence: `README.md`)
- Flight delays mart → Delay analytics: queried by dashboard (evidence: `dashboard/app.py`)
- Dashboard user → Delay analytics: filters and explores (evidence: `dashboard/app.py`)
