# keerthivasan11411/fraudshield architecture

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

- Interactive diagram: https://gitdiagram.com/keerthivasan11411/fraudshield
- Repository: https://github.com/keerthivasan11411/fraudshield

## Overview

FraudShield is a fraud-monitoring and investigation application: users import transaction workbooks, the backend validates and stores records, updates a unified master dataset, scores transactions, and exposes results for analytics, monitoring, and case work. Model management, evaluation, multi-model analysis, and explanations are distinct capabilities alongside that main workflow. Edges reflect the excerpts, source-index references, and explicit router registration; unsampled internals are not expanded.

Main entry points: [`backend/main.py`](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/main.py) (API application), [`backend/database.py`](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/database.py) (SQLite database), [`backend/routers/transaction_import.py`](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/transaction_import.py) (Workbook import), [`backend/services/auto_scoring.py`](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/auto_scoring.py) (Import auto-scoring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_app["FraudShield UI<br/>[App.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["API and investigation"]
  node_entry["API application<br/>[main.py]"]
  node_import_api["Workbook import"]
  node_transactions_api["Transaction API<br/>[transactions.py]"]
  node_predictions_api["Prediction API<br/>[predictions.py]"]
  node_analytics_api["Analytics API<br/>[analytics.py]"]
  node_monitoring_api["Monitoring API<br/>[monitoring.py]"]
  node_cases_api["Investigation cases<br/>[cases.py]"]
  node_customers_api["Customer API<br/>[customers.py]"]
  node_explanations_api["Explanations API<br/>[explanations.py]"]
  node_auto_alerts_api["Automatic alerts<br/>[auto_alerts.py]"]
  node_model_api["Model management API"]
  node_evaluation_api["Model evaluation API"]
  node_multi_api["Multi-model API"]
end

subgraph group_scoring["Scoring and models"]
  node_auto_scoring["Import auto-scoring<br/>[auto_scoring.py]"]
  node_prediction["Fraud prediction"]
  node_history[("Prediction history")]
  node_registry[("Model registry<br/>[model_registry.py]")]
  node_drift["Drift monitoring<br/>[drift_service.py]"]
  node_evaluation["Model evaluation"]
  node_multi_analysis["Multi-model analysis"]
  node_intelligence["Fraud intelligence"]
end

subgraph group_data["Data and monitoring"]
  node_import_service["Workbook processing<br/>[import_service.py]"]
  node_import_management["Import job tracking"]
  node_master["Master dataset sync<br/>[master_excel.py]"]
  node_database[("SQLite database<br/>[database.py]")]
  node_transaction_service["Transaction operations"]
end

node_user(("Fraud analyst"))

node_user -->|"uses"| node_app
node_app -->|"requests"| node_api_client
node_app -->|"uploads and confirms"| node_import_api
node_app -.->|"calls API"| node_entry
node_entry -->|"registers"| node_import_api
node_entry -->|"registers"| node_transactions_api
node_entry -->|"registers"| node_predictions_api
node_entry -->|"registers"| node_analytics_api
node_entry -->|"registers"| node_monitoring_api
node_entry -->|"registers"| node_cases_api
node_entry -->|"registers"| node_customers_api
node_entry -->|"registers"| node_explanations_api
node_entry -->|"registers"| node_auto_alerts_api
node_entry -->|"registers"| node_model_api
node_entry -->|"registers"| node_evaluation_api
node_entry -->|"registers"| node_multi_api
node_entry -->|"initializes"| node_database
node_entry -->|"starts monitor"| node_drift
node_entry -->|"initializes"| node_history
node_entry -->|"sets up"| node_import_management
node_import_api -->|"previews and imports"| node_import_service
node_import_api -->|"tracks jobs"| node_import_management
node_import_api -->|"syncs dataset"| node_master
node_import_api -->|"queues scoring"| node_auto_scoring
node_import_api -->|"requests monitoring"| node_drift
node_import_service -->|"writes records"| node_database
node_import_service -->|"uses projection"| node_master
node_master -->|"reads records"| node_database
node_transactions_api -->|"delegates"| node_transaction_service
node_transaction_service -->|"reads and writes"| node_database
node_predictions_api -->|"scores transactions"| node_prediction
node_predictions_api -->|"reads results"| node_history
node_predictions_api -->|"controls batches"| node_auto_scoring
node_predictions_api -->|"queries results"| node_database
node_auto_scoring -->|"scores records"| node_prediction
node_auto_scoring -->|"saves results"| node_history
node_auto_scoring -->|"pins model"| node_registry
node_prediction -->|"loads model"| node_registry
node_prediction -->|"loads transaction context"| node_database
node_history -->|"persists results"| node_database
node_analytics_api -->|"queries metrics"| node_database
node_monitoring_api -->|"reads drift status"| node_drift
node_monitoring_api -->|"uses scoring data"| node_prediction
node_monitoring_api -->|"queries status"| node_database
node_cases_api -->|"manages cases"| node_database
node_customers_api -->|"queries customers"| node_database
node_explanations_api -->|"uses prediction context"| node_prediction
node_auto_alerts_api -->|"uses scoring"| node_auto_scoring

click node_app "https://github.com/keerthivasan11411/fraudshield/blob/main/frontend/src/App.jsx"
click node_api_client "https://github.com/keerthivasan11411/fraudshield/blob/main/frontend/src/api.js"
click node_entry "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/main.py"
click node_import_api "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/transaction_import.py"
click node_transactions_api "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/transactions.py"
click node_predictions_api "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/predictions.py"
click node_analytics_api "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/analytics.py"
click node_monitoring_api "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/monitoring.py"
click node_cases_api "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/cases.py"
click node_customers_api "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/customers.py"
click node_explanations_api "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/explanations.py"
click node_auto_alerts_api "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/auto_alerts.py"
click node_model_api "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/model_management.py"
click node_evaluation_api "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/model_evaluation.py"
click node_multi_api "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/multi_model_analysis.py"
click node_import_service "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/import_service.py"
click node_import_management "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/import_management.py"
click node_master "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/master_excel.py"
click node_database "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/database.py"
click node_auto_scoring "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/auto_scoring.py"
click node_prediction "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/prediction_service.py"
click node_history "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/prediction_history.py"
click node_registry "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/model_registry.py"
click node_drift "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/drift_service.py"
click node_evaluation "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/model_evaluation.py"
click node_multi_analysis "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/multi_model_analysis.py"
click node_intelligence "https://github.com/keerthivasan11411/fraudshield/blob/main/modules/fraud_intelligence.py"
click node_transaction_service "https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/transaction_service.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_api_client toneBlue
class node_entry,node_import_api,node_transactions_api,node_predictions_api,node_analytics_api,node_monitoring_api,node_cases_api,node_customers_api,node_explanations_api,node_auto_alerts_api,node_model_api,node_evaluation_api,node_multi_api toneAmber
class node_auto_scoring,node_prediction,node_history,node_registry,node_drift,node_evaluation,node_multi_analysis,node_intelligence toneMint
class node_import_service,node_import_management,node_master,node_database,node_transaction_service toneRose
class node_user toneIndigo
```

## Components

### User interface

- [FraudShield UI](https://github.com/keerthivasan11411/fraudshield/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [API client](https://github.com/keerthivasan11411/fraudshield/blob/main/frontend/src/api.js): `frontend/src/api.js`

### API and investigation

- [API application](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/main.py): `backend/main.py`
- [Workbook import](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/transaction_import.py): `backend/routers/transaction_import.py`
- [Transaction API](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/transactions.py): `backend/routers/transactions.py`
- [Prediction API](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/predictions.py): `backend/routers/predictions.py`
- [Analytics API](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/analytics.py): `backend/routers/analytics.py`
- [Monitoring API](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/monitoring.py): `backend/routers/monitoring.py`
- [Investigation cases](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/cases.py): `backend/routers/cases.py`
- [Customer API](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/customers.py): `backend/routers/customers.py`
- [Explanations API](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/explanations.py): `backend/routers/explanations.py`
- [Automatic alerts](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/auto_alerts.py): `backend/routers/auto_alerts.py`
- [Model management API](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/model_management.py): `backend/routers/model_management.py`
- [Model evaluation API](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/model_evaluation.py): `backend/routers/model_evaluation.py`
- [Multi-model API](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/routers/multi_model_analysis.py): `backend/routers/multi_model_analysis.py`

### Scoring and models

- [Import auto-scoring](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/auto_scoring.py): `backend/services/auto_scoring.py`
- [Fraud prediction](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/prediction_service.py): `backend/services/prediction_service.py`
- [Prediction history](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/prediction_history.py): `backend/services/prediction_history.py`
- [Model registry](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/model_registry.py): `backend/services/model_registry.py`
- [Drift monitoring](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/drift_service.py): `backend/services/drift_service.py`
- [Model evaluation](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/model_evaluation.py): `backend/services/model_evaluation.py`
- [Multi-model analysis](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/multi_model_analysis.py): `backend/services/multi_model_analysis.py`
- [Fraud intelligence](https://github.com/keerthivasan11411/fraudshield/blob/main/modules/fraud_intelligence.py): `modules/fraud_intelligence.py`

### Data and monitoring

- [Workbook processing](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/import_service.py): `backend/services/import_service.py`
- [Import job tracking](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/import_management.py): `backend/services/import_management.py`
- [Master dataset sync](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/master_excel.py): `backend/services/master_excel.py`
- [SQLite database](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/database.py): `backend/database.py`
- [Transaction operations](https://github.com/keerthivasan11411/fraudshield/blob/main/backend/services/transaction_service.py): `backend/services/transaction_service.py`

### Other components

- **Fraud analyst**

## Connections

- Fraud analyst → FraudShield UI: uses
- FraudShield UI → API client: requests (evidence: `frontend/src/App.jsx`)
- FraudShield UI → Workbook import: uploads and confirms (evidence: `frontend/src/App.jsx`)
- FraudShield UI → API application: calls API
- API application → Workbook import: registers (evidence: `backend/main.py`)
- API application → Transaction API: registers (evidence: `backend/main.py`)
- API application → Prediction API: registers (evidence: `backend/main.py`)
- API application → Analytics API: registers (evidence: `backend/main.py`)
- API application → Monitoring API: registers (evidence: `backend/main.py`)
- API application → Investigation cases: registers (evidence: `backend/main.py`)
- API application → Customer API: registers (evidence: `backend/main.py`)
- API application → Explanations API: registers (evidence: `backend/main.py`)
- API application → Automatic alerts: registers (evidence: `backend/main.py`)
- API application → Model management API: registers (evidence: `backend/main.py`)
- API application → Model evaluation API: registers (evidence: `backend/main.py`)
- API application → Multi-model API: registers (evidence: `backend/main.py`)
- API application → SQLite database: initializes (evidence: `backend/main.py`)
- API application → Drift monitoring: starts monitor (evidence: `backend/main.py`)
- API application → Prediction history: initializes (evidence: `backend/main.py`)
- API application → Import job tracking: sets up (evidence: `backend/main.py`)
- Workbook import → Workbook processing: previews and imports (evidence: `backend/routers/transaction_import.py`)
- Workbook import → Import job tracking: tracks jobs (evidence: `backend/routers/transaction_import.py`)
- Workbook import → Master dataset sync: syncs dataset (evidence: `backend/routers/transaction_import.py`)
- Workbook import → Import auto-scoring: queues scoring (evidence: `backend/routers/transaction_import.py`)
- Workbook import → Drift monitoring: requests monitoring (evidence: `backend/routers/transaction_import.py`)
- Workbook processing → SQLite database: writes records (evidence: `backend/services/import_service.py`)
- Workbook processing → Master dataset sync: uses projection (evidence: `backend/services/import_service.py`)
- Master dataset sync → SQLite database: reads records (evidence: `backend/services/master_excel.py`)
- Transaction API → Transaction operations: delegates (evidence: `backend/routers/transactions.py`)
- Transaction operations → SQLite database: reads and writes (evidence: `backend/services/transaction_service.py`)
- Prediction API → Fraud prediction: scores transactions (evidence: `backend/routers/predictions.py`)
- Prediction API → Prediction history: reads results (evidence: `backend/routers/predictions.py`)
- Prediction API → Import auto-scoring: controls batches (evidence: `backend/routers/predictions.py`)
- Prediction API → SQLite database: queries results (evidence: `backend/routers/predictions.py`)
- Import auto-scoring → Fraud prediction: scores records (evidence: `backend/services/auto_scoring.py`)
- Import auto-scoring → Prediction history: saves results (evidence: `backend/services/auto_scoring.py`)
- Import auto-scoring → Model registry: pins model (evidence: `backend/services/auto_scoring.py`)
- Fraud prediction → Model registry: loads model (evidence: `backend/services/prediction_service.py`)
- Fraud prediction → SQLite database: loads transaction context (evidence: `backend/services/prediction_service.py`)
- Prediction history → SQLite database: persists results (evidence: `backend/services/prediction_history.py`)
- Analytics API → SQLite database: queries metrics (evidence: `backend/routers/analytics.py`)
- Monitoring API → Drift monitoring: reads drift status (evidence: `backend/routers/monitoring.py`)
- Monitoring API → Fraud prediction: uses scoring data (evidence: `backend/routers/monitoring.py`)
- Monitoring API → SQLite database: queries status (evidence: `backend/routers/monitoring.py`)
- Investigation cases → SQLite database: manages cases (evidence: `backend/routers/cases.py`)
- Customer API → SQLite database: queries customers (evidence: `backend/routers/customers.py`)
- Explanations API → Fraud prediction: uses prediction context (evidence: `backend/routers/explanations.py`)
- Automatic alerts → Import auto-scoring: uses scoring (evidence: `backend/routers/auto_alerts.py`)
