# e-commerce-depi-team/e-commerce architecture

> Architecture diagram of the GitHub repository e-commerce-depi-team/e-commerce, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/e-commerce-depi-team/e-commerce
- Repository: https://github.com/e-commerce-depi-team/e-commerce

## Overview

This repository prepares Olist e-commerce data and enriches it with Brazilian economic indicators. The principal workflow is to fetch World Bank data, reshape it into CSV, and independently prepare Olist raw files into staging tables with a validation report; exploration and investigation scripts support data profiling. The README also documents an Airflow, dbt, and PostgreSQL warehouse platform. Its wiring is documented, but the tree contains no DAG definitions or dbt models, so those links reflect README-level capabilities rather than inspected implementations.

Main entry points: [`data/raw`](https://github.com/e-commerce-depi-team/e-commerce/tree/main/data/raw) (Olist raw files), [`src/prepare_olist_staging.py`](https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/prepare_olist_staging.py) (Olist staging prep), [`dags`](https://github.com/e-commerce-depi-team/e-commerce/tree/main/dags) (Airflow services), [`src/extract_world_bank.py`](https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/extract_world_bank.py) (Economic extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Data ingestion"]
  node_olistraw["Olist raw files"]
  node_extract["Economic extraction"]
  node_economicjson["Economic JSON"]
  node_economictransform["Economic transform"]
end

subgraph group_quality["Exploration and quality"]
  node_olistprep["Olist staging prep"]
  node_exploreorders["Order profiling<br/>[explore_orders.py]"]
  node_exploreitems["Item profiling"]
  node_explorepayments["Payment profiling"]
  node_explorereviews["Review profiling"]
  node_exploreproducts["Product profiling"]
  node_exploresellers["Seller profiling<br/>[explore_sellers.py]"]
  node_exploregeo["Geolocation profiling"]
  node_exploretranslation["Translation profiling"]
  node_investigategeo["Geolocation investigation"]
  node_investigatereviews["Review investigation"]
  node_investigateproducts["Product investigation"]
end

subgraph group_warehouse["Warehouse platform"]
  node_airflow["Airflow services"]
  node_dbt["dbt project"]
  node_warehouse_db[("PostgreSQL warehouse")]
end

subgraph group_outputs["Data products"]
  node_staging["Staging CSVs"]
  node_report["Validation report"]
  node_economiccsv["Economic CSV"]
end

node_operator(("Pipeline operator"))
node_worldbank{{"World Bank API"}}

node_operator -->|"runs"| node_extract
node_worldbank -->|"provides indicators"| node_extract
node_extract -->|"saves responses"| node_economicjson
node_operator -->|"runs"| node_economictransform
node_economicjson -->|"reads JSON"| node_economictransform
node_economictransform -->|"writes CSV"| node_economiccsv
node_operator -->|"runs"| node_olistprep
node_olistraw -->|"loads files"| node_olistprep
node_olistprep -->|"writes tables"| node_staging
node_olistprep -->|"writes report"| node_report
node_operator -->|"runs"| node_exploreorders
node_olistraw -->|"reads orders"| node_exploreorders
node_operator -->|"runs"| node_exploreitems
node_olistraw -->|"reads items"| node_exploreitems
node_operator -->|"runs"| node_explorepayments
node_olistraw -.->|"profiles payments"| node_explorepayments
node_operator -->|"runs"| node_explorereviews
node_olistraw -->|"reads reviews"| node_explorereviews
node_operator -->|"runs"| node_exploreproducts
node_olistraw -->|"reads products"| node_exploreproducts
node_operator -->|"runs"| node_exploresellers
node_olistraw -.->|"profiles sellers"| node_exploresellers
node_operator -->|"runs"| node_exploregeo
node_olistraw -->|"reads locations"| node_exploregeo
node_operator -->|"runs"| node_exploretranslation
node_olistraw -->|"reads categories"| node_exploretranslation
node_operator -->|"runs"| node_investigategeo
node_olistraw -->|"reads locations"| node_investigategeo
node_operator -->|"runs"| node_investigatereviews
node_olistraw -->|"reads reviews"| node_investigatereviews
node_operator -->|"runs"| node_investigateproducts
node_olistraw -->|"reads products"| node_investigateproducts
node_operator -->|"uses platform"| node_airflow
node_airflow -->|"connects to"| node_warehouse_db
node_airflow -->|"runs dbt"| node_dbt
node_dbt -->|"reads and writes"| node_warehouse_db

click node_olistraw "https://github.com/e-commerce-depi-team/e-commerce/tree/main/data/raw"
click node_extract "https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/extract_world_bank.py"
click node_economicjson "https://github.com/e-commerce-depi-team/e-commerce/tree/main/data/raw/external"
click node_economictransform "https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/transform_world_bank.py"
click node_olistprep "https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/prepare_olist_staging.py"
click node_exploreorders "https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/explore_orders.py"
click node_exploreitems "https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/explore_order_items.py"
click node_explorepayments "https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/explore_order_payments.py"
click node_explorereviews "https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/explore_order_reviews.py"
click node_exploreproducts "https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/explore_products.py"
click node_exploresellers "https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/explore_sellers.py"
click node_exploregeo "https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/explore_geolocation.py"
click node_exploretranslation "https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/explore_category_translation.py"
click node_investigategeo "https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/investigate_geolocation.py"
click node_investigatereviews "https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/investigate_order_reviews.py"
click node_investigateproducts "https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/investigate_products.py"
click node_airflow "https://github.com/e-commerce-depi-team/e-commerce/tree/main/dags"
click node_dbt "https://github.com/e-commerce-depi-team/e-commerce/tree/main/dbt_project"
click node_warehouse_db "https://github.com/e-commerce-depi-team/e-commerce/blob/main/docker/postgres/init/01_create_schemas.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_olistraw,node_extract,node_economicjson,node_economictransform toneBlue
class node_olistprep,node_exploreorders,node_exploreitems,node_explorepayments,node_explorereviews,node_exploreproducts,node_exploresellers,node_exploregeo,node_exploretranslation,node_investigategeo,node_investigatereviews,node_investigateproducts toneAmber
class node_airflow,node_dbt,node_warehouse_db,node_worldbank toneMint
class node_staging,node_report,node_economiccsv toneRose
class node_operator toneIndigo
```

## Components

### Data ingestion

- [Olist raw files](https://github.com/e-commerce-depi-team/e-commerce/tree/main/data/raw): `data/raw`
- [Economic extraction](https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/extract_world_bank.py): `src/extract_world_bank.py`
- [Economic JSON](https://github.com/e-commerce-depi-team/e-commerce/tree/main/data/raw/external): `data/raw/external`
- [Economic transform](https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/transform_world_bank.py): `src/transform_world_bank.py`

### Exploration and quality

- [Olist staging prep](https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/prepare_olist_staging.py): `src/prepare_olist_staging.py`
- [Order profiling](https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/explore_orders.py): `src/explore_orders.py`
- [Item profiling](https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/explore_order_items.py): `src/explore_order_items.py`
- [Payment profiling](https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/explore_order_payments.py): `src/explore_order_payments.py`
- [Review profiling](https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/explore_order_reviews.py): `src/explore_order_reviews.py`
- [Product profiling](https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/explore_products.py): `src/explore_products.py`
- [Seller profiling](https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/explore_sellers.py): `src/explore_sellers.py`
- [Geolocation profiling](https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/explore_geolocation.py): `src/explore_geolocation.py`
- [Translation profiling](https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/explore_category_translation.py): `src/explore_category_translation.py`
- [Geolocation investigation](https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/investigate_geolocation.py): `src/investigate_geolocation.py`
- [Review investigation](https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/investigate_order_reviews.py): `src/investigate_order_reviews.py`
- [Product investigation](https://github.com/e-commerce-depi-team/e-commerce/blob/main/src/investigate_products.py): `src/investigate_products.py`

### Warehouse platform

- [Airflow services](https://github.com/e-commerce-depi-team/e-commerce/tree/main/dags): `dags`
- [dbt project](https://github.com/e-commerce-depi-team/e-commerce/tree/main/dbt_project): `dbt_project`
- [PostgreSQL warehouse](https://github.com/e-commerce-depi-team/e-commerce/blob/main/docker/postgres/init/01_create_schemas.sql): `docker/postgres/init/01_create_schemas.sql`

### Data products

- **Staging CSVs**
- **Validation report**
- **Economic CSV**

### Other components

- **Pipeline operator**
- **World Bank API**

## Connections

- Pipeline operator → Economic extraction: runs (evidence: `README.md`)
- World Bank API → Economic extraction: provides indicators (evidence: `README.md`)
- Economic extraction → Economic JSON: saves responses (evidence: `README.md`)
- Pipeline operator → Economic transform: runs (evidence: `README.md`)
- Economic JSON → Economic transform: reads JSON (evidence: `src/transform_world_bank.py`)
- Economic transform → Economic CSV: writes CSV (evidence: `src/transform_world_bank.py`)
- Pipeline operator → Olist staging prep: runs (evidence: `README.md`)
- Olist raw files → Olist staging prep: loads files (evidence: `src/prepare_olist_staging.py`)
- Olist staging prep → Staging CSVs: writes tables (evidence: `src/prepare_olist_staging.py`)
- Olist staging prep → Validation report: writes report (evidence: `src/prepare_olist_staging.py`)
- Pipeline operator → Order profiling: runs (evidence: `src/explore_orders.py`)
- Olist raw files → Order profiling: reads orders (evidence: `src/explore_orders.py`)
- Pipeline operator → Item profiling: runs (evidence: `src/explore_order_items.py`)
- Olist raw files → Item profiling: reads items (evidence: `src/explore_order_items.py`)
- Pipeline operator → Payment profiling: runs (evidence: `README.md`)
- Olist raw files → Payment profiling: profiles payments
- Pipeline operator → Review profiling: runs (evidence: `src/explore_order_reviews.py`)
- Olist raw files → Review profiling: reads reviews (evidence: `src/explore_order_reviews.py`)
- Pipeline operator → Product profiling: runs (evidence: `src/explore_products.py`)
- Olist raw files → Product profiling: reads products (evidence: `src/explore_products.py`)
- Pipeline operator → Seller profiling: runs (evidence: `README.md`)
- Olist raw files → Seller profiling: profiles sellers
- Pipeline operator → Geolocation profiling: runs (evidence: `src/explore_geolocation.py`)
- Olist raw files → Geolocation profiling: reads locations (evidence: `src/explore_geolocation.py`)
- Pipeline operator → Translation profiling: runs (evidence: `src/explore_category_translation.py`)
- Olist raw files → Translation profiling: reads categories (evidence: `src/explore_category_translation.py`)
- Pipeline operator → Geolocation investigation: runs (evidence: `src/investigate_geolocation.py`)
- Olist raw files → Geolocation investigation: reads locations (evidence: `src/investigate_geolocation.py`)
- Pipeline operator → Review investigation: runs (evidence: `src/investigate_order_reviews.py`)
- Olist raw files → Review investigation: reads reviews (evidence: `src/investigate_order_reviews.py`)
- Pipeline operator → Product investigation: runs (evidence: `src/investigate_products.py`)
- Olist raw files → Product investigation: reads products (evidence: `src/investigate_products.py`)
- Pipeline operator → Airflow services: uses platform (evidence: `README.md`)
- Airflow services → PostgreSQL warehouse: connects to (evidence: `README.md`)
- Airflow services → dbt project: runs dbt (evidence: `README.md`)
- dbt project → PostgreSQL warehouse: reads and writes (evidence: `README.md`)
