How thobilobah/frauddetectionsystem-gtguard-full works
UPI FraudGuard is a transaction-risk platform: the dashboard and payment gateway/simulator submit transactions to a FastAPI backend, which derives historical features, predicts fraud, explains risk, and exposes results for monitoring and review. PostgreSQL stores transaction and profile state; dashboard capabilities include analytics, model performance, history, and a review queue. Edges follow the excerpts, SOURCE INDEX references, or README; unsampled implementation details are not inferred.
Main entry points: main.py FastAPI application · App.tsx Dashboard shell · razorpay.py Razorpay webhook · prediction_service.py Prediction pipeline
Components 22
Dashboard
- Dashboard shell
frontend/src/App.tsx - API client
frontend/src/services/api.ts - Transaction analyzer
frontend/src/pages/TransactionAnalyzer.tsx - Live monitor
frontend/src/pages/LiveMonitor.tsx - Review queue
frontend/src/pages/ReviewQueue.tsx - Theme context
frontend/src/context/ThemeContext.tsx - Toast context
frontend/src/context/ToastContext.tsx
API and ingestion
- FastAPI application
backend/app/main.py - JWT authentication
backend/app/auth.py - Prediction routes
backend/app/routes/prediction.py - Razorpay webhook
backend/app/routes/razorpay.py - Transaction routes
backend/app/routes/transactions.py - Analytics routes
backend/app/routes/analytics.py - Webhook verification
backend/app/services/razorpay_service.py
Risk analysis
- Feature engineering
backend/app/services/feature_engineering.py - Prediction pipeline
backend/app/services/prediction_service.py - Model service
backend/app/services/model_service.py - Rule explanations
backend/app/services/rule_engine.py
Persistence
- PostgreSQL transaction store
backend/app/repositories/transaction_repository.py - Runtime settings
backend/app/config.py
Other components
- Analyst
- Razorpay / simulator
Connections 27
- Analyst → Dashboard shell: uses
frontend/src/App.tsx - Dashboard shell → API client: requests data
frontend/src/App.tsx - Transaction analyzer → API client: submits predictions
frontend/src/pages/TransactionAnalyzer.tsx - Dashboard shell → Live monitor: renders
frontend/src/App.tsx - Dashboard shell → Review queue: renders
frontend/src/App.tsx - Dashboard shell → Theme context: uses
frontend/src/App.tsx - Dashboard shell → Toast context: uses
frontend/src/App.tsx - API client → FastAPI application: calls API
frontend/src/services/api.ts - Razorpay / simulator → Razorpay webhook: sends webhook
README.md - FastAPI application → Prediction routes: registers
backend/app/main.py - FastAPI application → Razorpay webhook: registers
backend/app/main.py - FastAPI application → Transaction routes: registers
backend/app/main.py - FastAPI application → Analytics routes: registers
backend/app/main.py - FastAPI application → JWT authentication: protects routes
backend/app/main.py - Prediction routes → Feature engineering: builds features
backend/app/routes/prediction.py - Prediction routes → Prediction pipeline: requests prediction
backend/app/routes/prediction.py - Razorpay webhook → Webhook verification: verifies webhook
backend/app/routes/razorpay.py - Razorpay webhook → Feature engineering: builds features
backend/app/routes/razorpay.py - Razorpay webhook → Prediction pipeline: requests prediction
backend/app/routes/razorpay.py - Transaction routes → PostgreSQL transaction store: reads and writes
backend/app/routes/transactions.py - Analytics routes → PostgreSQL transaction store: queries analytics
backend/app/routes/analytics.py - Feature engineering → PostgreSQL transaction store: reads profiles
backend/app/services/feature_engineering.py - Prediction pipeline → Rule explanations: evaluates rules
backend/app/services/prediction_service.py - Prediction pipeline → PostgreSQL transaction store: reads model setting
backend/app/services/prediction_service.py - FastAPI application → PostgreSQL transaction store: checks database
backend/app/main.py - FastAPI application → Runtime settings: loads settings
backend/app/main.py - Prediction pipeline → Model service: uses model implementation