Fraudies
Fraud Detection Platform
View Live ProjectOverview
A modular, full-stack fraud detection system combining deterministic velocity rules with a machine learning scoring engine to assess transaction risk in real time. Built as a portfolio demonstration of enterprise fraud-monitoring architecture patterns.
Fraudies is a three-service fraud detection system: a NestJS REST API that handles ingestion and orchestration, a FastAPI ML inference engine that scores transaction risk, and a Next.js analyst dashboard for real-time monitoring. PostgreSQL stores all transaction records and audit history. Redis handles velocity-based rule checks.
Key Features
Real-Time Scoring
Classifies transactions as APPROVED, PENDING, or FLAGGED in a single synchronous request
ML Risk Engine
Random Forest Classifier with 89% precision on synthetic fraud dataset
Velocity Rules
Redis-based sub-millisecond checks for transaction frequency anomalies
Audit Trail
Append-only AuditLog enforced by PostgreSQL triggers for compliance
Analyst Dashboard
Real-time WebSocket alerts with transaction queue and risk metrics
Technology Stack
Challenges
Achieving sub-50ms end-to-end latency for real-time fraud scoring
Balancing false positives vs. false negatives in ML model tuning
Building immutable audit trail with database-level enforcement
Isolating ML service from direct database access for security
Creating intuitive risk factor explanations from ML predictions
Solutions
Implemented three-layer scoring: Redis velocity checks, ML inference, threshold classification
Used feature importance extraction to generate human-readable risk factors
Enforced audit immutability with PostgreSQL triggers + service-layer constraints
Designed ML engine as stateless service with no DB credentials
Built WebSocket real-time dashboard updates with subscription patterns
Project Architecture
// Project Structure
fintech-fraudies/
├── frontend/ # Next.js analyst dashboard
│ ├── app/
│ │ ├── (auth)/ # Login and registration
│ │ ├── dashboard/ # Main analyst view
│ │ ├── transactions/ # Transaction list/detail
│ │ └── alerts/ # Flagged transaction queue
│ └── components/
│ ├── ui/ # Shared primitives
│ ├── TransactionCard/
│ ├── RiskScoreMeter/
│ └── MetricsPanel/
├── backend/
│ ├── api/ # NestJS REST API
│ │ └── src/
│ │ ├── modules/
│ │ │ ├── auth/ # JWT + bcrypt
│ │ │ ├── transactions/ # Ingestion + ML orchestration
│ │ │ ├── webhook/ # Webhook ingestion
│ │ │ └── audit/ # Append-only audit log
│ │ └── common/
│ └── ml-engine/ # FastAPI inference service
│ └── app/
│ ├── model/ # Random Forest classifier
│ └── schemas.py
└── database/
├── schema.prisma
└── migrations/Key Learnings
Production ML deployment patterns with FastAPI and Scikit-Learn
Microservices security architecture and service isolation
Database-level audit enforcement with PostgreSQL triggers
Real-time data streaming with WebSocket subscriptions
Feature engineering for fraud detection use cases
JWT authentication flows in NestJS with Passport.js
Future Enhancements
Async job queue with BullMQ for decoupled scoring, Prometheus metrics export, OpenTelemetry tracing, PagerDuty alert integration, and read replicas for analytics queries.