# shanmugasundaram2503/cart2insigth architecture

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

- Interactive diagram: https://gitdiagram.com/shanmugasundaram2503/cart2insigth
- Repository: https://github.com/shanmugasundaram2503/cart2insigth

## Overview

Cart2Insights is a Streamlit dashboard for analyzing Olist e-commerce data stored in MySQL. The user selects a dashboard view; the app obtains a shared database engine, requests metrics from SQL query functions, and renders business, sales, customer, seller/product, delivery, and review analyses. Formatting helpers support displayed metrics. The tree also names notebooks for data understanding, quality, cleaning, loading, feature engineering, and exploration, but their contents and connections are not shown, so they are represented without inferred workflow edges.

Main entry points: [`cart2insigths/queries.py`](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/queries.py) (SQL analytics), [`cart2insigths/app.py`](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/app.py) (Streamlit dashboard), [`cart2insigths/database.py.py`](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/database.py.py) (Database engine), [`cart2insigths/utils.py`](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/utils.py) (Metric formatting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_app["Streamlit dashboard<br/>[app.py]"]
  node_formatting["Metric formatting<br/>[utils.py]"]
end

subgraph group_analytics["Analytics"]
  node_queries["SQL analytics<br/>[queries.py]"]
  node_overview["Business overview<br/>[queries.py]"]
  node_sales["Sales analysis<br/>[queries.py]"]
  node_customers["Customer analysis<br/>[queries.py]"]
  node_seller_product["Seller and product<br/>[queries.py]"]
  node_delivery["Delivery analysis<br/>[queries.py]"]
  node_experience["Customer experience<br/>[queries.py]"]
  node_database["Database engine<br/>[database.py.py]"]
end

subgraph group_preparation["Data Preparation"]
  node_understanding["Data understanding"]
  node_quality["Data quality"]
  node_cleaning["Data cleaning"]
  node_loading["MySQL loading"]
  node_features["Feature engineering"]
  node_exploration["Exploratory analysis"]
end

node_user(("Dashboard user"))
node_mysql[("MySQL database")]

node_user -->|"selects view"| node_app
node_app -->|"gets engine"| node_database
node_app -->|"requests metrics"| node_queries
node_app -->|"formats values"| node_formatting
node_queries -->|"reads data"| node_mysql
node_database -->|"connects to"| node_mysql
node_queries -->|"provides metrics"| node_overview
node_queries -->|"provides metrics"| node_sales
node_queries -->|"provides metrics"| node_customers
node_queries -->|"provides metrics"| node_seller_product
node_queries -->|"provides metrics"| node_delivery
node_queries -->|"provides metrics"| node_experience

click node_app "https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/app.py"
click node_formatting "https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/utils.py"
click node_queries "https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/queries.py"
click node_overview "https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/queries.py"
click node_sales "https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/queries.py"
click node_customers "https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/queries.py"
click node_seller_product "https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/queries.py"
click node_delivery "https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/queries.py"
click node_experience "https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/queries.py"
click node_database "https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/database.py.py"
click node_understanding "https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/01_data_understanding%20.ipynb"
click node_quality "https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/02_data_quality_analysis.ipynb"
click node_cleaning "https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/03_data_cleaning.ipynb"
click node_loading "https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/04_load_data_into_mysql.ipynb"
click node_features "https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/05_feature_engineering.ipynb"
click node_exploration "https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/06_exploratory_data_analysis.ipynb"

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_app,node_formatting,node_user toneBlue
class node_queries,node_overview,node_sales,node_customers,node_seller_product,node_delivery,node_experience,node_database,node_mysql toneAmber
class node_understanding,node_quality,node_cleaning,node_loading,node_features,node_exploration toneMint
```

## Components

### Dashboard

- [Streamlit dashboard](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/app.py): `cart2insigths/app.py`
- [Metric formatting](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/utils.py): `cart2insigths/utils.py`

### Analytics

- [SQL analytics](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/queries.py): `cart2insigths/queries.py`
- [Business overview](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/queries.py): `cart2insigths/queries.py`
- [Sales analysis](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/queries.py): `cart2insigths/queries.py`
- [Customer analysis](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/queries.py): `cart2insigths/queries.py`
- [Seller and product](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/queries.py): `cart2insigths/queries.py`
- [Delivery analysis](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/queries.py): `cart2insigths/queries.py`
- [Customer experience](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/queries.py): `cart2insigths/queries.py`
- [Database engine](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/database.py.py): `cart2insigths/database.py.py`

### Data Preparation

- [Data understanding](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/01_data_understanding%20.ipynb): `cart2insigths/01_data_understanding .ipynb`
- [Data quality](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/02_data_quality_analysis.ipynb): `cart2insigths/02_data_quality_analysis.ipynb`
- [Data cleaning](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/03_data_cleaning.ipynb): `cart2insigths/03_data_cleaning.ipynb`
- [MySQL loading](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/04_load_data_into_mysql.ipynb): `cart2insigths/04_load_data_into_mysql.ipynb`
- [Feature engineering](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/05_feature_engineering.ipynb): `cart2insigths/05_feature_engineering.ipynb`
- [Exploratory analysis](https://github.com/shanmugasundaram2503/cart2insigth/blob/main/cart2insigths/06_exploratory_data_analysis.ipynb): `cart2insigths/06_exploratory_data_analysis.ipynb`

### Other components

- **Dashboard user**
- **MySQL database**

## Connections

- Dashboard user → Streamlit dashboard: selects view (evidence: `cart2insigths/app.py`)
- Streamlit dashboard → Database engine: gets engine (evidence: `cart2insigths/app.py`)
- Streamlit dashboard → SQL analytics: requests metrics (evidence: `cart2insigths/app.py`)
- Streamlit dashboard → Metric formatting: formats values (evidence: `cart2insigths/app.py`)
- SQL analytics → MySQL database: reads data (evidence: `cart2insigths/queries.py`)
- Database engine → MySQL database: connects to (evidence: `cart2insigths/database.py.py`)
- SQL analytics → Business overview: provides metrics (evidence: `cart2insigths/queries.py`)
- SQL analytics → Sales analysis: provides metrics (evidence: `cart2insigths/queries.py`)
- SQL analytics → Customer analysis: provides metrics (evidence: `cart2insigths/queries.py`)
- SQL analytics → Seller and product: provides metrics (evidence: `cart2insigths/queries.py`)
- SQL analytics → Delivery analysis: provides metrics (evidence: `cart2insigths/queries.py`)
- SQL analytics → Customer experience: provides metrics (evidence: `cart2insigths/queries.py`)
