# aizen2510/datta_cuoiki architecture

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

- Interactive diagram: https://gitdiagram.com/aizen2510/datta_cuoiki
- Repository: https://github.com/aizen2510/datta_cuoiki

## Overview

This is a MovieLens + TMDB data-engineering pipeline: raw MovieLens files and fetched TMDB metadata are staged locally, uploaded to MinIO, then Airflow orchestrates extraction, star-schema transformation, PostgreSQL loading, and warehouse quality checks. The resulting warehouse supports BI and recommendation/ML consumption, with sample SQL queries documented. Transform, load and validation responsibilities are visible in the excerpts; the README describes the warehouse schema and analytics use. Some ETL internals and the later README text were not sampled, so edges are limited to explicit evidence.

Main entry points: [`dags/movielens_etl_dag.py`](https://github.com/aizen2510/datta_cuoiki/blob/main/dags/movielens_etl_dag.py) (ETL DAG), [`staging`](https://github.com/aizen2510/datta_cuoiki/tree/main/staging) (Pickle staging data), [`fetch_raw_data.py`](https://github.com/aizen2510/datta_cuoiki/blob/main/fetch_raw_data.py) (TMDB metadata fetch), [`ingest_to_minio.py`](https://github.com/aizen2510/datta_cuoiki/blob/main/ingest_to_minio.py) (MinIO ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sources["Source collection"]
  node_movielens["MovieLens files"]
  node_tmdb_fetch["TMDB metadata fetch<br/>[fetch_raw_data.py]"]
end

subgraph group_lake["Raw data lake"]
  node_minio_upload["MinIO ingestion<br/>[ingest_to_minio.py]"]
  node_minio[("MinIO raw lake")]
end

subgraph group_pipeline["ETL and orchestration"]
  node_airflow["Airflow scheduler"]
  node_dag["ETL DAG"]
  node_extract["Extract raw data<br/>[etl_process.py]"]
  node_staging[("Pickle staging data")]
  node_transform["Star-schema transform<br/>[etl_process.py]"]
  node_quality["Warehouse validation<br/>[etl_process.py]"]
end

subgraph group_warehouse["Analytics warehouse"]
  node_dimensions["Dimensions and bridge<br/>[etl_process.py]"]
  node_fact["Rating fact<br/>[etl_process.py]"]
  node_postgres[("PostgreSQL warehouse")]
  node_queries["Sample warehouse queries<br/>[query_dw.sql]"]
end

node_engineer(("Data engineer"))
node_tmdb_api["TMDB API"]
node_analytics(("BI and ML consumers"))

node_engineer -->|"fetches metadata"| node_tmdb_fetch
node_tmdb_fetch -->|"requests metadata"| node_tmdb_api
node_movielens -->|"provides TMDB IDs"| node_tmdb_fetch
node_engineer -->|"starts ingestion"| node_minio_upload
node_movielens -->|"uploads files"| node_minio_upload
node_tmdb_fetch -.->|"uploads JSON"| node_minio_upload
node_minio_upload -->|"writes objects"| node_minio
node_airflow -->|"schedules DAG"| node_dag
node_dag -->|"dispatches extract"| node_extract
node_dag -->|"dispatches transform"| node_transform
node_dag -->|"dispatches dimension load"| node_dimensions
node_dag -->|"dispatches fact load"| node_fact
node_dag -->|"dispatches validation"| node_quality
node_extract -->|"reads raw objects"| node_minio
node_extract -->|"writes extracted data"| node_staging
node_transform -->|"reads extracted data"| node_staging
node_transform -->|"writes model tables"| node_staging
node_dimensions -->|"reads dimension data"| node_staging
node_dimensions -.->|"loads dimensions"| node_postgres
node_fact -->|"reads fact data"| node_staging
node_fact -.->|"loads ratings"| node_postgres
node_quality -->|"checks warehouse"| node_postgres
node_analytics -->|"queries warehouse"| node_postgres
node_queries -->|"queries tables"| node_postgres

click node_movielens "https://github.com/aizen2510/datta_cuoiki/tree/main/raw_data"
click node_tmdb_fetch "https://github.com/aizen2510/datta_cuoiki/blob/main/fetch_raw_data.py"
click node_minio_upload "https://github.com/aizen2510/datta_cuoiki/blob/main/ingest_to_minio.py"
click node_dag "https://github.com/aizen2510/datta_cuoiki/blob/main/dags/movielens_etl_dag.py"
click node_extract "https://github.com/aizen2510/datta_cuoiki/blob/main/etl_process.py"
click node_staging "https://github.com/aizen2510/datta_cuoiki/tree/main/staging"
click node_transform "https://github.com/aizen2510/datta_cuoiki/blob/main/etl_process.py"
click node_dimensions "https://github.com/aizen2510/datta_cuoiki/blob/main/etl_process.py"
click node_fact "https://github.com/aizen2510/datta_cuoiki/blob/main/etl_process.py"
click node_quality "https://github.com/aizen2510/datta_cuoiki/blob/main/etl_process.py"
click node_queries "https://github.com/aizen2510/datta_cuoiki/blob/main/query_dw.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_movielens,node_tmdb_fetch toneBlue
class node_minio_upload,node_minio toneAmber
class node_airflow,node_dag,node_extract,node_staging,node_transform,node_quality,node_tmdb_api toneMint
class node_dimensions,node_fact,node_postgres,node_queries toneRose
class node_engineer,node_analytics toneIndigo
```

## Components

### Source collection

- [MovieLens files](https://github.com/aizen2510/datta_cuoiki/tree/main/raw_data): `raw_data`
- [TMDB metadata fetch](https://github.com/aizen2510/datta_cuoiki/blob/main/fetch_raw_data.py): `fetch_raw_data.py`

### Raw data lake

- [MinIO ingestion](https://github.com/aizen2510/datta_cuoiki/blob/main/ingest_to_minio.py): `ingest_to_minio.py`
- **MinIO raw lake**

### ETL and orchestration

- **Airflow scheduler**
- [ETL DAG](https://github.com/aizen2510/datta_cuoiki/blob/main/dags/movielens_etl_dag.py): `dags/movielens_etl_dag.py`
- [Extract raw data](https://github.com/aizen2510/datta_cuoiki/blob/main/etl_process.py): `etl_process.py`
- [Pickle staging data](https://github.com/aizen2510/datta_cuoiki/tree/main/staging): `staging`
- [Star-schema transform](https://github.com/aizen2510/datta_cuoiki/blob/main/etl_process.py): `etl_process.py`
- [Warehouse validation](https://github.com/aizen2510/datta_cuoiki/blob/main/etl_process.py): `etl_process.py`

### Analytics warehouse

- [Dimensions and bridge](https://github.com/aizen2510/datta_cuoiki/blob/main/etl_process.py): `etl_process.py`
- [Rating fact](https://github.com/aizen2510/datta_cuoiki/blob/main/etl_process.py): `etl_process.py`
- **PostgreSQL warehouse**
- [Sample warehouse queries](https://github.com/aizen2510/datta_cuoiki/blob/main/query_dw.sql): `query_dw.sql`

### Other components

- **Data engineer**
- **TMDB API**
- **BI and ML consumers**

## Connections

- Data engineer → TMDB metadata fetch: fetches metadata (evidence: `fetch_raw_data.py`)
- TMDB metadata fetch → TMDB API: requests metadata (evidence: `fetch_raw_data.py`)
- MovieLens files → TMDB metadata fetch: provides TMDB IDs (evidence: `fetch_raw_data.py`)
- Data engineer → MinIO ingestion: starts ingestion (evidence: `ingest_to_minio.py`)
- MovieLens files → MinIO ingestion: uploads files (evidence: `ingest_to_minio.py`)
- TMDB metadata fetch → MinIO ingestion: uploads JSON
- MinIO ingestion → MinIO raw lake: writes objects (evidence: `ingest_to_minio.py`)
- Airflow scheduler → ETL DAG: schedules DAG (evidence: `dags/movielens_etl_dag.py`)
- ETL DAG → Extract raw data: dispatches extract (evidence: `dags/movielens_etl_dag.py`)
- ETL DAG → Star-schema transform: dispatches transform (evidence: `dags/movielens_etl_dag.py`)
- ETL DAG → Dimensions and bridge: dispatches dimension load (evidence: `dags/movielens_etl_dag.py`)
- ETL DAG → Rating fact: dispatches fact load (evidence: `dags/movielens_etl_dag.py`)
- ETL DAG → Warehouse validation: dispatches validation (evidence: `dags/movielens_etl_dag.py`)
- Extract raw data → MinIO raw lake: reads raw objects (evidence: `README.md`)
- Extract raw data → Pickle staging data: writes extracted data (evidence: `etl_process.py`)
- Star-schema transform → Pickle staging data: reads extracted data (evidence: `etl_process.py`)
- Star-schema transform → Pickle staging data: writes model tables (evidence: `etl_process.py`)
- Dimensions and bridge → Pickle staging data: reads dimension data (evidence: `etl_process.py`)
- Dimensions and bridge → PostgreSQL warehouse: loads dimensions
- Rating fact → Pickle staging data: reads fact data (evidence: `etl_process.py`)
- Rating fact → PostgreSQL warehouse: loads ratings
- Warehouse validation → PostgreSQL warehouse: checks warehouse (evidence: `etl_process.py`)
- BI and ML consumers → PostgreSQL warehouse: queries warehouse (evidence: `README.md`)
- Sample warehouse queries → PostgreSQL warehouse: queries tables (evidence: `README.md`)
