# mamadgabut/project-bigdata architecture

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

- Interactive diagram: https://gitdiagram.com/mamadgabut/project-bigdata
- Repository: https://github.com/mamadgabut/project-bigdata

## Overview

VOI News Lakehouse scrapes VOI.id articles, validates and stores raw records in Bronze, cleans Bronze records into Silver, then builds Gold dimensions, facts, and analytics views. Airflow schedules these as three DAGs; PostgreSQL is the shared lakehouse. The README documents the layer transitions and outputs, while the shown DAG and task code supports the task ownership and sequencing. Source excerpts are partial, so details of unsampled implementations are represented only at the subsystem level.

Main entry points: [`dags/script/db_connection.py`](https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/db_connection.py) (Database connection), [`dags/dag3_Warehouse.py`](https://github.com/mamadgabut/project-bigdata/blob/main/dags/dag3_Warehouse.py) (Gold DAG), [`db/init_lakehouse.sql`](https://github.com/mamadgabut/project-bigdata/blob/main/db/init_lakehouse.sql) (PostgreSQL lakehouse), [`dags/dag1_Collecting.py`](https://github.com/mamadgabut/project-bigdata/blob/main/dags/dag1_Collecting.py) (Bronze DAG)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Airflow orchestration"]
  node_scheduler(("Airflow scheduler"))
  node_bronze_dag["Bronze DAG<br/>[dag1_Collecting.py]"]
  node_silver_dag["Silver DAG<br/>[dag2_Processing.py]"]
  node_gold_dag["Gold DAG<br/>[dag3_Warehouse.py]"]
end

subgraph group_collection["News collection"]
  node_scraper["Article scraper<br/>[main.py]"]
  node_raw_validation["Raw validation<br/>[validate_raw.py]"]
end

subgraph group_medallion["Medallion processing"]
  node_bronze_writer["Bronze ingestion<br/>[save_raw.py]"]
  node_silver_transform["Silver transform<br/>[preprocessing.py]"]
  node_lakehouse[("PostgreSQL lakehouse<br/>[init_lakehouse.sql]")]
  node_db_connection["Database connection<br/>[db_connection.py]"]
end

subgraph group_analytics["Gold analytics"]
  node_gold_validation["Silver source validation<br/>[gold_warehouse.py]"]
  node_gold_schema["Gold schema setup<br/>[gold_warehouse.py]"]
  node_gold_dimensions["Dimension loads<br/>[gold_warehouse.py]"]
  node_gold_fact["Fact load<br/>[gold_warehouse.py]"]
  node_gold_checks["Gold validation<br/>[gold_warehouse.py]"]
  node_gold_views["Analytics views<br/>[gold_warehouse.py]"]
end

node_voi(("VOI.id"))

node_scheduler -->|"schedules"| node_bronze_dag
node_scheduler -->|"schedules"| node_silver_dag
node_scheduler -->|"schedules"| node_gold_dag
node_bronze_dag -->|"runs"| node_scraper
node_bronze_dag -->|"runs next"| node_raw_validation
node_bronze_dag -->|"runs next"| node_bronze_writer
node_scraper -->|"requests pages"| node_voi
node_scraper -->|"checks existing URLs"| node_db_connection
node_raw_validation -->|"checks stored URLs"| node_db_connection
node_bronze_writer -->|"opens connection"| node_db_connection
node_bronze_writer -->|"writes Bronze"| node_lakehouse
node_silver_dag -->|"runs"| node_silver_transform
node_silver_transform -->|"opens connection"| node_db_connection
node_silver_transform -->|"reads Bronze; writes Silver"| node_lakehouse
node_gold_dag -->|"runs first"| node_gold_validation
node_gold_dag -->|"runs next"| node_gold_schema
node_gold_dag -->|"runs dimension loads"| node_gold_dimensions
node_gold_dag -->|"runs after dimensions"| node_gold_fact
node_gold_dag -->|"runs next"| node_gold_checks
node_gold_dag -->|"runs last"| node_gold_views
node_gold_validation -->|"checks Silver"| node_lakehouse
node_gold_schema -->|"uses connection"| node_db_connection
node_gold_dimensions -->|"uses connection"| node_db_connection
node_gold_fact -->|"uses connection"| node_db_connection
node_gold_checks -->|"uses connection"| node_db_connection
node_gold_views -->|"uses connection"| node_db_connection
node_gold_dimensions -->|"writes dimensions"| node_lakehouse
node_gold_fact -->|"reads Silver; writes facts"| node_lakehouse
node_gold_views -->|"creates analytics views"| node_lakehouse

click node_bronze_dag "https://github.com/mamadgabut/project-bigdata/blob/main/dags/dag1_Collecting.py"
click node_silver_dag "https://github.com/mamadgabut/project-bigdata/blob/main/dags/dag2_Processing.py"
click node_gold_dag "https://github.com/mamadgabut/project-bigdata/blob/main/dags/dag3_Warehouse.py"
click node_scraper "https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/main.py"
click node_raw_validation "https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/validate_raw.py"
click node_bronze_writer "https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/save_raw.py"
click node_silver_transform "https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/preprocessing.py"
click node_gold_validation "https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/gold_warehouse.py"
click node_gold_schema "https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/gold_warehouse.py"
click node_gold_dimensions "https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/gold_warehouse.py"
click node_gold_fact "https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/gold_warehouse.py"
click node_gold_checks "https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/gold_warehouse.py"
click node_gold_views "https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/gold_warehouse.py"
click node_lakehouse "https://github.com/mamadgabut/project-bigdata/blob/main/db/init_lakehouse.sql"
click node_db_connection "https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/db_connection.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_scheduler,node_bronze_dag,node_silver_dag,node_gold_dag toneBlue
class node_scraper,node_raw_validation toneAmber
class node_bronze_writer,node_silver_transform,node_lakehouse,node_db_connection toneMint
class node_gold_validation,node_gold_schema,node_gold_dimensions,node_gold_fact,node_gold_checks,node_gold_views toneRose
class node_voi toneIndigo
```

## Components

### Airflow orchestration

- **Airflow scheduler**
- [Bronze DAG](https://github.com/mamadgabut/project-bigdata/blob/main/dags/dag1_Collecting.py): `dags/dag1_Collecting.py`
- [Silver DAG](https://github.com/mamadgabut/project-bigdata/blob/main/dags/dag2_Processing.py): `dags/dag2_Processing.py`
- [Gold DAG](https://github.com/mamadgabut/project-bigdata/blob/main/dags/dag3_Warehouse.py): `dags/dag3_Warehouse.py`

### News collection

- [Article scraper](https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/main.py): `dags/script/main.py`
- [Raw validation](https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/validate_raw.py): `dags/script/validate_raw.py`

### Medallion processing

- [Bronze ingestion](https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/save_raw.py): `dags/script/save_raw.py`
- [Silver transform](https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/preprocessing.py): `dags/script/preprocessing.py`
- [PostgreSQL lakehouse](https://github.com/mamadgabut/project-bigdata/blob/main/db/init_lakehouse.sql): `db/init_lakehouse.sql`
- [Database connection](https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/db_connection.py): `dags/script/db_connection.py`

### Gold analytics

- [Silver source validation](https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/gold_warehouse.py): `dags/script/gold_warehouse.py`
- [Gold schema setup](https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/gold_warehouse.py): `dags/script/gold_warehouse.py`
- [Dimension loads](https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/gold_warehouse.py): `dags/script/gold_warehouse.py`
- [Fact load](https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/gold_warehouse.py): `dags/script/gold_warehouse.py`
- [Gold validation](https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/gold_warehouse.py): `dags/script/gold_warehouse.py`
- [Analytics views](https://github.com/mamadgabut/project-bigdata/blob/main/dags/script/gold_warehouse.py): `dags/script/gold_warehouse.py`

### Other components

- **VOI.id**

## Connections

- Airflow scheduler → Bronze DAG: schedules (evidence: `README.md`)
- Airflow scheduler → Silver DAG: schedules (evidence: `README.md`)
- Airflow scheduler → Gold DAG: schedules (evidence: `README.md`)
- Bronze DAG → Article scraper: runs (evidence: `dags/dag1_Collecting.py`)
- Bronze DAG → Raw validation: runs next (evidence: `dags/dag1_Collecting.py`)
- Bronze DAG → Bronze ingestion: runs next (evidence: `dags/dag1_Collecting.py`)
- Article scraper → VOI.id: requests pages (evidence: `dags/script/main.py`)
- Article scraper → Database connection: checks existing URLs (evidence: `dags/script/main.py`)
- Raw validation → Database connection: checks stored URLs (evidence: `dags/script/validate_raw.py`)
- Bronze ingestion → Database connection: opens connection (evidence: `dags/script/save_raw.py`)
- Bronze ingestion → PostgreSQL lakehouse: writes Bronze (evidence: `README.md`)
- Silver DAG → Silver transform: runs (evidence: `dags/dag2_Processing.py`)
- Silver transform → Database connection: opens connection (evidence: `dags/script/preprocessing.py`)
- Silver transform → PostgreSQL lakehouse: reads Bronze; writes Silver (evidence: `README.md`)
- Gold DAG → Silver source validation: runs first (evidence: `dags/dag3_Warehouse.py`)
- Gold DAG → Gold schema setup: runs next (evidence: `dags/dag3_Warehouse.py`)
- Gold DAG → Dimension loads: runs dimension loads (evidence: `dags/dag3_Warehouse.py`)
- Gold DAG → Fact load: runs after dimensions (evidence: `dags/dag3_Warehouse.py`)
- Gold DAG → Gold validation: runs next (evidence: `dags/dag3_Warehouse.py`)
- Gold DAG → Analytics views: runs last (evidence: `dags/dag3_Warehouse.py`)
- Silver source validation → PostgreSQL lakehouse: checks Silver (evidence: `README.md`)
- Gold schema setup → Database connection: uses connection (evidence: `dags/script/gold_warehouse.py`)
- Dimension loads → Database connection: uses connection (evidence: `dags/script/gold_warehouse.py`)
- Fact load → Database connection: uses connection (evidence: `dags/script/gold_warehouse.py`)
- Gold validation → Database connection: uses connection (evidence: `dags/script/gold_warehouse.py`)
- Analytics views → Database connection: uses connection (evidence: `dags/script/gold_warehouse.py`)
- Dimension loads → PostgreSQL lakehouse: writes dimensions (evidence: `README.md`)
- Fact load → PostgreSQL lakehouse: reads Silver; writes facts (evidence: `README.md`)
- Analytics views → PostgreSQL lakehouse: creates analytics views (evidence: `dags/script/gold_warehouse.py`)
