# subham-debnath/financial-fraud-detection architecture

> Architecture diagram of the GitHub repository subham-debnath/financial-fraud-detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/subham-debnath/financial-fraud-detection
- Repository: https://github.com/subham-debnath/financial-fraud-detection

## Overview

This is a Streamlit credit-card fraud detection application. Users can review a dashboard, upload transaction data for batch predictions, score a single transaction, inspect prediction history, and view model information. The app also supports model selection, probability thresholds, visual summaries, and CSV downloads. The sampled source is a single large application file, so the graph separates its user-facing responsibilities without implying separate implementation modules. Some model-loading and prediction internals fall in omitted excerpts; those links are marked unverified.

Main entry points: [`app/app.py`](https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/app.py) (Page navigation), [`models`](https://github.com/subham-debnath/financial-fraud-detection/tree/main/models) (Serialized models), [`app/model.pkl`](https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/model.pkl) (Bundled model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Application interface"]
  node_app["Streamlit app<br/>[app.py]"]
  node_navigation["Page navigation<br/>[app.py]"]
end

subgraph group_scoring["Fraud scoring"]
  node_batch["Batch upload<br/>[app.py]"]
  node_single["Single transaction<br/>[app.py]"]
  node_model_select["Model selection<br/>[app.py]"]
  node_models["Serialized models"]
  node_bundled_model["Bundled model<br/>[model.pkl]"]
end

subgraph group_insights["Results and insights"]
  node_dashboard["Fraud dashboard<br/>[app.py]"]
  node_history["Prediction history<br/>[app.py]"]
  node_model_info["Model information<br/>[app.py]"]
  node_exports["CSV exports<br/>[app.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"offers pages"| node_navigation
node_navigation -->|"opens"| node_batch
node_navigation -->|"opens"| node_single
node_navigation -->|"opens"| node_dashboard
node_navigation -->|"opens"| node_history
node_navigation -->|"opens"| node_model_info
node_app -->|"selects model"| node_model_select
node_model_select -.->|"loads from"| node_models
node_model_select -.->|"may load"| node_bundled_model
node_batch -->|"downloads results"| node_exports
node_batch -->|"records summary"| node_history

click node_app "https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/app.py"
click node_navigation "https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/app.py"
click node_batch "https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/app.py"
click node_single "https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/app.py"
click node_model_select "https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/app.py"
click node_models "https://github.com/subham-debnath/financial-fraud-detection/tree/main/models"
click node_bundled_model "https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/model.pkl"
click node_dashboard "https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/app.py"
click node_history "https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/app.py"
click node_model_info "https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/app.py"
click node_exports "https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/app.py"

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_navigation,node_user toneBlue
class node_batch,node_single,node_model_select,node_models,node_bundled_model toneAmber
class node_dashboard,node_history,node_model_info,node_exports toneMint
```

## Components

### Application interface

- [Streamlit app](https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/app.py): `app/app.py`
- [Page navigation](https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/app.py): `app/app.py`

### Fraud scoring

- [Batch upload](https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/app.py): `app/app.py`
- [Single transaction](https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/app.py): `app/app.py`
- [Model selection](https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/app.py): `app/app.py`
- [Serialized models](https://github.com/subham-debnath/financial-fraud-detection/tree/main/models): `models`
- [Bundled model](https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/model.pkl): `app/model.pkl`

### Results and insights

- [Fraud dashboard](https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/app.py): `app/app.py`
- [Prediction history](https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/app.py): `app/app.py`
- [Model information](https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/app.py): `app/app.py`
- [CSV exports](https://github.com/subham-debnath/financial-fraud-detection/blob/main/app/app.py): `app/app.py`

### Other components

- **User**

## Connections

- User → Streamlit app: uses (evidence: `app/app.py`)
- Streamlit app → Page navigation: offers pages (evidence: `app/app.py`)
- Page navigation → Batch upload: opens (evidence: `app/app.py`)
- Page navigation → Single transaction: opens (evidence: `app/app.py`)
- Page navigation → Fraud dashboard: opens (evidence: `app/app.py`)
- Page navigation → Prediction history: opens (evidence: `app/app.py`)
- Page navigation → Model information: opens (evidence: `app/app.py`)
- Streamlit app → Model selection: selects model (evidence: `app/app.py`)
- Model selection → Serialized models: loads from
- Model selection → Bundled model: may load
- Batch upload → CSV exports: downloads results (evidence: `app/app.py`)
- Batch upload → Prediction history: records summary (evidence: `app/app.py`)
