# bashutosh017/credit-card-approval-ml-model architecture

> Architecture diagram of the GitHub repository bashutosh017/credit-card-approval-ml-model, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bashutosh017/credit-card-approval-ml-model
- Repository: https://github.com/bashutosh017/credit-card-approval-ml-model

## Overview

This repository is a Flask web application for estimating credit-card approval likelihood. The main workflow is an applicant entering financial details in a two-step browser form, submitting them to the prediction endpoint, and receiving an approval estimate. The server validates and normalizes inputs, applies the serialized LightGBM model, and returns a result. It also serves landing and documentation pages. The README describes separate training and console-prediction modules, but those files are absent from the supplied tree; this map therefore covers the implemented web runtime only.

Main entry points: [`server.py`](https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/server.py) (Flask routes), [`static/js/app.js`](https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/static/js/app.js) (Assessment form), [`templates/index.html`](https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/templates/index.html) (Landing page), [`templates/docs.html`](https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/templates/docs.html) (Documentation page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_home["Landing page<br/>[index.html]"]
  node_docs["Documentation page<br/>[docs.html]"]
  node_check["Assessment page<br/>[check.html]"]
  node_form["Assessment form<br/>[app.js]"]
  node_client_validation["Client validation<br/>[app.js]"]
  node_result["Result display<br/>[app.js]"]
end

subgraph group_api["Prediction service"]
  node_flask["Flask routes<br/>[server.py]"]
  node_endpoint["Prediction endpoint<br/>[server.py]"]
  node_input_validation["Input validation<br/>[server.py]"]
  node_feature_prep["Feature preparation<br/>[server.py]"]
  node_inference["Model inference<br/>[server.py]"]
end

subgraph group_model["Inference assets"]
  node_approval_model["LightGBM model"]
  node_feature_schema["Model features<br/>[Model_feature2.pkl]"]
end

node_applicant(("Applicant"))

node_applicant -->|"requests pages"| node_flask
node_flask -->|"renders"| node_home
node_flask -->|"renders"| node_docs
node_flask -->|"renders"| node_check
node_applicant -->|"enters details"| node_form
node_form -->|"validates fields"| node_client_validation
node_client_validation -->|"posts JSON"| node_endpoint
node_endpoint -->|"validates payload"| node_input_validation
node_input_validation -->|"normalizes fields"| node_feature_prep
node_feature_prep -->|"prepares matrix"| node_inference
node_inference -->|"predicts probabilities"| node_approval_model
node_inference -->|"orders features"| node_feature_schema
node_endpoint -->|"returns JSON"| node_result
node_result -->|"shows estimate"| node_applicant

click node_flask "https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/server.py"
click node_home "https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/templates/index.html"
click node_docs "https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/templates/docs.html"
click node_check "https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/templates/check.html"
click node_form "https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/static/js/app.js"
click node_client_validation "https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/static/js/app.js"
click node_result "https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/static/js/app.js"
click node_endpoint "https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/server.py"
click node_input_validation "https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/server.py"
click node_feature_prep "https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/server.py"
click node_inference "https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/server.py"
click node_approval_model "https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/Lightgbm_credit2.pkl"
click node_feature_schema "https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/Model_feature2.pkl"

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_home,node_docs,node_check,node_form,node_client_validation,node_result toneBlue
class node_flask,node_endpoint,node_input_validation,node_feature_prep,node_inference toneAmber
class node_approval_model,node_feature_schema toneMint
class node_applicant toneIndigo
```

## Components

### Web interface

- [Landing page](https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/templates/index.html): `templates/index.html`
- [Documentation page](https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/templates/docs.html): `templates/docs.html`
- [Assessment page](https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/templates/check.html): `templates/check.html`
- [Assessment form](https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/static/js/app.js): `static/js/app.js`
- [Client validation](https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/static/js/app.js): `static/js/app.js`
- [Result display](https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/static/js/app.js): `static/js/app.js`

### Prediction service

- [Flask routes](https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/server.py): `server.py`
- [Prediction endpoint](https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/server.py): `server.py`
- [Input validation](https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/server.py): `server.py`
- [Feature preparation](https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/server.py): `server.py`
- [Model inference](https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/server.py): `server.py`

### Inference assets

- [LightGBM model](https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/Lightgbm_credit2.pkl): `Lightgbm_credit2.pkl`
- [Model features](https://github.com/bashutosh017/credit-card-approval-ml-model/blob/main/Model_feature2.pkl): `Model_feature2.pkl`

### Other components

- **Applicant**

## Connections

- Applicant → Flask routes: requests pages (evidence: `server.py`)
- Flask routes → Landing page: renders (evidence: `server.py`)
- Flask routes → Documentation page: renders (evidence: `server.py`)
- Flask routes → Assessment page: renders (evidence: `server.py`)
- Applicant → Assessment form: enters details (evidence: `static/js/app.js`)
- Assessment form → Client validation: validates fields (evidence: `static/js/app.js`)
- Client validation → Prediction endpoint: posts JSON (evidence: `static/js/app.js`)
- Prediction endpoint → Input validation: validates payload (evidence: `server.py`)
- Input validation → Feature preparation: normalizes fields (evidence: `server.py`)
- Feature preparation → Model inference: prepares matrix (evidence: `server.py`)
- Model inference → LightGBM model: predicts probabilities (evidence: `server.py`)
- Model inference → Model features: orders features (evidence: `server.py`)
- Prediction endpoint → Result display: returns JSON (evidence: `static/js/app.js`)
- Result display → Applicant: shows estimate (evidence: `static/js/app.js`)
