# ttan-ttan/gensg_finalproject_olistanalysis architecture

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

- Interactive diagram: https://gitdiagram.com/ttan-ttan/gensg_finalproject_olistanalysis
- Repository: https://github.com/ttan-ttan/gensg_finalproject_olistanalysis

## Overview

This repository provides reusable PySpark cleaning, validation, and Gold-layer modeling code for Olist e-commerce analytics. The documented workflow moves raw data through Bronze ingestion, Silver cleaning, and Gold star-schema construction; the tree shown here contains the reusable Python modules, not the documented Fabric assets, orchestration, SQL, or BI artifacts. The graph therefore shows documented layer transitions and source-supported module relationships, without implying that the modules are wired into an executable pipeline. Validation and reporting helpers are represented as internal quality capabilities.

Main entry points: [`src`](https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/tree/main/src) (Other Silver cleaning), [`src/cleaning_products.py`](https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/blob/main/src/cleaning_products.py) (Clean products), [`src/cleaning_reviews.py`](https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/blob/main/src/cleaning_reviews.py) (Clean reviews), [`src/cleaning_dim_date_gold.py`](https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/blob/main/src/cleaning_dim_date_gold.py) (Date dimension)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_silver["Silver transformations"]
  node_silver_products["Clean products"]
  node_silver_reviews["Clean reviews"]
  node_silver_other["Other Silver cleaning"]
end

subgraph group_gold["Gold modeling"]
  node_gold_date["Date dimension"]
  node_gold_product["Product dimension"]
  node_gold_seller["Seller dimension"]
  node_gold_facts["Gold fact tables"]
end

subgraph group_quality["Data quality"]
  node_validators["Data validators"]
  node_dq_reporting["DQ reporting helpers<br/>[dq_summary.py]"]
end

node_raw[("Raw Olist data")]
node_bronze["Bronze ingestion"]
node_lakehouse[("Microsoft Fabric Lakehouse")]
node_bi["Power BI analytics"]

node_raw -.->|"lands raw data"| node_bronze
node_bronze -.->|"feeds cleaning"| node_silver_products
node_bronze -.->|"feeds cleaning"| node_silver_reviews
node_bronze -.->|"feeds cleaning"| node_silver_other
node_silver_products -.->|"supplies products"| node_gold_product
node_silver_reviews -.->|"supplies reviews"| node_gold_facts
node_silver_other -.->|"feeds modeling"| node_gold_date
node_silver_other -.->|"supplies sellers"| node_gold_seller
node_silver_other -.->|"supplies facts"| node_gold_facts
node_gold_date -.->|"writes Delta table"| node_lakehouse
node_gold_product -.->|"writes Gold table"| node_lakehouse
node_gold_seller -.->|"writes Gold table"| node_lakehouse
node_silver_products -.->|"validated by"| node_validators
node_silver_reviews -.->|"validated by"| node_validators
node_gold_date -->|"calls validation"| node_validators
node_gold_seller -->|"calls validation"| node_validators
node_lakehouse -.->|"serves analytics"| node_bi

click node_silver_products "https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/blob/main/src/cleaning_products.py"
click node_silver_reviews "https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/blob/main/src/cleaning_reviews.py"
click node_silver_other "https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/tree/main/src"
click node_gold_date "https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/blob/main/src/cleaning_dim_date_gold.py"
click node_gold_product "https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/blob/main/src/cleaning_dim_product_gold.py"
click node_gold_seller "https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/blob/main/src/cleaning_dim_seller_gold.py"
click node_gold_facts "https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/tree/main/src"
click node_validators "https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/tree/main/src"
click node_dq_reporting "https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/blob/main/src/dq_summary.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_silver_products,node_silver_reviews,node_silver_other toneBlue
class node_gold_date,node_gold_product,node_gold_seller,node_gold_facts,node_raw,node_lakehouse toneAmber
class node_validators,node_dq_reporting toneMint
class node_bronze,node_bi toneIndigo
```

## Components

### Silver transformations

- [Clean products](https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/blob/main/src/cleaning_products.py): `src/cleaning_products.py`
- [Clean reviews](https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/blob/main/src/cleaning_reviews.py): `src/cleaning_reviews.py`
- [Other Silver cleaning](https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/tree/main/src): `src`

### Gold modeling

- [Date dimension](https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/blob/main/src/cleaning_dim_date_gold.py): `src/cleaning_dim_date_gold.py`
- [Product dimension](https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/blob/main/src/cleaning_dim_product_gold.py): `src/cleaning_dim_product_gold.py`
- [Seller dimension](https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/blob/main/src/cleaning_dim_seller_gold.py): `src/cleaning_dim_seller_gold.py`
- [Gold fact tables](https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/tree/main/src): `src`

### Data quality

- [Data validators](https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/tree/main/src): `src`
- [DQ reporting helpers](https://github.com/ttan-ttan/gensg_finalproject_olistanalysis/blob/main/src/dq_summary.py): `src/dq_summary.py`

### Other components

- **Raw Olist data**
- **Bronze ingestion**
- **Microsoft Fabric Lakehouse**
- **Power BI analytics**

## Connections

- Raw Olist data → Bronze ingestion: lands raw data (evidence: `README.md`)
- Bronze ingestion → Clean products: feeds cleaning (evidence: `README.md`)
- Bronze ingestion → Clean reviews: feeds cleaning (evidence: `README.md`)
- Bronze ingestion → Other Silver cleaning: feeds cleaning (evidence: `README.md`)
- Clean products → Product dimension: supplies products (evidence: `README.md`)
- Clean reviews → Gold fact tables: supplies reviews (evidence: `README.md`)
- Other Silver cleaning → Date dimension: feeds modeling (evidence: `README.md`)
- Other Silver cleaning → Seller dimension: supplies sellers (evidence: `README.md`)
- Other Silver cleaning → Gold fact tables: supplies facts (evidence: `README.md`)
- Date dimension → Microsoft Fabric Lakehouse: writes Delta table (evidence: `src/cleaning_dim_date_gold.py`)
- Product dimension → Microsoft Fabric Lakehouse: writes Gold table (evidence: `src/cleaning_dim_product_gold.py`)
- Seller dimension → Microsoft Fabric Lakehouse: writes Gold table (evidence: `src/cleaning_dim_seller_gold.py`)
- Clean products → Data validators: validated by (evidence: `src/validation_products.py`)
- Clean reviews → Data validators: validated by (evidence: `src/validation_reviews.py`)
- Date dimension → Data validators: calls validation (evidence: `src/cleaning_dim_date_gold.py`)
- Seller dimension → Data validators: calls validation (evidence: `src/cleaning_dim_seller_gold.py`)
- Microsoft Fabric Lakehouse → Power BI analytics: serves analytics (evidence: `README.md`)
