# sahbimlesh007/customer-churn---retention-analytics-system architecture

> Architecture diagram of the GitHub repository sahbimlesh007/customer-churn---retention-analytics-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sahbimlesh007/customer-churn---retention-analytics-system
- Repository: https://github.com/sahbimlesh007/customer-churn---retention-analytics-system

## Overview

This is an end-to-end telecom churn analytics and prediction project. Its documented workflow starts with customer data, develops SQL and Python analyses and churn models, and presents findings through Power BI and a Streamlit prediction interface. The graph preserves documented segmentation, revenue-risk analysis, and business insights. The notebook and SQL internals were not sampled, so their detailed calls and data transformations are not inferred; README statements support the broad workflow.

Main entry points: [`streamlit/app.py`](https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/streamlit/app.py) (Streamlit App), [`sql/create_BIviews.sql`](https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/sql/create_BIviews.sql) (BI Views), [`notebooks/customer_churn_eda.ipynb`](https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/notebooks/customer_churn_eda.ipynb) (Exploratory Analysis), [`notebooks/logistic_churn_model.pkl`](https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/notebooks/logistic_churn_model.pkl) (Churn Model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data Foundation"]
  node_dataset["Telco Dataset"]
  node_mysql[("MySQL Database<br/>[create_db.sql]")]
  node_schema[("Customer Tables<br/>[create_table.sql]")]
  node_clean[("Cleaned Data")]
  node_views[("BI Views<br/>[create_BIviews.sql]")]
end

subgraph group_analytics["Churn Analytics"]
  node_eda["Exploratory Analysis"]
  node_segments["Customer Segments"]
  node_model["Churn Model"]
  node_artifacts["Model Artifacts<br/>[model_features.pkl]"]
end

subgraph group_delivery["Decision Products"]
  node_dashboard["Power BI Dashboard"]
  node_app["Streamlit App<br/>[app.py]"]
  node_prediction["Risk Prediction<br/>[app.py]"]
  node_insights["Business Insights<br/>[app.py]"]
end

node_analyst(("Analyst"))

node_dataset -->|"loads into"| node_mysql
node_mysql -->|"defines tables"| node_schema
node_schema -->|"prepares data"| node_clean
node_clean -->|"supports analysis"| node_views
node_views -->|"feeds analysis"| node_eda
node_eda -->|"identifies segments"| node_segments
node_eda -->|"informs modeling"| node_model
node_model -->|"saved as"| node_artifacts
node_views -->|"informs dashboard"| node_dashboard
node_analyst -->|"enters customer data"| node_app
node_app -->|"loads model inputs"| node_artifacts
node_app -->|"predicts churn"| node_model
node_app -->|"shows risk score"| node_prediction
node_app -->|"shows insights"| node_insights
node_dashboard -->|"precedes deployment"| node_app
node_segments -->|"supports segmentation"| node_dashboard

click node_dataset "https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/dataset/Telco-Customer-Churn.csv"
click node_mysql "https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/sql/create_db.sql"
click node_schema "https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/sql/create_table.sql"
click node_clean "https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/sql/create_cleaned_table.sql"
click node_views "https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/sql/create_BIviews.sql"
click node_eda "https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/notebooks/customer_churn_eda.ipynb"
click node_segments "https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/notebooks/customer_churn_eda.ipynb"
click node_model "https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/notebooks/logistic_churn_model.pkl"
click node_artifacts "https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/notebooks/model_features.pkl"
click node_dashboard "https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/powerbi/IBM%20Telco%20Customer%20Churn%20Analytics.pbix"
click node_app "https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/streamlit/app.py"
click node_prediction "https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/streamlit/app.py"
click node_insights "https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/streamlit/app.py"

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_dataset,node_mysql,node_schema,node_clean,node_views toneBlue
class node_eda,node_segments,node_model,node_artifacts toneAmber
class node_dashboard,node_app,node_prediction,node_insights toneMint
class node_analyst toneIndigo
```

## Components

### Data Foundation

- [Telco Dataset](https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/dataset/Telco-Customer-Churn.csv): `dataset/Telco-Customer-Churn.csv`
- [MySQL Database](https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/sql/create_db.sql): `sql/create_db.sql`
- [Customer Tables](https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/sql/create_table.sql): `sql/create_table.sql`
- [Cleaned Data](https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/sql/create_cleaned_table.sql): `sql/create_cleaned_table.sql`
- [BI Views](https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/sql/create_BIviews.sql): `sql/create_BIviews.sql`

### Churn Analytics

- [Exploratory Analysis](https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/notebooks/customer_churn_eda.ipynb): `notebooks/customer_churn_eda.ipynb`
- [Customer Segments](https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/notebooks/customer_churn_eda.ipynb): `notebooks/customer_churn_eda.ipynb`
- [Churn Model](https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/notebooks/logistic_churn_model.pkl): `notebooks/logistic_churn_model.pkl`
- [Model Artifacts](https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/notebooks/model_features.pkl): `notebooks/model_features.pkl`

### Decision Products

- [Power BI Dashboard](https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/powerbi/IBM%20Telco%20Customer%20Churn%20Analytics.pbix): `powerbi/IBM Telco Customer Churn Analytics.pbix`
- [Streamlit App](https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/streamlit/app.py): `streamlit/app.py`
- [Risk Prediction](https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/streamlit/app.py): `streamlit/app.py`
- [Business Insights](https://github.com/sahbimlesh007/customer-churn---retention-analytics-system/blob/main/streamlit/app.py): `streamlit/app.py`

### Other components

- **Analyst**

## Connections

- Telco Dataset → MySQL Database: loads into (evidence: `README.md`)
- MySQL Database → Customer Tables: defines tables (evidence: `README.md`)
- Customer Tables → Cleaned Data: prepares data (evidence: `README.md`)
- Cleaned Data → BI Views: supports analysis (evidence: `README.md`)
- BI Views → Exploratory Analysis: feeds analysis (evidence: `README.md`)
- Exploratory Analysis → Customer Segments: identifies segments (evidence: `README.md`)
- Exploratory Analysis → Churn Model: informs modeling (evidence: `README.md`)
- Churn Model → Model Artifacts: saved as (evidence: `README.md`)
- BI Views → Power BI Dashboard: informs dashboard (evidence: `README.md`)
- Analyst → Streamlit App: enters customer data (evidence: `streamlit/app.py`)
- Streamlit App → Model Artifacts: loads model inputs (evidence: `streamlit/app.py`)
- Streamlit App → Churn Model: predicts churn (evidence: `streamlit/app.py`)
- Streamlit App → Risk Prediction: shows risk score (evidence: `streamlit/app.py`)
- Streamlit App → Business Insights: shows insights (evidence: `streamlit/app.py`)
- Power BI Dashboard → Streamlit App: precedes deployment (evidence: `README.md`)
- Customer Segments → Power BI Dashboard: supports segmentation (evidence: `README.md`)
