How pranavdev-g/financial-fraud-detection works
This is a financial-fraud detection application with a FastAPI backend and browser dashboard. Its main workflow accepts a transaction CSV, prepares transaction data, and exposes risk-scored results and analysis through API endpoints for the dashboard. Separate routes provide algorithm-specific analyses and transaction simulation. The sampled code also shows model scoring, hash-based sender profiles, caching, and PDF report generation. The README contains no feature detail, and frontend and report wiring were not shown, so those connections are left out rather than inferred.
Main entry points: main.py FastAPI routes · risk_engine.py Risk scoring · dashboard.html Browser dashboard · caches.py Analysis cache
Components 16
API and interface
- Browser dashboard
frontend/dashboard.html - FastAPI routes
backend/main.py
Transaction data
- CSV upload and loading
backend/services/fraud_service.py - Loaded transaction data
backend/services/fraud_service.py - Sample transactions
backend/dataset/sample_transactions.csv
Fraud analysis
- Risk scoring
backend/risk_engine.py - Fraud ML model
backend/ai_model.py - Outlier analysis
backend/algorithms/divide_conquer.py - Pattern analysis
backend/algorithms/dynamic_programming.py - Suspicious ranking
backend/algorithms/greedy.py - Sender profiles and search
backend/algorithms/hashing_implementation.py - Analysis cache
backend/caches.py - Transaction simulation
backend/risk_engine.py
Analysis outputs
- Dashboard payload
backend/risk_engine.py - PDF report generation
backend/report_generator.py
Other components
- Analyst
Connections 19
- Analyst → Browser dashboard: views
- Browser dashboard → FastAPI routes: requests data
- FastAPI routes → Browser dashboard: serves pages
backend/main.py - FastAPI routes → CSV upload and loading: routes upload
backend/main.py - CSV upload and loading → Loaded transaction data: loads and prepares
backend/services/fraud_service.py - FastAPI routes → Loaded transaction data: requires loaded data
backend/main.py - FastAPI routes → Risk scoring: runs scoring
backend/main.py - Risk scoring → Fraud ML model: scores transactions
backend/risk_engine.py - Risk scoring → Outlier analysis: computes outliers
backend/risk_engine.py - Risk scoring → Pattern analysis: computes patterns
backend/risk_engine.py - FastAPI routes → Outlier analysis: runs analysis
backend/main.py - FastAPI routes → Pattern analysis: runs analysis
backend/main.py - FastAPI routes → Suspicious ranking: runs ranking
backend/main.py - Suspicious ranking → Risk scoring: evaluates dataset
backend/algorithms/greedy.py - FastAPI routes → Sender profiles and search: runs search and analysis
backend/main.py - FastAPI routes → Transaction simulation: simulates transactions
backend/main.py - FastAPI routes → Dashboard payload: builds dashboard data
backend/main.py - Analysis cache → Sender profiles and search: builds sender profiles
backend/caches.py - Analysis cache → Fraud ML model: precomputes predictions
backend/caches.py