# aznrz/etl_airflow_project architecture

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

- Interactive diagram: https://gitdiagram.com/aznrz/etl_airflow_project
- Repository: https://github.com/aznrz/etl_airflow_project

## Overview

This is an Airflow-orchestrated ETL pipeline that loads Superstore sales from CSV and reference data from Excel into PostgreSQL, validates raw data, builds staging tables and a star-schema mart, and serves the mart to Power BI. The README documents the main task dependencies; the DAG excerpt shows Python task implementations and SQL-task registration. Some SQL internals and task wiring were not sampled, so edges follow documented relationships rather than inferred SQL calls.

Main entry points: [`dags/sql/staging`](https://github.com/aznrz/etl_airflow_project/tree/master/dags/sql/staging) (Staging tables), [`dags/sql/mart/fact_sales.sql`](https://github.com/aznrz/etl_airflow_project/blob/master/dags/sql/mart/fact_sales.sql) (Sales fact), [`output`](https://github.com/aznrz/etl_airflow_project/tree/master/output) (Staging CSV files), [`dags/superstore_raw_dag.py`](https://github.com/aznrz/etl_airflow_project/blob/master/dags/superstore_raw_dag.py) (Read CSV)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Source ingestion"]
  node_airflow_dag["Airflow DAG"]
  node_csv_read["Read CSV"]
  node_csv_transform["Transform CSV"]
  node_excel_read["Read Excel"]
  node_excel_transform["Transform Excel"]
  node_stage_files["Staging CSV files"]
  node_raw_load["Load raw tables"]
end

subgraph group_quality["Quality controls"]
  node_raw_store[("PostgreSQL raw")]
  node_dq_checks["Data quality checks<br/>[dq_checks.sql]"]
end

subgraph group_warehouse["Warehouse modeling"]
  node_staging[("Staging tables")]
  node_dim_customer["Customer dimension<br/>[dim_customer.sql]"]
  node_dim_product["Product dimension<br/>[dim_product.sql]"]
  node_dim_date["Date dimension<br/>[dim_date.sql]"]
  node_dim_location["Location dimension<br/>[dim_location.sql]"]
  node_fact_sales[("Sales fact<br/>[fact_sales.sql]")]
end

subgraph group_consumption["Reporting"]
  node_power_bi(("Power BI"))
end

node_csv_source["Superstore CSV"]
node_excel_source["Reference Excel"]

node_csv_source -->|"reads"| node_csv_read
node_csv_read -->|"passes rows"| node_csv_transform
node_csv_transform -->|"writes CSV"| node_stage_files
node_stage_files -->|"loads from"| node_raw_load
node_excel_source -->|"reads"| node_excel_read
node_excel_read -->|"passes rows"| node_excel_transform
node_excel_transform -->|"writes CSV"| node_stage_files
node_raw_load -->|"writes tables"| node_raw_store
node_raw_store -->|"checks data"| node_dq_checks
node_dq_checks -->|"gates build"| node_staging
node_staging -->|"builds from"| node_dim_customer
node_staging -->|"builds from"| node_dim_product
node_staging -->|"builds from"| node_dim_date
node_staging -->|"builds from"| node_dim_location
node_staging -->|"builds from"| node_fact_sales
node_dim_customer -->|"joins dimension"| node_fact_sales
node_dim_product -->|"joins dimension"| node_fact_sales
node_dim_date -->|"joins dates"| node_fact_sales
node_dim_location -->|"joins dimension"| node_fact_sales
node_fact_sales -->|"reports from"| node_power_bi

click node_airflow_dag "https://github.com/aznrz/etl_airflow_project/blob/master/dags/superstore_raw_dag.py"
click node_csv_read "https://github.com/aznrz/etl_airflow_project/blob/master/dags/superstore_raw_dag.py"
click node_csv_transform "https://github.com/aznrz/etl_airflow_project/blob/master/dags/superstore_raw_dag.py"
click node_excel_read "https://github.com/aznrz/etl_airflow_project/blob/master/dags/superstore_raw_dag.py"
click node_excel_transform "https://github.com/aznrz/etl_airflow_project/blob/master/dags/superstore_raw_dag.py"
click node_stage_files "https://github.com/aznrz/etl_airflow_project/tree/master/output"
click node_raw_load "https://github.com/aznrz/etl_airflow_project/blob/master/dags/superstore_raw_dag.py"
click node_dq_checks "https://github.com/aznrz/etl_airflow_project/blob/master/dags/sql/dq_checks.sql"
click node_staging "https://github.com/aznrz/etl_airflow_project/tree/master/dags/sql/staging"
click node_dim_customer "https://github.com/aznrz/etl_airflow_project/blob/master/dags/sql/mart/dim_customer.sql"
click node_dim_product "https://github.com/aznrz/etl_airflow_project/blob/master/dags/sql/mart/dim_product.sql"
click node_dim_date "https://github.com/aznrz/etl_airflow_project/blob/master/dags/sql/mart/dim_date.sql"
click node_dim_location "https://github.com/aznrz/etl_airflow_project/blob/master/dags/sql/mart/dim_location.sql"
click node_fact_sales "https://github.com/aznrz/etl_airflow_project/blob/master/dags/sql/mart/fact_sales.sql"

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_airflow_dag,node_csv_read,node_csv_transform,node_excel_read,node_excel_transform,node_stage_files,node_raw_load toneBlue
class node_raw_store,node_dq_checks toneAmber
class node_staging,node_dim_customer,node_dim_product,node_dim_date,node_dim_location,node_fact_sales toneMint
class node_power_bi toneRose
class node_csv_source,node_excel_source toneIndigo
```

## Components

### Source ingestion

- [Airflow DAG](https://github.com/aznrz/etl_airflow_project/blob/master/dags/superstore_raw_dag.py): `dags/superstore_raw_dag.py`
- [Read CSV](https://github.com/aznrz/etl_airflow_project/blob/master/dags/superstore_raw_dag.py): `dags/superstore_raw_dag.py`
- [Transform CSV](https://github.com/aznrz/etl_airflow_project/blob/master/dags/superstore_raw_dag.py): `dags/superstore_raw_dag.py`
- [Read Excel](https://github.com/aznrz/etl_airflow_project/blob/master/dags/superstore_raw_dag.py): `dags/superstore_raw_dag.py`
- [Transform Excel](https://github.com/aznrz/etl_airflow_project/blob/master/dags/superstore_raw_dag.py): `dags/superstore_raw_dag.py`
- [Staging CSV files](https://github.com/aznrz/etl_airflow_project/tree/master/output): `output`
- [Load raw tables](https://github.com/aznrz/etl_airflow_project/blob/master/dags/superstore_raw_dag.py): `dags/superstore_raw_dag.py`

### Quality controls

- **PostgreSQL raw**
- [Data quality checks](https://github.com/aznrz/etl_airflow_project/blob/master/dags/sql/dq_checks.sql): `dags/sql/dq_checks.sql`

### Warehouse modeling

- [Staging tables](https://github.com/aznrz/etl_airflow_project/tree/master/dags/sql/staging): `dags/sql/staging`
- [Customer dimension](https://github.com/aznrz/etl_airflow_project/blob/master/dags/sql/mart/dim_customer.sql): `dags/sql/mart/dim_customer.sql`
- [Product dimension](https://github.com/aznrz/etl_airflow_project/blob/master/dags/sql/mart/dim_product.sql): `dags/sql/mart/dim_product.sql`
- [Date dimension](https://github.com/aznrz/etl_airflow_project/blob/master/dags/sql/mart/dim_date.sql): `dags/sql/mart/dim_date.sql`
- [Location dimension](https://github.com/aznrz/etl_airflow_project/blob/master/dags/sql/mart/dim_location.sql): `dags/sql/mart/dim_location.sql`
- [Sales fact](https://github.com/aznrz/etl_airflow_project/blob/master/dags/sql/mart/fact_sales.sql): `dags/sql/mart/fact_sales.sql`

### Reporting

- **Power BI**

### Other components

- **Superstore CSV**
- **Reference Excel**

## Connections

- Superstore CSV → Read CSV: reads (evidence: `README.md`)
- Read CSV → Transform CSV: passes rows (evidence: `README.md`)
- Transform CSV → Staging CSV files: writes CSV (evidence: `dags/superstore_raw_dag.py`)
- Staging CSV files → Load raw tables: loads from (evidence: `dags/superstore_raw_dag.py`)
- Reference Excel → Read Excel: reads (evidence: `README.md`)
- Read Excel → Transform Excel: passes rows (evidence: `README.md`)
- Transform Excel → Staging CSV files: writes CSV (evidence: `dags/superstore_raw_dag.py`)
- Load raw tables → PostgreSQL raw: writes tables (evidence: `dags/superstore_raw_dag.py`)
- PostgreSQL raw → Data quality checks: checks data (evidence: `README.md`)
- Data quality checks → Staging tables: gates build (evidence: `README.md`)
- Staging tables → Customer dimension: builds from (evidence: `README.md`)
- Staging tables → Product dimension: builds from (evidence: `README.md`)
- Staging tables → Date dimension: builds from (evidence: `README.md`)
- Staging tables → Location dimension: builds from (evidence: `README.md`)
- Staging tables → Sales fact: builds from (evidence: `README.md`)
- Customer dimension → Sales fact: joins dimension (evidence: `README.md`)
- Product dimension → Sales fact: joins dimension (evidence: `README.md`)
- Date dimension → Sales fact: joins dates (evidence: `README.md`)
- Location dimension → Sales fact: joins dimension (evidence: `README.md`)
- Sales fact → Power BI: reports from (evidence: `README.md`)
