# skarshad1928/retail_store_analysis architecture

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

- Interactive diagram: https://gitdiagram.com/skarshad1928/retail_store_analysis
- Repository: https://github.com/skarshad1928/retail_store_analysis

## Overview

This is a student retail-analytics project built around a PySpark ETL and exploratory-analysis workflow. Users create a Spark session, load data files, clean and inspect DataFrames, then explore results through analysis notebooks and dashboard visualizations. The README also describes warehouse loading and statistical validation, but the sampled source does not show their implementations or wiring; those capabilities are represented as documented stages, not asserted code calls. Edges reflect explicit README workflow statements or visible source behavior.

Main entry points: [`src`](https://github.com/skarshad1928/retail_store_analysis/tree/main/src) (Data Warehouse), [`notebooks/DataCleaning and Feature Engineering.ipynb`](https://github.com/skarshad1928/retail_store_analysis/blob/main/notebooks/DataCleaning%20and%20Feature%20Engineering.ipynb) (Data Cleaning), [`notebooks/Load and Understand.ipynb`](https://github.com/skarshad1928/retail_store_analysis/blob/main/notebooks/Load%20and%20Understand.ipynb) (Data Exploration), [`src/readingfiles.py`](https://github.com/skarshad1928/retail_store_analysis/blob/main/src/readingfiles.py) (File Reader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_etl["ETL and Data"]
  node_spark["Spark Session<br/>[spark_session.py]"]
  node_reader["File Reader<br/>[readingfiles.py]"]
  node_clean["Data Cleaning"]
  node_transform["Data Checks<br/>[transformations.py]"]
  node_warehouse[("Data Warehouse")]
end

subgraph group_eda["Exploration"]
  node_catalog["Data Catalog<br/>[catalog.py]"]
  node_dashboard["EDA Dashboard<br/>[dashboard.py]"]
  node_understand["Data Exploration"]
end

subgraph group_analysis["Retail Analysis"]
  node_rfm["RFM Analysis<br/>[RFM_Analysis.ipynb]"]
  node_segments["Product Segments"]
  node_insights["Business Insights"]
end

subgraph group_validation["Statistical Validation"]
  node_stats["Statistical Validation"]
end

node_user(("Analyst"))

node_user -->|"starts session"| node_spark
node_spark -->|"provides session"| node_reader
node_user -.->|"loads files"| node_reader
node_reader -->|"feeds workflow"| node_clean
node_clean -.->|"checks data"| node_transform
node_clean -->|"loads tables"| node_warehouse
node_warehouse -->|"feeds analysis"| node_understand
node_understand -.->|"inspects data"| node_catalog
node_understand -.->|"visualizes data"| node_dashboard
node_warehouse -.->|"supports analysis"| node_rfm
node_warehouse -.->|"supports analysis"| node_segments
node_rfm -.->|"validates findings"| node_stats
node_segments -->|"informs decisions"| node_insights
node_stats -->|"supports conclusions"| node_insights

click node_spark "https://github.com/skarshad1928/retail_store_analysis/blob/main/src/spark_session.py"
click node_reader "https://github.com/skarshad1928/retail_store_analysis/blob/main/src/readingfiles.py"
click node_clean "https://github.com/skarshad1928/retail_store_analysis/blob/main/notebooks/DataCleaning%20and%20Feature%20Engineering.ipynb"
click node_transform "https://github.com/skarshad1928/retail_store_analysis/blob/main/src/transformations.py"
click node_warehouse "https://github.com/skarshad1928/retail_store_analysis/tree/main/src"
click node_catalog "https://github.com/skarshad1928/retail_store_analysis/blob/main/src/catalog.py"
click node_dashboard "https://github.com/skarshad1928/retail_store_analysis/blob/main/src/dashboard.py"
click node_understand "https://github.com/skarshad1928/retail_store_analysis/blob/main/notebooks/Load%20and%20Understand.ipynb"
click node_rfm "https://github.com/skarshad1928/retail_store_analysis/blob/main/notebooks/RFM_Analysis.ipynb"
click node_segments "https://github.com/skarshad1928/retail_store_analysis/blob/main/notebooks/product_segment_analysis.ipynb"
click node_stats "https://github.com/skarshad1928/retail_store_analysis/tree/main/src"
click node_insights "https://github.com/skarshad1928/retail_store_analysis/tree/main/src"

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_spark,node_reader,node_clean,node_transform,node_warehouse toneBlue
class node_catalog,node_dashboard,node_understand toneAmber
class node_rfm,node_segments,node_insights toneMint
class node_stats toneRose
class node_user toneIndigo
```

## Components

### ETL and Data

- [Spark Session](https://github.com/skarshad1928/retail_store_analysis/blob/main/src/spark_session.py): `src/spark_session.py`
- [File Reader](https://github.com/skarshad1928/retail_store_analysis/blob/main/src/readingfiles.py): `src/readingfiles.py`
- [Data Cleaning](https://github.com/skarshad1928/retail_store_analysis/blob/main/notebooks/DataCleaning%20and%20Feature%20Engineering.ipynb): `notebooks/DataCleaning and Feature Engineering.ipynb`
- [Data Checks](https://github.com/skarshad1928/retail_store_analysis/blob/main/src/transformations.py): `src/transformations.py`
- [Data Warehouse](https://github.com/skarshad1928/retail_store_analysis/tree/main/src): `src`

### Exploration

- [Data Catalog](https://github.com/skarshad1928/retail_store_analysis/blob/main/src/catalog.py): `src/catalog.py`
- [EDA Dashboard](https://github.com/skarshad1928/retail_store_analysis/blob/main/src/dashboard.py): `src/dashboard.py`
- [Data Exploration](https://github.com/skarshad1928/retail_store_analysis/blob/main/notebooks/Load%20and%20Understand.ipynb): `notebooks/Load and Understand.ipynb`

### Retail Analysis

- [RFM Analysis](https://github.com/skarshad1928/retail_store_analysis/blob/main/notebooks/RFM_Analysis.ipynb): `notebooks/RFM_Analysis.ipynb`
- [Product Segments](https://github.com/skarshad1928/retail_store_analysis/blob/main/notebooks/product_segment_analysis.ipynb): `notebooks/product_segment_analysis.ipynb`
- [Business Insights](https://github.com/skarshad1928/retail_store_analysis/tree/main/src): `src`

### Statistical Validation

- [Statistical Validation](https://github.com/skarshad1928/retail_store_analysis/tree/main/src): `src`

### Other components

- **Analyst**

## Connections

- Analyst → Spark Session: starts session (evidence: `src/spark_session.py`)
- Spark Session → File Reader: provides session (evidence: `src/readingfiles.py`)
- Analyst → File Reader: loads files
- File Reader → Data Cleaning: feeds workflow (evidence: `Readme.md`)
- Data Cleaning → Data Checks: checks data
- Data Cleaning → Data Warehouse: loads tables (evidence: `Readme.md`)
- Data Warehouse → Data Exploration: feeds analysis (evidence: `Readme.md`)
- Data Exploration → Data Catalog: inspects data
- Data Exploration → EDA Dashboard: visualizes data
- Data Warehouse → RFM Analysis: supports analysis
- Data Warehouse → Product Segments: supports analysis
- RFM Analysis → Statistical Validation: validates findings
- Product Segments → Business Insights: informs decisions (evidence: `Readme.md`)
- Statistical Validation → Business Insights: supports conclusions (evidence: `Readme.md`)
