# shashivardan-jarpati/fraud-detection-using-machine-learning architecture

> Architecture diagram of the GitHub repository shashivardan-jarpati/fraud-detection-using-machine-learning, 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/shashivardan-jarpati/fraud-detection-using-machine-learning
- Repository: https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning

## Overview

This repository contains Flask-based banking-fraud detection applications, including a root app and a more feature-rich copy under `Fraud Detection Only Python/`. The documented user journey is CSV upload and preview, preprocessing and train/test split, training and metric review for three boosting models, then batch prediction using LightGBM. The sampled files show route logic and model handling in the apps; the deeper app also defines processing and utility capabilities. The two app trees appear duplicated, so their components are shown separately where the tree supports that distinction. Several documented capabilities are not wired visibly in the excerpts; those relationships are omitted or marked unverified.

Main entry points: [`app.py`](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/app.py) (Root workflow routes), [`Fraud Detection Only Python/app.py`](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/Fraud%20Detection%20Only%20Python/app.py) (Extended workflow routes), [`templates/index.html`](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/templates/index.html) (Root dashboard), [`templates/catboost_metrics.html`](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/templates/catboost_metrics.html) (CatBoost metrics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_root_app["Root Flask app"]
  node_root_routes["Root workflow routes<br/>[app.py]"]
  node_root_data[("Uploaded dataset<br/>[app.py]")]
  node_root_split["Train test split<br/>[app.py]"]
  node_root_models["Boosting models<br/>[app.py]"]
  node_root_predict["Batch prediction<br/>[app.py]"]
end

subgraph group_full_app["Extended Flask app"]
  node_extended_routes["Extended workflow routes<br/>[app.py]"]
  node_extended_data["Dataset processing<br/>[app.py]"]
  node_extended_models["Model training<br/>[app.py]"]
  node_extended_predict["Fraud prediction<br/>[app.py]"]
end

subgraph group_ui["Dashboard and reports"]
  node_root_dashboard["Root dashboard<br/>[index.html]"]
  node_alt_dashboard["Alternate dashboard<br/>[index1.html]"]
  node_cat_report["CatBoost metrics"]
  node_xgb_report["XGBoost metrics"]
  node_lgb_report["LightGBM metrics"]
  node_stylesheet["Dashboard styles<br/>[index.css]"]
end

subgraph group_internal["Processing and analysis"]
  node_config["Model and app config<br/>[config.py]"]
  node_analysis["Analysis utilities<br/>[utils.py]"]
end

node_user(("Dashboard user"))
node_training_data[("Sample training CSV")]
node_prediction_data[("Sample prediction CSV")]

node_user -->|"uploads CSV"| node_root_routes
node_root_routes -->|"reads CSV"| node_root_data
node_root_routes -->|"splits data"| node_root_split
node_root_routes -->|"trains model"| node_root_models
node_root_routes -->|"requests prediction"| node_root_predict
node_root_routes -->|"renders dashboard"| node_root_dashboard
node_root_routes -->|"renders metrics"| node_cat_report
node_root_routes -->|"renders metrics"| node_xgb_report
node_root_routes -->|"renders metrics"| node_lgb_report
node_training_data -.->|"sample input"| node_root_routes
node_prediction_data -.->|"sample input"| node_root_predict
node_user -->|"uses dashboard"| node_extended_routes
node_extended_routes -->|"validates and loads"| node_extended_data
node_extended_routes -->|"trains models"| node_extended_models
node_extended_routes -->|"invokes prediction"| node_extended_predict
node_extended_routes -.->|"renders dashboard"| node_alt_dashboard
node_extended_routes -.->|"renders report"| node_cat_report
node_extended_routes -.->|"renders report"| node_xgb_report
node_extended_routes -.->|"renders report"| node_lgb_report
node_extended_routes -.->|"uses settings"| node_config
node_extended_data -.->|"analyzes data"| node_analysis
node_stylesheet -.->|"styles view"| node_root_dashboard

click node_root_routes "https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/app.py"
click node_root_data "https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/app.py"
click node_root_split "https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/app.py"
click node_root_models "https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/app.py"
click node_root_predict "https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/app.py"
click node_extended_routes "https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/Fraud%20Detection%20Only%20Python/app.py"
click node_extended_data "https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/Fraud%20Detection%20Only%20Python/app.py"
click node_extended_models "https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/Fraud%20Detection%20Only%20Python/app.py"
click node_extended_predict "https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/Fraud%20Detection%20Only%20Python/app.py"
click node_config "https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/Fraud%20Detection%20Only%20Python/config.py"
click node_analysis "https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/Fraud%20Detection%20Only%20Python/utils.py"
click node_root_dashboard "https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/templates/index.html"
click node_alt_dashboard "https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/templates/index1.html"
click node_cat_report "https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/templates/catboost_metrics.html"
click node_xgb_report "https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/templates/xgboost_metrics.html"
click node_lgb_report "https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/templates/lightgbm_metrics.html"
click node_stylesheet "https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/static/index.css"
click node_training_data "https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/data/Bank%20fraud%20dataset.csv"
click node_prediction_data "https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/data/New%20bank%20dataset.csv"

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_root_routes,node_root_data,node_root_split,node_root_models,node_root_predict,node_user toneBlue
class node_extended_routes,node_extended_data,node_extended_models,node_extended_predict,node_training_data,node_prediction_data toneAmber
class node_root_dashboard,node_alt_dashboard,node_cat_report,node_xgb_report,node_lgb_report,node_stylesheet toneMint
class node_config,node_analysis toneRose
```

## Components

### Root Flask app

- [Root workflow routes](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/app.py): `app.py`
- [Uploaded dataset](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/app.py): `app.py`
- [Train test split](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/app.py): `app.py`
- [Boosting models](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/app.py): `app.py`
- [Batch prediction](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/app.py): `app.py`

### Extended Flask app

- [Extended workflow routes](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/Fraud%20Detection%20Only%20Python/app.py): `Fraud Detection Only Python/app.py`
- [Dataset processing](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/Fraud%20Detection%20Only%20Python/app.py): `Fraud Detection Only Python/app.py`
- [Model training](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/Fraud%20Detection%20Only%20Python/app.py): `Fraud Detection Only Python/app.py`
- [Fraud prediction](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/Fraud%20Detection%20Only%20Python/app.py): `Fraud Detection Only Python/app.py`

### Dashboard and reports

- [Root dashboard](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/templates/index.html): `templates/index.html`
- [Alternate dashboard](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/templates/index1.html): `templates/index1.html`
- [CatBoost metrics](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/templates/catboost_metrics.html): `templates/catboost_metrics.html`
- [XGBoost metrics](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/templates/xgboost_metrics.html): `templates/xgboost_metrics.html`
- [LightGBM metrics](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/templates/lightgbm_metrics.html): `templates/lightgbm_metrics.html`
- [Dashboard styles](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/static/index.css): `static/index.css`

### Processing and analysis

- [Model and app config](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/Fraud%20Detection%20Only%20Python/config.py): `Fraud Detection Only Python/config.py`
- [Analysis utilities](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/Fraud%20Detection%20Only%20Python/utils.py): `Fraud Detection Only Python/utils.py`

### Other components

- **Dashboard user**
- [Sample training CSV](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/data/Bank%20fraud%20dataset.csv): `data/Bank fraud dataset.csv`
- [Sample prediction CSV](https://github.com/shashivardan-jarpati/fraud-detection-using-machine-learning/blob/main/data/New%20bank%20dataset.csv): `data/New bank dataset.csv`

## Connections

- Dashboard user → Root workflow routes: uploads CSV (evidence: `README.md`)
- Root workflow routes → Uploaded dataset: reads CSV (evidence: `app.py`)
- Root workflow routes → Train test split: splits data (evidence: `app.py`)
- Root workflow routes → Boosting models: trains model (evidence: `app.py`)
- Root workflow routes → Batch prediction: requests prediction (evidence: `app.py`)
- Root workflow routes → Root dashboard: renders dashboard (evidence: `app.py`)
- Root workflow routes → CatBoost metrics: renders metrics (evidence: `app.py`)
- Root workflow routes → XGBoost metrics: renders metrics (evidence: `app.py`)
- Root workflow routes → LightGBM metrics: renders metrics (evidence: `app.py`)
- Sample training CSV → Root workflow routes: sample input (evidence: `README.md`)
- Sample prediction CSV → Batch prediction: sample input (evidence: `README.md`)
- Dashboard user → Extended workflow routes: uses dashboard (evidence: `README.md`)
- Extended workflow routes → Dataset processing: validates and loads (evidence: `Fraud Detection Only Python/app.py`)
- Extended workflow routes → Model training: trains models (evidence: `Fraud Detection Only Python/app.py`)
- Extended workflow routes → Fraud prediction: invokes prediction (evidence: `Fraud Detection Only Python/app.py`)
- Extended workflow routes → Alternate dashboard: renders dashboard
- Extended workflow routes → CatBoost metrics: renders report (evidence: `README.md`)
- Extended workflow routes → XGBoost metrics: renders report (evidence: `README.md`)
- Extended workflow routes → LightGBM metrics: renders report (evidence: `README.md`)
- Extended workflow routes → Model and app config: uses settings
- Dataset processing → Analysis utilities: analyzes data
- Dashboard styles → Root dashboard: styles view (evidence: `README.md`)
