# hs3636/gridwatch-360 architecture

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

- Interactive diagram: https://gitdiagram.com/hs3636/gridwatch-360
- Repository: https://github.com/hs3636/gridwatch-360

## Overview

GridWatch 360 is a building-energy analytics platform: raw meter, weather, and building data is ingested into Bronze, cleansed and enriched in Silver, then modeled as Gold star-schema dimensions and fact tables for dashboards. Airflow triggers the three Databricks workflow jobs in sequence. The graph preserves quality-check branches and documented export/visualization capabilities. Some notebook-to-notebook job wiring and the export implementation are not shown; those relationships are included only where documented by the README.

Main entry points: [`gold/03_gold_dimensions.py`](https://github.com/hs3636/gridwatch-360/blob/main/gold/03_gold_dimensions.py) (Star dimensions), [`silver/02_silver_enriched.py`](https://github.com/hs3636/gridwatch-360/blob/main/silver/02_silver_enriched.py) (Reading enrichment), [`gold/03_gold_fact_daily_summary.py`](https://github.com/hs3636/gridwatch-360/blob/main/gold/03_gold_fact_daily_summary.py) (Daily summary fact), [`airflow/dags/dag_01_bronze_ingestion.py`](https://github.com/hs3636/gridwatch-360/blob/main/airflow/dags/dag_01_bronze_ingestion.py) (Bronze DAG)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Orchestration"]
  node_dag_bronze["Bronze DAG"]
  node_dag_silver["Silver DAG"]
  node_dag_gold["Gold DAG"]
end

subgraph group_bronze["Bronze ingestion"]
  node_bronze_ingest["Raw ingestion"]
  node_building_scd["Building SCD2"]
  node_bronze_quality["Bronze checks"]
end

subgraph group_silver["Silver transforms"]
  node_silver_readings["Reading cleanse"]
  node_silver_weather["Weather cleanse"]
  node_silver_enriched["Reading enrichment"]
  node_silver_quality["Silver checks"]
end

subgraph group_gold["Gold analytics"]
  node_gold_dimensions["Star dimensions"]
  node_gold_meter_fact["Meter fact"]
  node_gold_daily_fact["Daily summary fact"]
  node_gold_quality["Gold checks"]
  node_gold_export["Gold S3 export"]
end

subgraph group_serving["Storage and BI"]
  node_delta_catalog[("Delta tables")]
end

node_scheduler(("Airflow scheduler"))
node_dbx_jobs["Databricks jobs"]
node_dashboards["Databricks dashboards"]

node_scheduler -->|"schedules"| node_dag_bronze
node_dag_bronze -->|"triggers job"| node_dbx_jobs
node_dag_bronze -->|"triggers DAG"| node_dag_silver
node_dag_silver -->|"triggers job"| node_dbx_jobs
node_dag_silver -->|"triggers DAG"| node_dag_gold
node_dag_gold -->|"triggers job"| node_dbx_jobs
node_dbx_jobs -->|"runs stage"| node_bronze_ingest
node_dbx_jobs -->|"runs stage"| node_silver_readings
node_dbx_jobs -->|"runs stage"| node_gold_dimensions
node_bronze_ingest -->|"writes raw tables"| node_delta_catalog
node_building_scd -->|"merges history"| node_delta_catalog
node_bronze_quality -->|"logs checks"| node_delta_catalog
node_silver_readings -->|"reads and writes"| node_delta_catalog
node_silver_weather -->|"reads and writes"| node_delta_catalog
node_silver_enriched -->|"reads readings"| node_silver_readings
node_silver_enriched -->|"joins weather"| node_silver_weather
node_silver_enriched -->|"reads and writes"| node_delta_catalog
node_silver_quality -.->|"checks tables"| node_delta_catalog
node_gold_dimensions -->|"reads and writes"| node_delta_catalog
node_gold_meter_fact -.->|"uses dimensions"| node_gold_dimensions
node_gold_meter_fact -.->|"writes fact"| node_delta_catalog
node_gold_daily_fact -->|"aggregates fact"| node_gold_meter_fact
node_gold_daily_fact -->|"joins building"| node_gold_dimensions
node_gold_daily_fact -->|"writes summary"| node_delta_catalog
node_gold_quality -->|"checks and logs"| node_delta_catalog
node_gold_export -.->|"exports tables"| node_delta_catalog
node_dashboards -->|"reads Gold"| node_delta_catalog

click node_dag_bronze "https://github.com/hs3636/gridwatch-360/blob/main/airflow/dags/dag_01_bronze_ingestion.py"
click node_dag_silver "https://github.com/hs3636/gridwatch-360/blob/main/airflow/dags/dag_02_silver_transform.py"
click node_dag_gold "https://github.com/hs3636/gridwatch-360/blob/main/airflow/dags/dag_03_gold_load.py"
click node_bronze_ingest "https://github.com/hs3636/gridwatch-360/tree/main/bronze"
click node_building_scd "https://github.com/hs3636/gridwatch-360/blob/main/bronze/01_bronze_building_metadata.py"
click node_bronze_quality "https://github.com/hs3636/gridwatch-360/blob/main/bronze/01_bronze_quality_check.py"
click node_silver_readings "https://github.com/hs3636/gridwatch-360/blob/main/silver/02_silver_readings.py"
click node_silver_weather "https://github.com/hs3636/gridwatch-360/blob/main/silver/02_silver_weather.py"
click node_silver_enriched "https://github.com/hs3636/gridwatch-360/blob/main/silver/02_silver_enriched.py"
click node_silver_quality "https://github.com/hs3636/gridwatch-360/blob/main/silver/02_silver_quality_check.py"
click node_gold_dimensions "https://github.com/hs3636/gridwatch-360/blob/main/gold/03_gold_dimensions.py"
click node_gold_meter_fact "https://github.com/hs3636/gridwatch-360/blob/main/gold/03_gold_fact_meter_readings.py"
click node_gold_daily_fact "https://github.com/hs3636/gridwatch-360/blob/main/gold/03_gold_fact_daily_summary.py"
click node_gold_quality "https://github.com/hs3636/gridwatch-360/blob/main/gold/03_gold_quality_check.py"
click node_gold_export "https://github.com/hs3636/gridwatch-360/tree/main/gold"

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_bronze,node_dag_silver,node_dag_gold toneBlue
class node_bronze_ingest,node_building_scd,node_bronze_quality toneAmber
class node_silver_readings,node_silver_weather,node_silver_enriched,node_silver_quality toneMint
class node_gold_dimensions,node_gold_meter_fact,node_gold_daily_fact,node_gold_quality,node_gold_export,node_scheduler toneRose
class node_delta_catalog,node_dbx_jobs,node_dashboards toneIndigo
```

## Components

### Orchestration

- [Bronze DAG](https://github.com/hs3636/gridwatch-360/blob/main/airflow/dags/dag_01_bronze_ingestion.py): `airflow/dags/dag_01_bronze_ingestion.py`
- [Silver DAG](https://github.com/hs3636/gridwatch-360/blob/main/airflow/dags/dag_02_silver_transform.py): `airflow/dags/dag_02_silver_transform.py`
- [Gold DAG](https://github.com/hs3636/gridwatch-360/blob/main/airflow/dags/dag_03_gold_load.py): `airflow/dags/dag_03_gold_load.py`

### Bronze ingestion

- [Raw ingestion](https://github.com/hs3636/gridwatch-360/tree/main/bronze): `bronze`
- [Building SCD2](https://github.com/hs3636/gridwatch-360/blob/main/bronze/01_bronze_building_metadata.py): `bronze/01_bronze_building_metadata.py`
- [Bronze checks](https://github.com/hs3636/gridwatch-360/blob/main/bronze/01_bronze_quality_check.py): `bronze/01_bronze_quality_check.py`

### Silver transforms

- [Reading cleanse](https://github.com/hs3636/gridwatch-360/blob/main/silver/02_silver_readings.py): `silver/02_silver_readings.py`
- [Weather cleanse](https://github.com/hs3636/gridwatch-360/blob/main/silver/02_silver_weather.py): `silver/02_silver_weather.py`
- [Reading enrichment](https://github.com/hs3636/gridwatch-360/blob/main/silver/02_silver_enriched.py): `silver/02_silver_enriched.py`
- [Silver checks](https://github.com/hs3636/gridwatch-360/blob/main/silver/02_silver_quality_check.py): `silver/02_silver_quality_check.py`

### Gold analytics

- [Star dimensions](https://github.com/hs3636/gridwatch-360/blob/main/gold/03_gold_dimensions.py): `gold/03_gold_dimensions.py`
- [Meter fact](https://github.com/hs3636/gridwatch-360/blob/main/gold/03_gold_fact_meter_readings.py): `gold/03_gold_fact_meter_readings.py`
- [Daily summary fact](https://github.com/hs3636/gridwatch-360/blob/main/gold/03_gold_fact_daily_summary.py): `gold/03_gold_fact_daily_summary.py`
- [Gold checks](https://github.com/hs3636/gridwatch-360/blob/main/gold/03_gold_quality_check.py): `gold/03_gold_quality_check.py`
- [Gold S3 export](https://github.com/hs3636/gridwatch-360/tree/main/gold): `gold`

### Storage and BI

- **Delta tables**

### Other components

- **Airflow scheduler**
- **Databricks jobs**
- **Databricks dashboards**

## Connections

- Airflow scheduler → Bronze DAG: schedules (evidence: `airflow/dags/dag_01_bronze_ingestion.py`)
- Bronze DAG → Databricks jobs: triggers job (evidence: `airflow/dags/dag_01_bronze_ingestion.py`)
- Bronze DAG → Silver DAG: triggers DAG (evidence: `airflow/dags/dag_01_bronze_ingestion.py`)
- Silver DAG → Databricks jobs: triggers job (evidence: `airflow/dags/dag_02_silver_transform.py`)
- Silver DAG → Gold DAG: triggers DAG (evidence: `airflow/dags/dag_02_silver_transform.py`)
- Gold DAG → Databricks jobs: triggers job (evidence: `README.md`)
- Databricks jobs → Raw ingestion: runs stage (evidence: `README.md`)
- Databricks jobs → Reading cleanse: runs stage (evidence: `README.md`)
- Databricks jobs → Star dimensions: runs stage (evidence: `README.md`)
- Raw ingestion → Delta tables: writes raw tables (evidence: `README.md`)
- Building SCD2 → Delta tables: merges history (evidence: `bronze/01_bronze_building_metadata.py`)
- Bronze checks → Delta tables: logs checks (evidence: `bronze/01_bronze_quality_check.py`)
- Reading cleanse → Delta tables: reads and writes (evidence: `silver/02_silver_readings.py`)
- Weather cleanse → Delta tables: reads and writes (evidence: `silver/02_silver_weather.py`)
- Reading enrichment → Reading cleanse: reads readings (evidence: `silver/02_silver_enriched.py`)
- Reading enrichment → Weather cleanse: joins weather (evidence: `silver/02_silver_enriched.py`)
- Reading enrichment → Delta tables: reads and writes (evidence: `silver/02_silver_enriched.py`)
- Silver checks → Delta tables: checks tables (evidence: `README.md`)
- Star dimensions → Delta tables: reads and writes (evidence: `gold/03_gold_dimensions.py`)
- Meter fact → Star dimensions: uses dimensions (evidence: `README.md`)
- Meter fact → Delta tables: writes fact (evidence: `README.md`)
- Daily summary fact → Meter fact: aggregates fact (evidence: `gold/03_gold_fact_daily_summary.py`)
- Daily summary fact → Star dimensions: joins building (evidence: `gold/03_gold_fact_daily_summary.py`)
- Daily summary fact → Delta tables: writes summary (evidence: `gold/03_gold_fact_daily_summary.py`)
- Gold checks → Delta tables: checks and logs (evidence: `gold/03_gold_quality_check.py`)
- Gold S3 export → Delta tables: exports tables (evidence: `README.md`)
- Databricks dashboards → Delta tables: reads Gold (evidence: `README.md`)
