# kunjansharma008/clone-account-fraud-detection architecture

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

- Interactive diagram: https://gitdiagram.com/kunjansharma008/clone-account-fraud-detection
- Repository: https://github.com/kunjansharma008/clone-account-fraud-detection

## Overview

CloneGuard is a web-based account fraud-risk assessment MVP. A user enters account and behavioral signals in the React app; the app submits them to Flask, which prepares model input, predicts fraud risk, and returns an overall assessment and module scores for the dashboard. The README documents the Random Forest model and risk categories; source excerpts show the API endpoint, model loading, and frontend request. The frontend is a single substantial component, so its distinct responsibilities share one path. Training and evaluation internals were not sampled.

Main entry points: [`backend/app.py`](https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/backend/app.py) (Prediction API), [`frontend/src/App.jsx`](https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/frontend/src/App.jsx) (Risk assessment UI), [`src/generate_data.py`](https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/src/generate_data.py) (Dataset generator), [`models/fraud_detection_model.pkl`](https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/models/fraud_detection_model.pkl) (Fraud classifier)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_app["Risk assessment UI<br/>[App.jsx]"]
  node_dashboard["Risk dashboard<br/>[App.jsx]"]
end

subgraph group_assessment["Risk assessment"]
  node_api["Prediction API<br/>[app.py]"]
  node_features["Feature preparation<br/>[app.py]"]
  node_classifier["Fraud classifier"]
  node_risk["Risk scoring<br/>[app.py]"]
end

subgraph group_data["Model data"]
  node_dataset[("Synthetic dataset")]
  node_generator["Dataset generator<br/>[generate_data.py]"]
end

node_user(("Analyst"))

node_user -->|"enters signals"| node_app
node_app -->|"posts prediction"| node_api
node_api -->|"prepares input"| node_features
node_api -->|"loads model"| node_classifier
node_api -->|"returns scores"| node_risk
node_api -->|"returns assessment"| node_dashboard
node_generator -->|"writes dataset"| node_dataset

click node_app "https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/frontend/src/App.jsx"
click node_dashboard "https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/frontend/src/App.jsx"
click node_api "https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/backend/app.py"
click node_features "https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/backend/app.py"
click node_classifier "https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/models/fraud_detection_model.pkl"
click node_risk "https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/backend/app.py"
click node_dataset "https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/data/clone_fraud_dataset.csv"
click node_generator "https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/src/generate_data.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_dashboard toneBlue
class node_api,node_features,node_classifier,node_risk toneAmber
class node_dataset,node_generator toneMint
class node_user toneIndigo
```

## Components

### User experience

- [Risk assessment UI](https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Risk dashboard](https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`

### Risk assessment

- [Prediction API](https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/backend/app.py): `backend/app.py`
- [Feature preparation](https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/backend/app.py): `backend/app.py`
- [Fraud classifier](https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/models/fraud_detection_model.pkl): `models/fraud_detection_model.pkl`
- [Risk scoring](https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/backend/app.py): `backend/app.py`

### Model data

- [Synthetic dataset](https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/data/clone_fraud_dataset.csv): `data/clone_fraud_dataset.csv`
- [Dataset generator](https://github.com/kunjansharma008/clone-account-fraud-detection/blob/main/src/generate_data.py): `src/generate_data.py`

### Other components

- **Analyst**

## Connections

- Analyst → Risk assessment UI: enters signals (evidence: `README.md`)
- Risk assessment UI → Prediction API: posts prediction (evidence: `frontend/src/App.jsx`)
- Prediction API → Feature preparation: prepares input (evidence: `backend/app.py`)
- Prediction API → Fraud classifier: loads model (evidence: `backend/app.py`)
- Prediction API → Risk scoring: returns scores (evidence: `backend/app.py`)
- Prediction API → Risk dashboard: returns assessment (evidence: `README.md`)
- Dataset generator → Synthetic dataset: writes dataset (evidence: `src/generate_data.py`)
