skip to content

Fraud Radar

Real-time fraud-scoring system modeled on Stripe Radar — transactions stream through Kafka, get scored by an anomaly-detection model, and pass through a rules-composition decision engine onto a live dashboard.

Fraud Radar showcase
Role
Full-stack Development, ML Engineering
Date
August 21, 2026
Deliverables
Real-time streaming pipeline, Fraud-scoring API, Live dashboard, Model evaluation & explainability
Tools
Python, FastAPI, Redpanda, PostgreSQL, React, TypeScript, scikit-learn, PyTorch, Docker Compose

Fraud Radar scores streaming transactions for fraud risk in real time and visualizes the results on a live dashboard, modeled on how Stripe Radar actually works — a model score composed with a bounded rules layer into a decision, not just a raw anomaly threshold. Built solo, end to end, as a portfolio piece to prove a model can be taken out of a notebook and turned into a system.

Six Docker Compose services stream, score, and store transactions in real time — Redpanda for streaming, Postgres for storage, a producer replaying holdout transactions, a consumer that scores and persists them, a FastAPI backend, and a React/TypeScript dashboard with a live burst-demo control and click-to-explain on flagged transactions.

Overview

Fraud Radar scores streaming transactions for fraud risk in real time and visualizes the results on a live dashboard, modeled on how Stripe Radar actually works: a model score composed with a bounded rules layer into a decision, not just a raw anomaly threshold. Built solo, end to end, as a portfolio piece to prove a model can be taken out of a notebook and turned into a system.

Fraud Radar demo

Approach

Six Docker Compose services stream, score, and store transactions in real time: Redpanda (Kafka-API) for streaming, Postgres for storage, a producer replaying holdout transactions, a dedicated consumer process that scores each transaction and batches writes, a FastAPI backend, and a React/TypeScript dashboard. Rather than exposing a raw model score, decide(score, amount) composes it with a bounded ruleset into BLOCK / REVIEW / ALLOW — the same "ML plus policy" shape real fraud systems use. Models were trained on the Kaggle Credit Card Fraud dataset (284,807 transactions, 492 fraud, ~0.17% prevalence) with a time-ordered 80/20 split, and evaluated on PR-AUC / precision / recall / F1 given the severe class imbalance.

Features

  • Real-time scoring pipeline over a Kafka-API (Redpanda) stream, with batched writes to keep burst-time throughput fast
  • Model score composed with a bounded rules layer into BLOCK / REVIEW / ALLOW, not a raw anomaly threshold
  • On-demand, per-transaction permutation-importance explainability for flagged (REVIEW/BLOCK) rows
  • Live dashboard: real-time feed, charts, alert table, and a burst-demo control with a server-enforced cooldown
  • Isolation Forest and autoencoder models compared on PR-AUC/precision/recall/F1 against a time-ordered holdout
  • pytest + npm test coverage, with a Mermaid architecture diagram and recorded demo GIF in the README
.see also
view all projects