# omarjebbari/reddit-airflow-etl-pipeline architecture

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

- Interactive diagram: https://gitdiagram.com/omarjebbari/reddit-airflow-etl-pipeline
- Repository: https://github.com/omarjebbari/reddit-airflow-etl-pipeline

## Overview

This repository is a Reddit ingestion and analytics pipeline: an Airflow DAG schedules extraction, validation, dbt modeling, and a PostgreSQL load. The pipeline extracts paginated Reddit data, normalizes it, and writes CSV and MinIO Bronze outputs; documented dbt models provide Silver/Gold analytics, with Trino and Metabase as consumption capabilities. The excerpts show the PostgreSQL loader reading the latest Bronze parquet, despite the README describing a Gold load. dbt, Trino, and Metabase implementation details were not sampled, so those links rely on README documentation.

Main entry points: [`dags/reddit_dag.py`](https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/dags/reddit_dag.py) (Reddit DAG), [`pipelines/reddit_pipeline.py`](https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/pipelines/reddit_pipeline.py) (Pipeline coordinator), [`etls/reddit_etl.py`](https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/etls/reddit_etl.py) (Postgres loader), [`etls/quality_checks.py`](https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/etls/quality_checks.py) (Data quality checks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Orchestration"]
  node_scheduler["Airflow schedule<br/>[reddit_dag.py]"]
  node_dag["Reddit DAG<br/>[reddit_dag.py]"]
end

subgraph group_ingestion["Ingestion"]
  node_pipeline["Pipeline coordinator<br/>[reddit_pipeline.py]"]
  node_extract["Paginated extraction<br/>[reddit_etl.py]"]
  node_transform["Data normalization<br/>[reddit_etl.py]"]
  node_csv["CSV snapshots"]
  node_bronze[("MinIO Bronze")]
end

subgraph group_quality["Quality"]
  node_validation["Data quality checks<br/>[quality_checks.py]"]
end

subgraph group_analytics["Analytics"]
  node_silver["Silver models"]
  node_cleaned["Cleaned Silver model"]
  node_gold["Gold author model<br/>[top_authors.sql]"]
end

subgraph group_serving["Serving"]
  node_postgres[("PostgreSQL serving")]
  node_postgres_loader["Postgres loader<br/>[reddit_etl.py]"]
  node_trino["Trino SQL<br/>[hive.properties]"]
  node_metabase["Metabase BI"]
end

node_reddit(("Reddit endpoint"))

node_scheduler -->|"schedules"| node_dag
node_dag -->|"runs extraction"| node_pipeline
node_pipeline -->|"calls"| node_extract
node_extract -->|"fetches pages"| node_reddit
node_pipeline -->|"normalizes"| node_transform
node_pipeline -->|"writes CSV"| node_csv
node_pipeline -->|"writes parquet"| node_bronze
node_dag -->|"runs validation"| node_validation
node_validation -->|"reads snapshot"| node_csv
node_dag -->|"runs dbt"| node_silver
node_silver -.->|"models data"| node_cleaned
node_cleaned -.->|"models data"| node_gold
node_dag -->|"runs load task"| node_postgres_loader
node_postgres_loader -->|"reads parquet"| node_bronze
node_postgres_loader -->|"writes table"| node_postgres
node_gold -.->|"serves queries"| node_trino
node_trino -.->|"supports dashboards"| node_metabase
node_postgres -.->|"feeds dashboards"| node_metabase

click node_scheduler "https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/dags/reddit_dag.py"
click node_dag "https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/dags/reddit_dag.py"
click node_pipeline "https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/pipelines/reddit_pipeline.py"
click node_extract "https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/etls/reddit_etl.py"
click node_transform "https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/etls/reddit_etl.py"
click node_validation "https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/etls/quality_checks.py"
click node_silver "https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/dbt/models/silver/bronze_reddit_posts.sql"
click node_cleaned "https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/dbt/models/silver/silver_reddit_cleaned.sql"
click node_gold "https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/dbt/models/gold/top_authors.sql"
click node_postgres_loader "https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/etls/reddit_etl.py"
click node_trino "https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/trino/etc/catalog/hive.properties"

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_scheduler,node_dag toneBlue
class node_pipeline,node_extract,node_transform,node_csv,node_bronze toneAmber
class node_validation toneMint
class node_silver,node_cleaned,node_gold toneRose
class node_postgres,node_postgres_loader,node_trino,node_metabase,node_reddit toneIndigo
```

## Components

### Orchestration

- [Airflow schedule](https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/dags/reddit_dag.py): `dags/reddit_dag.py`
- [Reddit DAG](https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/dags/reddit_dag.py): `dags/reddit_dag.py`

### Ingestion

- [Pipeline coordinator](https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/pipelines/reddit_pipeline.py): `pipelines/reddit_pipeline.py`
- [Paginated extraction](https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/etls/reddit_etl.py): `etls/reddit_etl.py`
- [Data normalization](https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/etls/reddit_etl.py): `etls/reddit_etl.py`
- **CSV snapshots**
- **MinIO Bronze**

### Quality

- [Data quality checks](https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/etls/quality_checks.py): `etls/quality_checks.py`

### Analytics

- [Silver models](https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/dbt/models/silver/bronze_reddit_posts.sql): `dbt/models/silver/bronze_reddit_posts.sql`
- [Cleaned Silver model](https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/dbt/models/silver/silver_reddit_cleaned.sql): `dbt/models/silver/silver_reddit_cleaned.sql`
- [Gold author model](https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/dbt/models/gold/top_authors.sql): `dbt/models/gold/top_authors.sql`

### Serving

- **PostgreSQL serving**
- [Postgres loader](https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/etls/reddit_etl.py): `etls/reddit_etl.py`
- [Trino SQL](https://github.com/omarjebbari/reddit-airflow-etl-pipeline/blob/main/trino/etc/catalog/hive.properties): `trino/etc/catalog/hive.properties`
- **Metabase BI**

### Other components

- **Reddit endpoint**

## Connections

- Airflow schedule → Reddit DAG: schedules (evidence: `dags/reddit_dag.py`)
- Reddit DAG → Pipeline coordinator: runs extraction (evidence: `dags/reddit_dag.py`)
- Pipeline coordinator → Paginated extraction: calls (evidence: `pipelines/reddit_pipeline.py`)
- Paginated extraction → Reddit endpoint: fetches pages (evidence: `etls/reddit_etl.py`)
- Pipeline coordinator → Data normalization: normalizes (evidence: `pipelines/reddit_pipeline.py`)
- Pipeline coordinator → CSV snapshots: writes CSV (evidence: `pipelines/reddit_pipeline.py`)
- Pipeline coordinator → MinIO Bronze: writes parquet (evidence: `pipelines/reddit_pipeline.py`)
- Reddit DAG → Data quality checks: runs validation (evidence: `dags/reddit_dag.py`)
- Data quality checks → CSV snapshots: reads snapshot (evidence: `etls/quality_checks.py`)
- Reddit DAG → Silver models: runs dbt (evidence: `README.md`)
- Silver models → Cleaned Silver model: models data (evidence: `README.md`)
- Cleaned Silver model → Gold author model: models data (evidence: `README.md`)
- Reddit DAG → Postgres loader: runs load task (evidence: `dags/reddit_dag.py`)
- Postgres loader → MinIO Bronze: reads parquet (evidence: `etls/reddit_etl.py`)
- Postgres loader → PostgreSQL serving: writes table (evidence: `etls/reddit_etl.py`)
- Gold author model → Trino SQL: serves queries (evidence: `README.md`)
- Trino SQL → Metabase BI: supports dashboards (evidence: `README.md`)
- PostgreSQL serving → Metabase BI: feeds dashboards (evidence: `README.md`)
