Back to Projects

Bank Antiscam Application

System & Database Architect2025

A real-time trust scoring and fraud detection system utilizing a multi-database pipeline. Aggregates transactional records, graph databases for ring link detection, and Redis caches to validate banking risks under 50ms.

Demo Loop

Project Reports & Documentation

User Login & Score Classification Report

View markdown report on GitHub

User Score Calculation Test Cases

View markdown report on GitHub

User Transaction Policy Test Cases

View markdown report on GitHub

System Architecture

frontendBank Client App
backendAntiScam API (FastAPI)
queueRedis Cache (Scores)
databaseMongoDB (History)
databaseNeo4j Graph (Relations)

Data Flows & Communication

Bank Client AppAntiScam API (FastAPI)JSON POST /transactions
AntiScam API (FastAPI)Redis Cache (Scores)1. Quick check
AntiScam API (FastAPI)MongoDB (History)2. Fetch history
AntiScam API (FastAPI)Neo4j Graph (Relations)3. Trace device circular link
AntiScam API (FastAPI)Bank Client App4. Return Trust Score

Graph-Enhanced Fraud Detection Schema

Bank Client App / DashboardReact Frontend (Port: 3000)Scoring Processor & GuardAntiScam Engine (FastAPI - Port: 8000)Enforces Trust Policies (Blocked if Score < 30) & Recalculates ScoreRule Scans: high_txn_amount, shared_devices, monthly_spentIn-Memory CacheRedis (Score Cache)TTL: 1 Hour (Port: 6379)Document StorageMongoDBPort: 27017Stores Txns, Devices, DeductionsRelationship GraphNeo4j Graph DatabaseBolt Protocol (Port: 7687)MongoDB Aggregations• Monthly Spending Velocity check• Fetch scores on cache miss• Record active deductions:score_deductions_appliedNeo4j Fraud Ring CheckUser AUser BTransactionDevice Link / RingJSON REST API1. Read / Write Score2. Load Profile / Txns3. Bolt: Cypher TraversalSync Recalculated Score

Interactive Scenario Simulator

Select a scenario to trigger and view simulated backend logs & database traces.

service-daemon.log
2026-06-10 20:20:01 - Incoming transaction. User: usr_9941. Amount: $45.00. Device: Dev_Android99
2026-06-10 20:20:01 - MongoDB: Retrieving transaction patterns... Found 14 historical records.
2026-06-10 20:20:02 - Neo4j Graph Check: Running Cypher query to trace device sharing circles...
2026-06-10 20:20:02 - Neo4j Graph Result: Device is unique to usr_9941. No circle detected.
2026-06-10 20:20:02 - Trust Calculation Engine: Evaluating risk vectors...
2026-06-10 20:20:03 - Trust Score: 98/100 (LOW RISK). Redis cache updated.
2026-06-10 20:20:03 - Result: Transaction APPROVED. Response dispatched in 18ms.

DevOps

Docker Compose

Multi-DB Orchestration

Orchestrated MongoDB for high-throughput raw transaction logs, Neo4j for network graphs, and Redis for volatile score caching.

Docker, pytest

Integration Testing Pipelines

Developed custom automated test containers that stand up temporary databases to validate scoring algorithms on commit.

Dotenv, Shell

Secure Env Injection

Centralized database secrets and connection strings using environment files, keeping production credentials isolated.

Run Infrastructure Locally

You can easily spin up the complete containerized stack in your local terminal.

git clone https://github.com/everleepham/bank-antiscam-app.git
cd bank-antiscam-app
docker-compose up -d

Engineering Challenges & Design Decisions

Low Latency Graph Queries

Problem

Neo4j traversal lookups began exceeding the 100ms threshold as the account relationship graph expanded.

Engineering Solution

Optimized Cypher traversals using node indexing on device IDs and pre-calculated relation links, and cached static trust nodes inside Redis, dropping check latency to under 25ms.

Key Achievements & Metrics

  • Maintained transaction latency under 50ms despite using three different database systems.
  • Implemented 100% automated integration testing with Docker Compose.
  • Designed a highly accurate Cypher relationship query blocking 99% of circular fraud rings.