# iyadidier/customer-churn-retention-analytics architecture

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

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

## Overview

StreamPlus is a customer churn and retention analytics project. Its main workflow inspects and cleans customer data, analyzes churn and segments, assigns explainable risk levels, then produces reports and visualizations for retention review. README documents notebooks and SQL as analysis stages; sampled Python confirms the reporting and visualization scripts read the processed dataset and write outputs. Source for notebooks and SQL was not sampled, so their internal calls and detailed wiring are not inferred.

Main entry points: [`data/processed`](https://github.com/iyadidier/customer-churn-retention-analytics/tree/main/data/processed) (Processed customers), [`reports`](https://github.com/iyadidier/customer-churn-retention-analytics/tree/main/reports) (CSV reports), [`database`](https://github.com/iyadidier/customer-churn-retention-analytics/tree/main/database) (SQLite database), [`data/raw`](https://github.com/iyadidier/customer-churn-retention-analytics/tree/main/data/raw) (Raw customer data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Data preparation"]
  node_raw["Raw customer data"]
  node_explore["Data exploration"]
  node_clean["Data cleaning"]
  node_processed["Processed customers"]
end

subgraph group_analysis["Churn analysis"]
  node_churn["Churn analysis"]
  node_risk["Risk scoring"]
  node_segments["Customer segments"]
end

subgraph group_outputs["Decision outputs"]
  node_reporter["Report generation"]
  node_reports["CSV reports"]
  node_visualizer["Visualization export"]
  node_charts["Churn charts"]
  node_validator["Result validation"]
end

subgraph group_sql["SQL analytics"]
  node_schema["SQLite schema<br/>[schema.sql]"]
  node_sqlchurn["SQL churn analysis<br/>[churn_analysis.sql]"]
  node_database[("SQLite database")]
end

node_provider(("Dataset provider"))
node_management(("Retention decision-makers"))

node_provider -->|"provides data"| node_raw
node_raw -->|"inspected by"| node_explore
node_explore -->|"informs cleaning"| node_clean
node_clean -->|"writes dataset"| node_processed
node_processed -->|"analyzed by"| node_churn
node_processed -->|"read by"| node_reporter
node_reporter -->|"writes CSVs"| node_reports
node_processed -->|"read by"| node_visualizer
node_visualizer -->|"writes charts"| node_charts
node_processed -->|"read by"| node_validator
node_reports -->|"validated by"| node_validator
node_reports -->|"supports review"| node_management
node_charts -->|"supports review"| node_management
node_schema -->|"defines schema"| node_database
node_database -->|"queried by"| node_sqlchurn
node_database -->|"queried by"| node_segments

click node_raw "https://github.com/iyadidier/customer-churn-retention-analytics/tree/main/data/raw"
click node_explore "https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/notebooks/01_data_exploration.ipynb"
click node_clean "https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/notebooks/02_data_cleaning.ipynb"
click node_processed "https://github.com/iyadidier/customer-churn-retention-analytics/tree/main/data/processed"
click node_churn "https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/notebooks/03_churn_analysis.ipynb"
click node_risk "https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/python/generate_reports.py"
click node_segments "https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/sql/customer_segments.sql"
click node_schema "https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/sql/schema.sql"
click node_sqlchurn "https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/sql/churn_analysis.sql"
click node_database "https://github.com/iyadidier/customer-churn-retention-analytics/tree/main/database"
click node_reporter "https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/python/generate_reports.py"
click node_reports "https://github.com/iyadidier/customer-churn-retention-analytics/tree/main/reports"
click node_visualizer "https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/python/export_visualizations.py"
click node_charts "https://github.com/iyadidier/customer-churn-retention-analytics/tree/main/visualizations"
click node_validator "https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/python/validate_results.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_raw,node_explore,node_clean,node_processed toneBlue
class node_churn,node_risk,node_segments toneAmber
class node_reporter,node_reports,node_visualizer,node_charts,node_validator toneMint
class node_schema,node_sqlchurn,node_database toneRose
class node_provider,node_management toneIndigo
```

## Components

### Data preparation

- [Raw customer data](https://github.com/iyadidier/customer-churn-retention-analytics/tree/main/data/raw): `data/raw`
- [Data exploration](https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/notebooks/01_data_exploration.ipynb): `notebooks/01_data_exploration.ipynb`
- [Data cleaning](https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/notebooks/02_data_cleaning.ipynb): `notebooks/02_data_cleaning.ipynb`
- [Processed customers](https://github.com/iyadidier/customer-churn-retention-analytics/tree/main/data/processed): `data/processed`

### Churn analysis

- [Churn analysis](https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/notebooks/03_churn_analysis.ipynb): `notebooks/03_churn_analysis.ipynb`
- [Risk scoring](https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/python/generate_reports.py): `python/generate_reports.py`
- [Customer segments](https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/sql/customer_segments.sql): `sql/customer_segments.sql`

### Decision outputs

- [Report generation](https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/python/generate_reports.py): `python/generate_reports.py`
- [CSV reports](https://github.com/iyadidier/customer-churn-retention-analytics/tree/main/reports): `reports`
- [Visualization export](https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/python/export_visualizations.py): `python/export_visualizations.py`
- [Churn charts](https://github.com/iyadidier/customer-churn-retention-analytics/tree/main/visualizations): `visualizations`
- [Result validation](https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/python/validate_results.py): `python/validate_results.py`

### SQL analytics

- [SQLite schema](https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/sql/schema.sql): `sql/schema.sql`
- [SQL churn analysis](https://github.com/iyadidier/customer-churn-retention-analytics/blob/main/sql/churn_analysis.sql): `sql/churn_analysis.sql`
- [SQLite database](https://github.com/iyadidier/customer-churn-retention-analytics/tree/main/database): `database`

### Other components

- **Dataset provider**
- **Retention decision-makers**

## Connections

- Dataset provider → Raw customer data: provides data
- Raw customer data → Data exploration: inspected by
- Data exploration → Data cleaning: informs cleaning
- Data cleaning → Processed customers: writes dataset
- Processed customers → Churn analysis: analyzed by
- Processed customers → Report generation: read by
- Report generation → CSV reports: writes CSVs
- Processed customers → Visualization export: read by
- Visualization export → Churn charts: writes charts
- Processed customers → Result validation: read by
- CSV reports → Result validation: validated by
- CSV reports → Retention decision-makers: supports review
- Churn charts → Retention decision-makers: supports review
- SQLite schema → SQLite database: defines schema
- SQLite database → SQL churn analysis: queried by
- SQLite database → Customer segments: queried by
