# mudadlachandrasekhar74-art/customer-360-churn-prediction architecture

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

- Interactive diagram: https://gitdiagram.com/mudadlachandrasekhar74-art/customer-360-churn-prediction
- Repository: https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction

## Overview

This repository is an Olist e-commerce Customer 360 and churn-intelligence platform. Its principal workflow extracts raw transaction CSVs, validates and cleans them, builds a dimensional warehouse, derives customer features and segments, labels churn, trains and applies a churn model, then exposes scores and customer analytics in a dashboard and business reports. The graph also preserves the documented data-quality audit and star-schema capabilities. Some subsystem links are based on README architecture and execution guidance; unsampled implementation details are not inferred.

Main entry points: [`src/pipeline.py`](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/pipeline.py) (ETL Orchestrator), [`data/processed`](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/tree/main/data/processed) (Analytical Warehouse), [`src/analytics/customer_360.py`](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/analytics/customer_360.py) (Customer 360 Features), [`src/ml/batch_inference.py`](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/ml/batch_inference.py) (Batch Inference)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Ingestion and Quality"]
  node_etl["ETL Orchestrator<br/>[pipeline.py]"]
  node_extract["CSV Extraction<br/>[extractor.py]"]
  node_schema_validation["Schema Contracts"]
  node_quality_audit["Data Quality Audit<br/>[data_quality.py]"]
end

subgraph group_warehouse["Warehouse Engineering"]
  node_cleaning["Data Cleaning<br/>[cleaner.py]"]
  node_star_transform["Star Schema Transform<br/>[transformer.py]"]
  node_star_builder["Star Schema Builder"]
  node_warehouse_loader["Warehouse Loader<br/>[loader.py]"]
  node_warehouse_db[("Analytical Warehouse")]
end

subgraph group_analytics["Customer Analytics"]
  node_customer360["Customer 360 Features<br/>[customer_360.py]"]
  node_segmentation["Customer Segmentation<br/>[segmentation.py]"]
  node_churn_labels["Churn Labeling"]
end

subgraph group_ml["Churn Intelligence"]
  node_model_training["Churn Model Training<br/>[churn_model.py]"]
  node_champion_model["Champion Model"]
  node_batch_scoring["Batch Inference<br/>[batch_inference.py]"]
  node_scores[("Churn Scores<br/>[churn_scores.csv]")]
end

subgraph group_delivery["Business Delivery"]
  node_inference_report["Inference Reports"]
  node_report_artifacts["Business Reports"]
  node_dashboard_api["Dashboard API<br/>[app.py]"]
  node_dashboard_ui["Dashboard UI<br/>[index.html]"]
end

node_source_data["Raw Olist CSVs"]
node_crm(("Retention Workflows"))
node_user(("Business User"))

node_source_data -->|"provides CSVs"| node_extract
node_etl -->|"runs extraction"| node_extract
node_etl -->|"validates schemas"| node_schema_validation
node_etl -->|"cleans data"| node_cleaning
node_etl -->|"builds tables"| node_star_transform
node_etl -->|"loads tables"| node_warehouse_loader
node_etl -->|"runs scoring"| node_batch_scoring
node_etl -->|"generates report"| node_inference_report
node_quality_audit -->|"audits datasets"| node_source_data
node_warehouse_loader -->|"writes tables"| node_warehouse_db
node_star_transform -->|"supplies tables"| node_warehouse_loader
node_star_builder -.->|"builds warehouse"| node_warehouse_loader
node_warehouse_db -->|"provides dimensions"| node_customer360
node_customer360 -->|"writes features"| node_warehouse_db
node_customer360 -->|"profiles segments"| node_segmentation
node_customer360 -->|"supports labeling"| node_churn_labels
node_churn_labels -->|"supplies labels"| node_model_training
node_model_training -->|"exports model"| node_champion_model
node_champion_model -->|"scores with"| node_batch_scoring
node_batch_scoring -->|"reads features"| node_warehouse_db
node_batch_scoring -->|"writes scores"| node_scores
node_inference_report -->|"reads scored data"| node_warehouse_db
node_inference_report -->|"exports reports"| node_report_artifacts
node_dashboard_api -->|"queries analytics"| node_warehouse_db
node_dashboard_api -->|"serves page"| node_dashboard_ui
node_user -->|"views analytics"| node_dashboard_api
node_dashboard_ui -->|"guides retention"| node_crm

click node_source_data "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/tree/main/data/raw"
click node_etl "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/pipeline.py"
click node_extract "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/ingestion/extractor.py"
click node_schema_validation "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/validation/schema_validator.py"
click node_quality_audit "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/validation/data_quality.py"
click node_cleaning "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/transformation/cleaner.py"
click node_star_transform "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/transformation/transformer.py"
click node_star_builder "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/transformation/build_star_schema.py"
click node_warehouse_loader "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/loading/loader.py"
click node_warehouse_db "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/tree/main/data/processed"
click node_customer360 "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/analytics/customer_360.py"
click node_segmentation "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/analytics/segmentation.py"
click node_churn_labels "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/analytics/churn_definition.py"
click node_model_training "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/ml/churn_model.py"
click node_champion_model "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/ml/churn_champion_pipeline.joblib"
click node_batch_scoring "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/ml/batch_inference.py"
click node_scores "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/data/processed/churn_scores.csv"
click node_inference_report "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/ml/inference_report.py"
click node_report_artifacts "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/tree/main/reports"
click node_dashboard_api "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/dashboard/app.py"
click node_dashboard_ui "https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/dashboard/templates/index.html"

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_etl,node_extract,node_schema_validation,node_quality_audit,node_user toneBlue
class node_cleaning,node_star_transform,node_star_builder,node_warehouse_loader,node_warehouse_db toneAmber
class node_customer360,node_segmentation,node_churn_labels toneMint
class node_model_training,node_champion_model,node_batch_scoring,node_scores toneRose
class node_inference_report,node_report_artifacts,node_dashboard_api,node_dashboard_ui,node_crm toneIndigo
class node_source_data toneTeal
```

## Components

### Ingestion and Quality

- [ETL Orchestrator](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/pipeline.py): `src/pipeline.py`
- [CSV Extraction](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/ingestion/extractor.py): `src/ingestion/extractor.py`
- [Schema Contracts](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/validation/schema_validator.py): `src/validation/schema_validator.py`
- [Data Quality Audit](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/validation/data_quality.py): `src/validation/data_quality.py`

### Warehouse Engineering

- [Data Cleaning](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/transformation/cleaner.py): `src/transformation/cleaner.py`
- [Star Schema Transform](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/transformation/transformer.py): `src/transformation/transformer.py`
- [Star Schema Builder](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/transformation/build_star_schema.py): `src/transformation/build_star_schema.py`
- [Warehouse Loader](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/loading/loader.py): `src/loading/loader.py`
- [Analytical Warehouse](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/tree/main/data/processed): `data/processed`

### Customer Analytics

- [Customer 360 Features](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/analytics/customer_360.py): `src/analytics/customer_360.py`
- [Customer Segmentation](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/analytics/segmentation.py): `src/analytics/segmentation.py`
- [Churn Labeling](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/analytics/churn_definition.py): `src/analytics/churn_definition.py`

### Churn Intelligence

- [Churn Model Training](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/ml/churn_model.py): `src/ml/churn_model.py`
- [Champion Model](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/ml/churn_champion_pipeline.joblib): `src/ml/churn_champion_pipeline.joblib`
- [Batch Inference](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/ml/batch_inference.py): `src/ml/batch_inference.py`
- [Churn Scores](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/data/processed/churn_scores.csv): `data/processed/churn_scores.csv`

### Business Delivery

- [Inference Reports](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/src/ml/inference_report.py): `src/ml/inference_report.py`
- [Business Reports](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/tree/main/reports): `reports`
- [Dashboard API](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/dashboard/app.py): `dashboard/app.py`
- [Dashboard UI](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/blob/main/dashboard/templates/index.html): `dashboard/templates/index.html`

### Other components

- [Raw Olist CSVs](https://github.com/mudadlachandrasekhar74-art/customer-360-churn-prediction/tree/main/data/raw): `data/raw`
- **Retention Workflows**
- **Business User**

## Connections

- Raw Olist CSVs → CSV Extraction: provides CSVs (evidence: `src/ingestion/extractor.py`)
- ETL Orchestrator → CSV Extraction: runs extraction (evidence: `src/pipeline.py`)
- ETL Orchestrator → Schema Contracts: validates schemas (evidence: `src/pipeline.py`)
- ETL Orchestrator → Data Cleaning: cleans data (evidence: `src/pipeline.py`)
- ETL Orchestrator → Star Schema Transform: builds tables (evidence: `README.md`)
- ETL Orchestrator → Warehouse Loader: loads tables (evidence: `src/pipeline.py`)
- ETL Orchestrator → Batch Inference: runs scoring (evidence: `src/pipeline.py`)
- ETL Orchestrator → Inference Reports: generates report (evidence: `src/pipeline.py`)
- Data Quality Audit → Raw Olist CSVs: audits datasets (evidence: `src/validation/data_quality.py`)
- Warehouse Loader → Analytical Warehouse: writes tables (evidence: `src/loading/loader.py`)
- Star Schema Transform → Warehouse Loader: supplies tables (evidence: `README.md`)
- Star Schema Builder → Warehouse Loader: builds warehouse
- Analytical Warehouse → Customer 360 Features: provides dimensions (evidence: `src/analytics/customer_360.py`)
- Customer 360 Features → Analytical Warehouse: writes features (evidence: `src/analytics/customer_360.py`)
- Customer 360 Features → Customer Segmentation: profiles segments (evidence: `README.md`)
- Customer 360 Features → Churn Labeling: supports labeling (evidence: `README.md`)
- Churn Labeling → Churn Model Training: supplies labels (evidence: `README.md`)
- Churn Model Training → Champion Model: exports model (evidence: `README.md`)
- Champion Model → Batch Inference: scores with (evidence: `README.md`)
- Batch Inference → Analytical Warehouse: reads features (evidence: `README.md`)
- Batch Inference → Churn Scores: writes scores (evidence: `README.md`)
- Inference Reports → Analytical Warehouse: reads scored data (evidence: `src/ml/inference_report.py`)
- Inference Reports → Business Reports: exports reports (evidence: `src/ml/inference_report.py`)
- Dashboard API → Analytical Warehouse: queries analytics (evidence: `dashboard/app.py`)
- Dashboard API → Dashboard UI: serves page (evidence: `README.md`)
- Business User → Dashboard API: views analytics (evidence: `README.md`)
- Dashboard UI → Retention Workflows: guides retention (evidence: `README.md`)
