# trantanphat0811/e--commerce-sales architecture

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

- Interactive diagram: https://gitdiagram.com/trantanphat0811/e--commerce-sales
- Repository: https://github.com/trantanphat0811/e--commerce-sales

## Overview

This repository is an end-to-end e-commerce sales analysis project. Its user-to-result workflow prepares sales data, analyzes business performance with SQL and Python, then presents findings in a Power BI dashboard. The map preserves the documented SQL analysis areas and Python capabilities, including statistical tests, order segmentation, forecasting, and predictive modeling. The README documents the workflow; Python implementation evidence is sampled from `analysis_script.py`, while notebook and dashboard internals were not sampled.

Main entry points: [`data/Ecommerce_Sales_Cleaned.csv`](https://github.com/trantanphat0811/e--commerce-sales/blob/main/data/Ecommerce_Sales_Cleaned.csv) (Cleaned sales data), [`00_Cleaning/Data_Cleaning.ipynb`](https://github.com/trantanphat0811/e--commerce-sales/blob/main/00_Cleaning/Data_Cleaning.ipynb) (Data cleaning), [`03_PowerBI/E- Commerce Sales.pbix`](https://github.com/trantanphat0811/e--commerce-sales/blob/main/03_PowerBI/E-%20Commerce%20Sales.pbix) (Power BI dashboard), [`02_Python/analysis_script.py`](https://github.com/trantanphat0811/e--commerce-sales/blob/main/02_Python/analysis_script.py) (Order segmentation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Data preparation"]
  node_rawdata["Sales source data"]
  node_cleaning["Data cleaning"]
  node_cleaneddata["Cleaned sales data"]
end

subgraph group_sql["SQL analysis"]
  node_sqloverview["Overview analysis"]
  node_sqltime["Time analysis"]
  node_sqlgeo["Geography analysis"]
  node_sqlcategory["Category analysis"]
  node_sqlcustomer["Payment and customers"]
end

subgraph group_python["Python analysis"]
  node_pythoneda["EDA and tests<br/>[analysis_script.py]"]
  node_segmentation["Order segmentation<br/>[analysis_script.py]"]
  node_forecast["Sales forecasting<br/>[analysis_script.py]"]
  node_predictive["Margin modeling<br/>[analysis_script.py]"]
  node_segmentdata["Segmented sales data"]
end

subgraph group_bi["Decision dashboard"]
  node_dashboard["Power BI dashboard"]
end

node_analyst(("Analyst"))

node_analyst -->|"prepares data"| node_cleaning
node_rawdata -->|"cleaned into"| node_cleaning
node_cleaning -->|"produces"| node_cleaneddata
node_analyst -->|"queries KPIs"| node_sqloverview
node_analyst -->|"examines trends"| node_sqltime
node_analyst -->|"compares regions"| node_sqlgeo
node_analyst -->|"compares categories"| node_sqlcategory
node_analyst -->|"examines customers"| node_sqlcustomer
node_cleaneddata -->|"analyzed by"| node_pythoneda
node_cleaneddata -->|"clustered by order"| node_segmentation
node_cleaneddata -->|"feeds forecast"| node_forecast
node_cleaneddata -->|"models margin"| node_predictive
node_segmentation -->|"exports segments"| node_segmentdata
node_cleaneddata -->|"visualized in"| node_dashboard
node_segmentdata -->|"supplies segments"| node_dashboard
node_analyst -->|"reviews insights"| node_dashboard

click node_rawdata "https://github.com/trantanphat0811/e--commerce-sales/blob/main/data/Ecommerce_Sales_Data_2024_2025.csv"
click node_cleaning "https://github.com/trantanphat0811/e--commerce-sales/blob/main/00_Cleaning/Data_Cleaning.ipynb"
click node_cleaneddata "https://github.com/trantanphat0811/e--commerce-sales/blob/main/data/Ecommerce_Sales_Cleaned.csv"
click node_sqloverview "https://github.com/trantanphat0811/e--commerce-sales/blob/main/01_SQL/01_Tong_Quan_Du_Lieu.ipynb"
click node_sqltime "https://github.com/trantanphat0811/e--commerce-sales/blob/main/01_SQL/02_Phan_Tich_Thoi_Gian.ipynb"
click node_sqlgeo "https://github.com/trantanphat0811/e--commerce-sales/blob/main/01_SQL/03_Phan_Tich_Dia_Ly.ipynb"
click node_sqlcategory "https://github.com/trantanphat0811/e--commerce-sales/blob/main/01_SQL/04_Phan_Tich_Category.ipynb"
click node_sqlcustomer "https://github.com/trantanphat0811/e--commerce-sales/blob/main/01_SQL/05_Phan_Tich_Payment_KhachHang.ipynb"
click node_pythoneda "https://github.com/trantanphat0811/e--commerce-sales/blob/main/02_Python/analysis_script.py"
click node_segmentation "https://github.com/trantanphat0811/e--commerce-sales/blob/main/02_Python/analysis_script.py"
click node_forecast "https://github.com/trantanphat0811/e--commerce-sales/blob/main/02_Python/analysis_script.py"
click node_predictive "https://github.com/trantanphat0811/e--commerce-sales/blob/main/02_Python/analysis_script.py"
click node_segmentdata "https://github.com/trantanphat0811/e--commerce-sales/blob/main/data/Ecommerce_Sales_with_Segments.csv"
click node_dashboard "https://github.com/trantanphat0811/e--commerce-sales/blob/main/03_PowerBI/E-%20Commerce%20Sales.pbix"

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_rawdata,node_cleaning,node_cleaneddata toneBlue
class node_sqloverview,node_sqltime,node_sqlgeo,node_sqlcategory,node_sqlcustomer toneAmber
class node_pythoneda,node_segmentation,node_forecast,node_predictive,node_segmentdata toneMint
class node_dashboard toneRose
class node_analyst toneIndigo
```

## Components

### Data preparation

- [Sales source data](https://github.com/trantanphat0811/e--commerce-sales/blob/main/data/Ecommerce_Sales_Data_2024_2025.csv): `data/Ecommerce_Sales_Data_2024_2025.csv`
- [Data cleaning](https://github.com/trantanphat0811/e--commerce-sales/blob/main/00_Cleaning/Data_Cleaning.ipynb): `00_Cleaning/Data_Cleaning.ipynb`
- [Cleaned sales data](https://github.com/trantanphat0811/e--commerce-sales/blob/main/data/Ecommerce_Sales_Cleaned.csv): `data/Ecommerce_Sales_Cleaned.csv`

### SQL analysis

- [Overview analysis](https://github.com/trantanphat0811/e--commerce-sales/blob/main/01_SQL/01_Tong_Quan_Du_Lieu.ipynb): `01_SQL/01_Tong_Quan_Du_Lieu.ipynb`
- [Time analysis](https://github.com/trantanphat0811/e--commerce-sales/blob/main/01_SQL/02_Phan_Tich_Thoi_Gian.ipynb): `01_SQL/02_Phan_Tich_Thoi_Gian.ipynb`
- [Geography analysis](https://github.com/trantanphat0811/e--commerce-sales/blob/main/01_SQL/03_Phan_Tich_Dia_Ly.ipynb): `01_SQL/03_Phan_Tich_Dia_Ly.ipynb`
- [Category analysis](https://github.com/trantanphat0811/e--commerce-sales/blob/main/01_SQL/04_Phan_Tich_Category.ipynb): `01_SQL/04_Phan_Tich_Category.ipynb`
- [Payment and customers](https://github.com/trantanphat0811/e--commerce-sales/blob/main/01_SQL/05_Phan_Tich_Payment_KhachHang.ipynb): `01_SQL/05_Phan_Tich_Payment_KhachHang.ipynb`

### Python analysis

- [EDA and tests](https://github.com/trantanphat0811/e--commerce-sales/blob/main/02_Python/analysis_script.py): `02_Python/analysis_script.py`
- [Order segmentation](https://github.com/trantanphat0811/e--commerce-sales/blob/main/02_Python/analysis_script.py): `02_Python/analysis_script.py`
- [Sales forecasting](https://github.com/trantanphat0811/e--commerce-sales/blob/main/02_Python/analysis_script.py): `02_Python/analysis_script.py`
- [Margin modeling](https://github.com/trantanphat0811/e--commerce-sales/blob/main/02_Python/analysis_script.py): `02_Python/analysis_script.py`
- [Segmented sales data](https://github.com/trantanphat0811/e--commerce-sales/blob/main/data/Ecommerce_Sales_with_Segments.csv): `data/Ecommerce_Sales_with_Segments.csv`

### Decision dashboard

- [Power BI dashboard](https://github.com/trantanphat0811/e--commerce-sales/blob/main/03_PowerBI/E-%20Commerce%20Sales.pbix): `03_PowerBI/E- Commerce Sales.pbix`

### Other components

- **Analyst**

## Connections

- Analyst → Data cleaning: prepares data (evidence: `README.md`)
- Sales source data → Data cleaning: cleaned into (evidence: `README.md`)
- Data cleaning → Cleaned sales data: produces (evidence: `README.md`)
- Analyst → Overview analysis: queries KPIs (evidence: `README.md`)
- Analyst → Time analysis: examines trends (evidence: `README.md`)
- Analyst → Geography analysis: compares regions (evidence: `README.md`)
- Analyst → Category analysis: compares categories (evidence: `README.md`)
- Analyst → Payment and customers: examines customers (evidence: `README.md`)
- Cleaned sales data → EDA and tests: analyzed by (evidence: `README.md`)
- Cleaned sales data → Order segmentation: clustered by order (evidence: `README.md`)
- Cleaned sales data → Sales forecasting: feeds forecast (evidence: `README.md`)
- Cleaned sales data → Margin modeling: models margin (evidence: `README.md`)
- Order segmentation → Segmented sales data: exports segments (evidence: `README.md`)
- Cleaned sales data → Power BI dashboard: visualized in (evidence: `README.md`)
- Segmented sales data → Power BI dashboard: supplies segments (evidence: `README.md`)
- Analyst → Power BI dashboard: reviews insights (evidence: `README.md`)
