# shavkatjony/brazilian-e-market architecture

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

- Interactive diagram: https://gitdiagram.com/shavkatjony/brazilian-e-market
- Repository: https://github.com/shavkatjony/brazilian-e-market

## Overview

This repository is a SQL-first business analysis of the Olist Brazilian e-commerce dataset. The main workflow loads raw CSVs into SQLite, runs SQL analyses for five operational questions, then presents charts and interpretation in a notebook and executive findings report. The README documents these stages and their relationships; source excerpts show the database loader, but the SQL and notebook implementations were not sampled, so their internal calls are not asserted.

Main entry points: [`notebooks/analysis.ipynb`](https://github.com/shavkatjony/brazilian-e-market/blob/main/notebooks/analysis.ipynb) (Analysis narrative), [`src/create_db.py`](https://github.com/shavkatjony/brazilian-e-market/blob/main/src/create_db.py) (CSV database loader), [`sql/notebook`](https://github.com/shavkatjony/brazilian-e-market/tree/main/sql/notebook) (Notebook chart queries), [`sql/00_exploration.sql`](https://github.com/shavkatjony/brazilian-e-market/blob/main/sql/00_exploration.sql) (Data exploration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Data ingestion"]
  node_loader["CSV database loader<br/>[create_db.py]"]
  node_database[("SQLite database")]
end

subgraph group_analysis["Business analysis"]
  node_exploration["Data exploration<br/>[00_exploration.sql]"]
  node_at_risk["At-risk customers"]
  node_delivery_reviews["Delivery and reviews"]
  node_seller_performance["Seller performance"]
  node_cohort_retention["Cohort retention"]
  node_logistics["Logistics bottlenecks"]
  node_chart_queries["Notebook chart queries"]
end

subgraph group_outputs["Insights and reporting"]
  node_analysis_notebook["Analysis narrative<br/>[analysis.ipynb]"]
  node_figures["Analysis figures"]
  node_findings["Executive findings<br/>[findings.md]"]
end

node_dataset["Olist CSV dataset"]

node_dataset -->|"provides CSVs"| node_loader
node_loader -->|"loads tables"| node_database
node_database -->|"queries data"| node_exploration
node_database -->|"queries data"| node_at_risk
node_database -->|"queries data"| node_delivery_reviews
node_database -->|"queries data"| node_seller_performance
node_database -->|"queries data"| node_cohort_retention
node_database -->|"queries data"| node_logistics
node_database -->|"queries data"| node_chart_queries
node_chart_queries -->|"feeds charts"| node_analysis_notebook
node_analysis_notebook -->|"produces charts"| node_figures
node_analysis_notebook -->|"summarizes insights"| node_findings

click node_loader "https://github.com/shavkatjony/brazilian-e-market/blob/main/src/create_db.py"
click node_exploration "https://github.com/shavkatjony/brazilian-e-market/blob/main/sql/00_exploration.sql"
click node_at_risk "https://github.com/shavkatjony/brazilian-e-market/blob/main/sql/01_at_risk_customers.sql"
click node_delivery_reviews "https://github.com/shavkatjony/brazilian-e-market/blob/main/sql/02_delivery_vs_reviews.sql"
click node_seller_performance "https://github.com/shavkatjony/brazilian-e-market/blob/main/sql/03_seller_performance.sql"
click node_cohort_retention "https://github.com/shavkatjony/brazilian-e-market/blob/main/sql/04_cohort_retention.sql"
click node_logistics "https://github.com/shavkatjony/brazilian-e-market/blob/main/sql/05_logistics_bottlenecks.sql"
click node_chart_queries "https://github.com/shavkatjony/brazilian-e-market/tree/main/sql/notebook"
click node_analysis_notebook "https://github.com/shavkatjony/brazilian-e-market/blob/main/notebooks/analysis.ipynb"
click node_figures "https://github.com/shavkatjony/brazilian-e-market/tree/main/reports/figures"
click node_findings "https://github.com/shavkatjony/brazilian-e-market/blob/main/reports/findings.md"

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_loader,node_database toneBlue
class node_exploration,node_at_risk,node_delivery_reviews,node_seller_performance,node_cohort_retention,node_logistics,node_chart_queries toneAmber
class node_analysis_notebook,node_figures,node_findings toneMint
class node_dataset toneIndigo
```

## Components

### Data ingestion

- [CSV database loader](https://github.com/shavkatjony/brazilian-e-market/blob/main/src/create_db.py): `src/create_db.py`
- **SQLite database**

### Business analysis

- [Data exploration](https://github.com/shavkatjony/brazilian-e-market/blob/main/sql/00_exploration.sql): `sql/00_exploration.sql`
- [At-risk customers](https://github.com/shavkatjony/brazilian-e-market/blob/main/sql/01_at_risk_customers.sql): `sql/01_at_risk_customers.sql`
- [Delivery and reviews](https://github.com/shavkatjony/brazilian-e-market/blob/main/sql/02_delivery_vs_reviews.sql): `sql/02_delivery_vs_reviews.sql`
- [Seller performance](https://github.com/shavkatjony/brazilian-e-market/blob/main/sql/03_seller_performance.sql): `sql/03_seller_performance.sql`
- [Cohort retention](https://github.com/shavkatjony/brazilian-e-market/blob/main/sql/04_cohort_retention.sql): `sql/04_cohort_retention.sql`
- [Logistics bottlenecks](https://github.com/shavkatjony/brazilian-e-market/blob/main/sql/05_logistics_bottlenecks.sql): `sql/05_logistics_bottlenecks.sql`
- [Notebook chart queries](https://github.com/shavkatjony/brazilian-e-market/tree/main/sql/notebook): `sql/notebook`

### Insights and reporting

- [Analysis narrative](https://github.com/shavkatjony/brazilian-e-market/blob/main/notebooks/analysis.ipynb): `notebooks/analysis.ipynb`
- [Analysis figures](https://github.com/shavkatjony/brazilian-e-market/tree/main/reports/figures): `reports/figures`
- [Executive findings](https://github.com/shavkatjony/brazilian-e-market/blob/main/reports/findings.md): `reports/findings.md`

### Other components

- **Olist CSV dataset**

## Connections

- Olist CSV dataset → CSV database loader: provides CSVs (evidence: `README.md`)
- CSV database loader → SQLite database: loads tables (evidence: `src/create_db.py`)
- SQLite database → Data exploration: queries data (evidence: `README.md`)
- SQLite database → At-risk customers: queries data (evidence: `README.md`)
- SQLite database → Delivery and reviews: queries data (evidence: `README.md`)
- SQLite database → Seller performance: queries data (evidence: `README.md`)
- SQLite database → Cohort retention: queries data (evidence: `README.md`)
- SQLite database → Logistics bottlenecks: queries data (evidence: `README.md`)
- SQLite database → Notebook chart queries: queries data (evidence: `README.md`)
- Notebook chart queries → Analysis narrative: feeds charts (evidence: `README.md`)
- Analysis narrative → Analysis figures: produces charts (evidence: `README.md`)
- Analysis narrative → Executive findings: summarizes insights (evidence: `README.md`)
