# chaitanyaphatak/data-analytics-customer-behavior-project architecture

> Architecture diagram of the GitHub repository chaitanyaphatak/data-analytics-customer-behavior-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chaitanyaphatak/data-analytics-customer-behavior-project
- Repository: https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project

## Overview

1. **Repository purpose**
   - This is a customer behavior analytics project, not a production application.
   - The architecture is a simple analytics pipeline: **raw CSV data → Python cleaning/EDA → SQL analysis in PostgreSQL → Power BI dashboard → report/presentation outputs**.

2. **Data layer**
   - `data/raw_data/customer_shopping_behavior.csv` is the source dataset.
   - `data/processed_data/cleaned_data.csv` is the curated downstream dataset after preprocessing.
   - The raw/processed split is the main boundary between source data and analysis-ready data.

3. **Python analysis workspace**
   - `notebooks/Customer_Shopping_Behaviour_Analysis.ipynb` is the main computational environment.
   - It likely performs ingestion, cleaning, feature engineering, and exploratory analysis.
   - This notebook is the core transformation layer that turns the raw dataset into insights and a cleaned export.

4. **Preprocessing and feature engineering boundary**
   - The README indicates the notebook handles missing values, standardizes column names, and adds derived fields such as `age_group` and `purchase_frequency_days`.
   - This is the point where transactional data is normalized into a more analytics-friendly schema.
   - The cleaned output becomes the handoff artifact for both SQL and dashboarding.

5. **SQL / warehouse-style analysis layer**
   - `sql/customer_behavior_sql_queries.sql` contains the analytical queries.
   - The README says cleaned data is loaded into PostgreSQL, so SQL is the structured query layer over the prepared dataset.
   - This subsystem supports aggregation, segmentation, and KPI calculations separate from Python notebook exploration.

6. **Dashboarding / BI layer**
   - `visualizations/Customer_Behavior_Dashboard.pbix` is the presentation and interaction layer.
   - Power BI consumes the cleaned/queried data to provide interactive filtering by gender, category, and subscription status.
   - This is the main end-user interface for business consumers of the analysis.

7. **Business intelligence outputs**
   - The dashboard emphasizes KPIs such as total customers, average purchase value, and average rating.
   - It also surfaces revenue breakdowns, category trends, and segment comparisons.
   - These outputs are derived, not raw, and represent the final analytical product.

8. **Reporting / communication layer**
   - `report/Customer Shopping Behavior Analysis.pdf` and the `.pptx` presentation are communication artifacts.
   - They translate the analytical findings into a format suitable for stakeholders.
   - In architecture terms, these are terminal deliverables produced from the analytical pipeline rather than operational components.

9. **Supporting assets**
   - `img/` contains preview imagery used for documentation or presentation of the dashboard.
   - These assets do not affect computation, but they support the documentation and portfolio layer of the project.

10. **Environment and dependencies**
   - `requirements.txt` defines the Python analytics stack, centered on pandas/numpy and plotting libraries.
   - The README also references PostgreSQL and Power BI as major external tools, so the repo spans local Python analysis plus external data storage and BI visualization.

11. **End-to-end data flow**
   - The dominant flow is: raw CSV ingestion in the notebook → cleaning/feature engineering → export to `cleaned_data.csv` → load into PostgreSQL / query via SQL → visualize in Power BI → summarize in PDF/PPTX.
   - This is a classic offline analytics pipeline with clear stage separation.

12. **Key architectural boundary**
   - The most important boundary is between **data preparation** and **consumption**.
   - Python owns preparation and enrichment; SQL/PostgreSQL owns structured analytical access; Power BI owns interactive consumption; reports own static communication.
   - That separation is what should be reflected in any architecture diagram.

Main entry points: [`visualizations/Customer_Behavior_Dashboard.pbix`](https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/visualizations/Customer_Behavior_Dashboard.pbix) (Dashboard), [`notebooks/Customer_Shopping_Behaviour_Analysis.ipynb`](https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/notebooks/Customer_Shopping_Behaviour_Analysis.ipynb) (Analysis Notebook), [`data/processed_data/cleaned_data.csv`](https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/data/processed_data/cleaned_data.csv) (Cleaned CSV), [`sql/customer_behavior_sql_queries.sql`](https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/sql/customer_behavior_sql_queries.sql) (SQL Queries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data Layer"]
  node_raw_csv["Raw CSV<br/>source data"]
  node_cleaned_csv["Cleaned CSV<br/>curated data<br/>[cleaned_data.csv]"]
end

subgraph group_prep["Preparation"]
  node_notebook["Analysis Notebook<br/>python notebook"]
  node_cleaning["Cleaning<br/>prep step"]
  node_features["Features<br/>feature engineering"]
  node_eda["EDA<br/>analysis"]
end

subgraph group_analytics["SQL Analytics"]
  node_sql_file["SQL Queries<br/>sql script"]
  node_postgres[("PostgreSQL<br/>warehouse")]
end

subgraph group_bi["BI Layer"]
  node_dash["Dashboard<br/>power bi report"]
  node_kpis["KPIs<br/>metrics view"]
  node_segments["Segments<br/>analysis view"]
end

subgraph group_outputs["Outputs"]
  node_report_pdf["PDF Report<br/>static report"]
  node_report_ppt["Slides<br/>presentation"]
  node_images["Images<br/>supporting assets"]
end

subgraph group_docs["Project Docs"]
  node_readme["README<br/>project overview<br/>[README.md]"]
  node_requirements["Requirements<br/>python deps<br/>[requirements.txt]"]
end

node_raw_csv -->|"ingest"| node_notebook
node_notebook -->|"normalize"| node_cleaning
node_cleaning -->|"enrich"| node_features
node_features -->|"analyze"| node_eda
node_features -->|"export"| node_cleaned_csv
node_cleaned_csv -->|"load"| node_postgres
node_postgres -->|"query"| node_sql_file
node_postgres -->|"serve"| node_dash
node_sql_file -->|"metrics"| node_dash
node_dash -->|"display"| node_kpis
node_dash -->|"filter"| node_segments
node_kpis -->|"summarize"| node_report_pdf
node_segments -->|"present"| node_report_ppt
node_images -.->|"support"| node_report_ppt
node_readme -.->|"describe"| node_notebook
node_requirements -.->|"enable"| node_notebook

click node_raw_csv "https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/data/raw_data/customer_shopping_behavior.csv"
click node_cleaned_csv "https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/data/processed_data/cleaned_data.csv"
click node_notebook "https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/notebooks/Customer_Shopping_Behaviour_Analysis.ipynb"
click node_cleaning "https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/notebooks/Customer_Shopping_Behaviour_Analysis.ipynb"
click node_features "https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/notebooks/Customer_Shopping_Behaviour_Analysis.ipynb"
click node_eda "https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/notebooks/Customer_Shopping_Behaviour_Analysis.ipynb"
click node_sql_file "https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/sql/customer_behavior_sql_queries.sql"
click node_dash "https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/visualizations/Customer_Behavior_Dashboard.pbix"
click node_kpis "https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/visualizations/Customer_Behavior_Dashboard.pbix"
click node_segments "https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/visualizations/Customer_Behavior_Dashboard.pbix"
click node_report_pdf "https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/report/Customer Shopping Behavior Analysis.pdf"
click node_report_ppt "https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/report/Customer-Shopping-Behavior-Analysis (1).pptx"
click node_images "https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/tree/main/img"
click node_readme "https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/README.md"
click node_requirements "https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/requirements.txt"

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_raw_csv,node_cleaned_csv toneBlue
class node_notebook,node_cleaning,node_features,node_eda toneAmber
class node_sql_file,node_postgres toneMint
class node_dash,node_kpis,node_segments toneRose
class node_report_pdf,node_report_ppt,node_images toneIndigo
class node_readme,node_requirements toneTeal
```

## Components

### Data Layer

Raw and processed datasets forming the source-to-curated boundary.

- [Raw CSV](https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/data/raw_data/customer_shopping_behavior.csv): source data · Original customer shopping behavior dataset. · `data/raw_data/customer_shopping_behavior.csv`
- [Cleaned CSV](https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/data/processed_data/cleaned_data.csv): curated data · Processed analysis-ready dataset exported from Python. · `data/processed_data/cleaned_data.csv`

### Preparation

Python notebook workspace that cleans and enriches the data.

- [Analysis Notebook](https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/notebooks/Customer_Shopping_Behaviour_Analysis.ipynb): python notebook · Main Python workspace for ingestion, cleaning, feature engineering, and EDA. · `notebooks/Customer_Shopping_Behaviour_Analysis.ipynb`
- [Cleaning](https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/notebooks/Customer_Shopping_Behaviour_Analysis.ipynb): prep step · Handles missing values and standardizes column names. · `notebooks/Customer_Shopping_Behaviour_Analysis.ipynb`
- [Features](https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/notebooks/Customer_Shopping_Behaviour_Analysis.ipynb): feature engineering · Derives fields such as age groups and purchase frequency. · `notebooks/Customer_Shopping_Behaviour_Analysis.ipynb`
- [EDA](https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/notebooks/Customer_Shopping_Behaviour_Analysis.ipynb): analysis · Exploratory analysis used to surface patterns and insights. · `notebooks/Customer_Shopping_Behaviour_Analysis.ipynb`

### SQL Analytics

Structured query layer over prepared data in PostgreSQL.

- [SQL Queries](https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/sql/customer_behavior_sql_queries.sql): sql script · Analytical queries for segmentation, aggregation, and KPI calculations. · `sql/customer_behavior_sql_queries.sql`
- **PostgreSQL**: warehouse · Structured data store and query engine for analytical access.

### BI Layer

Interactive dashboarding and business consumption layer.

- [Dashboard](https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/visualizations/Customer_Behavior_Dashboard.pbix): power bi report · Interactive BI layer with filtering and KPI visualization. · `visualizations/Customer_Behavior_Dashboard.pbix`
- [KPIs](https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/visualizations/Customer_Behavior_Dashboard.pbix): metrics view · Core measures such as customer count, average purchase value, and rating. · `visualizations/Customer_Behavior_Dashboard.pbix`
- [Segments](https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/visualizations/Customer_Behavior_Dashboard.pbix): analysis view · Breakdowns by gender, category, and subscription status. · `visualizations/Customer_Behavior_Dashboard.pbix`

### Outputs

Static deliverables and supporting presentation assets.

- [PDF Report](https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/HEAD/report/Customer%20Shopping%20Behavior%20Analysis.pdf): static report · Formal written summary of findings for stakeholders. · `report/Customer Shopping Behavior Analysis.pdf`
- [Slides](https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/HEAD/report/Customer-Shopping-Behavior-Analysis%20(1).pptx): presentation · Presentation deck for communicating the analysis. · `report/Customer-Shopping-Behavior-Analysis (1).pptx`
- [Images](https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/tree/main/img): supporting assets · Preview and documentation imagery used alongside the project. · `img`

### Project Docs

Repository documentation and dependency definition.

- [README](https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/README.md): project overview · High-level description of the workflow, tools, and deliverables. · `README.md`
- [Requirements](https://github.com/chaitanyaphatak/data-analytics-customer-behavior-project/blob/main/requirements.txt): python deps · Python package dependencies for the analytics environment. · `requirements.txt`

## Connections

- Raw CSV → Analysis Notebook: ingest · Notebook reads the raw dataset for preparation and exploration.
- Analysis Notebook → Cleaning: normalize · Notebook performs missing-value handling and column standardization.
- Cleaning → Features: enrich · Prepared data is expanded with derived analytical fields.
- Features → EDA: analyze · Derived data is explored to identify trends and patterns.
- Features → Cleaned CSV: export · Notebook writes the curated dataset for downstream use.
- Cleaned CSV → PostgreSQL: load · Cleaned data is loaded into PostgreSQL for structured analysis.
- PostgreSQL → SQL Queries: query · SQL script expresses aggregations, segmentation, and KPI logic.
- PostgreSQL → Dashboard: serve · Prepared data feeds the dashboard model and visuals.
- SQL Queries → Dashboard: metrics · SQL-derived results support BI calculations and views.
- Dashboard → KPIs: display · Dashboard presents business summary measures.
- Dashboard → Segments: filter · Dashboard enables interactive breakdowns and comparisons.
- KPIs → PDF Report: summarize · Key findings are distilled into the written report.
- Segments → Slides: present · Segment insights are packaged into the presentation deck.
- Images → Slides: support · Preview assets support documentation and presentation materials.
- README → Analysis Notebook: describe · README documents the analysis workflow and notebook role.
- Requirements → Analysis Notebook: enable · Dependencies define the Python analytics environment.
