# rajesh-giduthuri/customer-churn-prediction architecture

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

- Interactive diagram: https://gitdiagram.com/rajesh-giduthuri/customer-churn-prediction
- Repository: https://github.com/rajesh-giduthuri/customer-churn-prediction

## Overview

This is a FastAPI customer-churn prediction app. A browser or API client submits customer attributes; FastAPI validates them against the Customer schema, the app passes the resulting feature row to the loaded classifier, and the client receives a churn prediction. The app also serves a browser page. The README lists feature-importance analysis, but the sampled runtime code does not show that behavior; its relationship to the notebook is therefore unverified. Evidence is limited to the README and sampled source excerpts.

Main entry points: [`app.py`](https://github.com/rajesh-giduthuri/customer-churn-prediction/blob/main/app.py) (FastAPI app), [`classifier.pkl`](https://github.com/rajesh-giduthuri/customer-churn-prediction/blob/main/classifier.pkl) (Churn classifier), [`templates/index.html`](https://github.com/rajesh-giduthuri/customer-churn-prediction/blob/main/templates/index.html) (Customer form page), [`Customer.py`](https://github.com/rajesh-giduthuri/customer-churn-prediction/blob/main/Customer.py) (Customer schema)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_serving["Web interface"]
  node_app["FastAPI app<br/>[app.py]"]
  node_page["Customer form page<br/>[index.html]"]
end

subgraph group_prediction["Prediction"]
  node_customer["Customer schema<br/>[Customer.py]"]
end

subgraph group_analytics["Model and analysis"]
  node_classifier["Churn classifier<br/>[classifier.pkl]"]
  node_feature_analysis["Feature importance"]
end

node_client(("Browser / API client"))

node_client -->|"requests page"| node_app
node_app -->|"serves page"| node_page
node_client -->|"submits attributes"| node_app
node_app -->|"validates with"| node_customer
node_app -->|"loads and predicts"| node_classifier
node_app -->|"returns prediction"| node_client
node_classifier -.->|"analyzed by"| node_feature_analysis

click node_app "https://github.com/rajesh-giduthuri/customer-churn-prediction/blob/main/app.py"
click node_page "https://github.com/rajesh-giduthuri/customer-churn-prediction/blob/main/templates/index.html"
click node_customer "https://github.com/rajesh-giduthuri/customer-churn-prediction/blob/main/Customer.py"
click node_classifier "https://github.com/rajesh-giduthuri/customer-churn-prediction/blob/main/classifier.pkl"
click node_feature_analysis "https://github.com/rajesh-giduthuri/customer-churn-prediction/blob/main/customer_churn.ipynb"

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_app,node_page,node_client toneBlue
class node_customer toneAmber
class node_classifier,node_feature_analysis toneMint
```

## Components

### Web interface

- [FastAPI app](https://github.com/rajesh-giduthuri/customer-churn-prediction/blob/main/app.py): `app.py`
- [Customer form page](https://github.com/rajesh-giduthuri/customer-churn-prediction/blob/main/templates/index.html): `templates/index.html`

### Prediction

- [Customer schema](https://github.com/rajesh-giduthuri/customer-churn-prediction/blob/main/Customer.py): `Customer.py`

### Model and analysis

- [Churn classifier](https://github.com/rajesh-giduthuri/customer-churn-prediction/blob/main/classifier.pkl): `classifier.pkl`
- [Feature importance](https://github.com/rajesh-giduthuri/customer-churn-prediction/blob/main/customer_churn.ipynb): `customer_churn.ipynb`

### Other components

- **Browser / API client**

## Connections

- Browser / API client → FastAPI app: requests page (evidence: `app.py`)
- FastAPI app → Customer form page: serves page (evidence: `app.py`)
- Browser / API client → FastAPI app: submits attributes (evidence: `README.md`)
- FastAPI app → Customer schema: validates with (evidence: `app.py`)
- FastAPI app → Churn classifier: loads and predicts (evidence: `app.py`)
- FastAPI app → Browser / API client: returns prediction (evidence: `app.py`)
- Churn classifier → Feature importance: analyzed by
