# muhammederbay10/end-to-end-loan-eligibility-prediction-system- architecture

> Architecture diagram of the GitHub repository muhammederbay10/end-to-end-loan-eligibility-prediction-system-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/muhammederbay10/end-to-end-loan-eligibility-prediction-system-
- Repository: https://github.com/muhammederbay10/end-to-end-loan-eligibility-prediction-system-

## Overview

##### Project type and purpose
- This is an end-to-end, monolithic ML web application built with Flask.
- Purpose: ingest raw loan data, preprocess it, train and serialize a model pipeline, and serve real-time loan-eligibility predictions via a web interface.

##### File structure
- Top-level components:
- app.py             – Flask server & controller
- custom_transformers.py – preprocessing helpers
- Data/              – raw CSV datasets (train/test)
- model/             – serialized pipeline (`model.joblib`)
- static/            – CSS styling
- templates/         – HTML view
- requirements.txt, Procfile, runtime.txt – deployment configs
- Bank Loan approval.ipynb – exploratory & training notebook
- Patterns:
- MVC-style separation:
– Model: scikit-learn pipeline (in model/) + custom transformers
– View: HTML/CSS in templates/ + static/
– Controller: Flask routes in app.py
- Pipeline persists artifacts (joblib) and reloads at runtime.

##### Key insights from README
- Workflow:
1. Load CSV → clean/impute → encode/scale → train & tune multiple classifiers → select best → joblib serialize → Flask deploy
- Dependencies: pandas, scikit-learn, Flask, joblib, XGBoost
- Deployment target: Railway/Heroku via Procfile & runtime.txt

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Online Runtime Layer
    subgraph "Online Runtime"
        direction TB
        subgraph "Frontend"
            direction TB
            UI["index.html"]:::frontend
            CSS["style.css"]:::frontend
        end
        subgraph "Backend"
            direction TB
            Flask["Flask App (app.py)"]:::backend
            CT["Custom Transformers (custom_transformers.py)"]:::backend
            Pipeline["ML Pipeline"]:::backend
            Model["Model Artifact (model.joblib)"]:::data
        end
    end

    %% Offline Training Layer
    subgraph "Offline Training"
        direction TB
        Notebook["Notebook"]:::offline
        CSVTrain["Training Data (loan-train.csv)"]:::data
        CSVTest["Test Data (loan-test.csv)"]:::data
        Notebook --> CSVTrain
        Notebook --> CSVTest
        Notebook -->|"train & serialize"| ModelOffline["Model Artifact"]:::data
    end

    %% Deployment Configuration
    subgraph "Deployment Configuration"
        direction TB
        Proc["Procfile"]:::deploy
        Runtime["runtime.txt"]:::deploy
        Req["requirements.txt"]:::deploy
    end

    %% Online Flow
    UI -->|"User Input"| Flask
    CSS --> Flask
    Flask --> CT
    CT --> Pipeline
    Pipeline -->|predict| Flask
    Flask -->|"Render Result"| UI

    %% Deployment Flow
    Proc --> Flask
    Runtime --> Flask
    Req --> Flask

    %% Click Events
    click UI "https://github.com/muhammederbay10/end-to-end-loan-eligibility-prediction-system-/blob/main/templates/index.html"
    click CSS "https://github.com/muhammederbay10/end-to-end-loan-eligibility-prediction-system-/blob/main/static/style.css"
    click Flask "https://github.com/muhammederbay10/end-to-end-loan-eligibility-prediction-system-/blob/main/app.py"
    click CT "https://github.com/muhammederbay10/end-to-end-loan-eligibility-prediction-system-/blob/main/custom_transformers.py"
    click Model "https://github.com/muhammederbay10/end-to-end-loan-eligibility-prediction-system-/blob/main/model/model.joblib"
    click CSVTrain "https://github.com/muhammederbay10/end-to-end-loan-eligibility-prediction-system-/blob/main/Data/loan-train.csv"
    click CSVTest "https://github.com/muhammederbay10/end-to-end-loan-eligibility-prediction-system-/blob/main/Data/loan-test.csv"
    click Notebook "https://github.com/muhammederbay10/end-to-end-loan-eligibility-prediction-system-/blob/main/Bank Loan approval.ipynb"
    click Proc "https://github.com/muhammederbay10/end-to-end-loan-eligibility-prediction-system-/tree/main/Procfile"
    click Runtime "https://github.com/muhammederbay10/end-to-end-loan-eligibility-prediction-system-/blob/main/runtime.txt"
    click Req "https://github.com/muhammederbay10/end-to-end-loan-eligibility-prediction-system-/blob/main/requirements.txt"

    %% Styling
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef backend fill:#87CEFA,stroke:#000,stroke-width:1px
    classDef data fill:#FFD700,stroke:#000,stroke-width:1px
    classDef offline fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef deploy fill:#98FB98,stroke:#000,stroke-width:1px
```
