Fraud Detection and Reporting
Real-time fraud detection for a regulated retail bank. Transactions stream in, private fields are masked, and the regulator gets its Suspicious Transaction Report automatically.
The idea
The problem
A bank has to spot suspicious transactions as they happen and report them to the regulator on a schedule, while keeping customers' personal data out of places it does not belong.
The answer
An event-driven pipeline on Kafka. Data is masked early, checked, filed automatically, and watched by dashboards that shout when verification fails.
How a transaction travels
Each stage reads from a stream and writes to the next, so a slow stage never loses data.
Transactions arrive on Kafka topics.
StreamSets pipelines mask six PII fields before the data travels any further.
A FastAPI service flags suspicious activity and stores the results in PostgreSQL.
A Suspicious Transaction Report is filed to the regulator automatically every 5 minutes.
Prometheus and Grafana track it, with CRITICAL alerts when verification fails.
The hard parts
Regulated money, real time, and personal data.
PII masking on six fields happens early in the pipeline, so downstream services only ever see masked data.
Filing to the regulator runs automatically every 5 minutes, so it does not depend on someone remembering.
Three Grafana dashboards on Prometheus metrics, with CRITICAL alerts on verification failures, because a silent failure here is the worst kind.
Built with
| Streaming | Kafka, StreamSets |
|---|---|
| Service | FastAPI, PostgreSQL, Docker |
| Observability | Prometheus and Grafana, 3 dashboards |