A Production-Grade Microservices Platform for Real-Time Financial Fraud Detection
FraudShield is a microservices-based fraud detection and case management platform built with Java and Spring Cloud. It monitors financial transactions in real time, scores them for fraud risk, escalates suspicious activity into case workflows, and notifies relevant parties β all through independent, scalable services communicating via a service registry and API gateway.
Designed as a full-stack microservices reference architecture β covering service discovery, JWT authentication, inter-service communication, fraud scoring, case lifecycle management, and notifications.
- Architecture
- Services
- Tech Stack
- Getting Started
- Service Startup Order
- Environment Configuration
- API Overview
- Project Structure
- Key Flows
- License
ββββββββββββββββββββββββββββββββ
β Service-Registry β
β Netflix Eureka :8761 β
ββββββββββββββ¬ββββββββββββββββββ
β (all services register here)
βββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββ
β β β
βββββββββΌβββββββββ ββββββββββββΌβββββββββββ ββββββββββββΌβββββββββββ
β API-Gateway β β Auth-Service β β Transaction-Service β
β Spring Cloud β β JWT :8081 β β CRUD + Events :8082β
β Gateway :8080 β βββββββββββββββββββββββ ββββββββββββ¬βββββββββββ
βββββββββ¬βββββββββ β
β (routes all β (triggers fraud eval)
β client traffic) βΌ
β ββββββββββββββββββββββββββββ
β β Fraud-Detection-Service β
β β Risk Scoring :8083 β
β ββββββββββββ¬ββββββββββββββββ
β β (on high risk)
β βΌ
β ββββββββββββββββββββββββββββ
β β Fraud-Case-Service β
β β Case Management :8084 β
β ββββββββββββ¬ββββββββββββββββ
β β
β βΌ
β ββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββΆ Notification-Service β
β Email / SMS Alerts :8085 β
ββββββββββββββββββββββββββββ
| Service | Port | Description |
|---|---|---|
| Service-Registry | 8761 |
Netflix Eureka server β dynamic service registration & discovery |
| API-Gateway | 8080 |
Single entry point β routes, filters, and load-balances all traffic |
| Auth-Service | 8081 |
User registration, login, and JWT token issuance & validation |
| Transaction-Service | 8082 |
Creates, stores, and manages financial transactions |
| Fraud-Detection-Service | 8083 |
Evaluates transactions and produces a fraud risk score |
| Fraud-Case-Service | 8084 |
Opens and manages cases for flagged/suspicious transactions |
| Notification-Service | 8085 |
Sends email/SMS alerts for fraud events and case updates |
| Technology | Role |
|---|---|
| Java 17+ | Language |
| Spring Boot 3.x | Microservice framework |
| Spring Cloud 2023.x | Cloud-native patterns (discovery, gateway, config) |
| Spring Cloud Netflix Eureka | Service registry & discovery |
| Spring Cloud Gateway | API gateway with filters |
| Spring Cloud OpenFeign | Declarative inter-service REST calls |
| Spring Security + JWT | Authentication and authorization |
| Spring Data JPA | Database ORM layer |
| Technology | Role |
|---|---|
| MySQL / PostgreSQL | Relational persistence per service |
| Hibernate | JPA implementation |
| Technology | Role |
|---|---|
| Maven | Build and dependency management |
| Lombok | Reduces boilerplate (getters, builders) |
| Docker (optional) | Containerized deployment |
- Java 17 or higher
- Maven 3.8+
- MySQL or PostgreSQL
- Git
git clone https://github.com/Sathish292004/FraudShield.git
cd FraudShield
β οΈ Order matters. Microservices must start in this sequence:
1οΈβ£ Service-Registry (must be first β all others register here)
2οΈβ£ Auth-Service (needed for token validation in gateway)
3οΈβ£ API-Gateway (starts routing after services are up)
4οΈβ£ Transaction-Service
5οΈβ£ Fraud-Detection-Service
6οΈβ£ Fraud-Case-Service
7οΈβ£ Notification-Service
# Terminal 1 β Registry first
cd Service-Registry && mvn spring-boot:run
# Terminal 2
cd Auth-Service && mvn spring-boot:run
# Terminal 3
cd API-Gateway && mvn spring-boot:run
# Terminal 4
cd Transaction-Service && mvn spring-boot:run
# Terminal 5
cd Fraud-Detection-Service && mvn spring-boot:run
# Terminal 6
cd Fraud-Case-Service && mvn spring-boot:run
# Terminal 7
cd Notification-Service && mvn spring-boot:runOpen the Eureka dashboard at http://localhost:8761 β all services should appear as UP.
Each service has its own application.yml. Below are the key shared settings:
# Eureka client (in every service EXCEPT Service-Registry)
eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka/
instance:
prefer-ip-address: true
# Database (per service β use separate DB schemas)
spring:
datasource:
url: jdbc:mysql://localhost:3306/fraudshield_<service_name>
username: root
password: yourpassword
jpa:
hibernate:
ddl-auto: updateCREATE DATABASE fraudshield_auth;
CREATE DATABASE fraudshield_transactions;
CREATE DATABASE fraudshield_fraud_detection;
CREATE DATABASE fraudshield_fraud_cases;
CREATE DATABASE fraudshield_notifications;All requests go through the API-Gateway at http://localhost:8080.
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/auth/register |
Register a new user |
POST |
/api/auth/login |
Login and receive JWT token |
GET |
/api/auth/validate |
Validate an existing token |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/transactions |
Submit a new transaction |
GET |
/api/transactions |
List all transactions |
GET |
/api/transactions/{id} |
Get transaction by ID |
GET |
/api/transactions/account/{id} |
Get by account |
GET |
/api/transactions/status/{status} |
Filter by status |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/fraud/evaluate |
Score a transaction for fraud risk |
GET |
/api/fraud/history/{transactionId} |
Get evaluation history |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/cases |
Open a new fraud case |
GET |
/api/cases |
List all cases |
GET |
/api/cases/{id} |
Get case details |
PATCH |
/api/cases/{id}/status |
Update case status |
POST |
/api/cases/{id}/resolve |
Resolve a case |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/notifications/send |
Send a notification |
GET |
/api/notifications/{userId} |
Get user notifications |
FraudShield/
β
βββ Service-Registry/ # Netflix Eureka Server
β βββ src/main/java/
β β βββ ServiceRegistryApplication.java
β βββ src/main/resources/
β βββ application.yml
β
βββ API-Gateway/ # Spring Cloud Gateway
β βββ src/main/java/
β β βββ ApiGatewayApplication.java
β βββ src/main/resources/
β βββ application.yml
β
βββ Auth-Service/ # JWT Auth
β βββ src/main/java/
β β βββ controller/
β β βββ service/
β β βββ model/
β β βββ security/
β βββ src/main/resources/
β
βββ Transaction-Service/ # Transaction CRUD + events
β βββ src/main/java/
β β βββ controller/
β β βββ service/
β β βββ repository/
β β βββ model/
β β βββ dto/
β β βββ client/
β βββ src/main/resources/
β
βββ Fraud-Detection-Service/ # Risk scoring engine
β βββ src/main/java/
β β βββ controller/
β β βββ service/
β β βββ model/
β β βββ rules/
β βββ src/main/resources/
β
βββ Fraud-Case-Service/ # Case lifecycle management
β βββ src/main/java/
β β βββ controller/
β β βββ service/
β β βββ repository/
β β βββ model/
β βββ src/main/resources/
β
βββ Notification-Service/ # Alert dispatch
β βββ src/main/java/
β β βββ controller/
β β βββ service/
β β βββ model/
β βββ src/main/resources/
β
βββ .gitignore
βββ LICENSE
Client
βββPOST /api/transactionsβββΆ API-Gateway
ββββΆ [JWT filter validates token via Auth-Service]
ββββΆ Transaction-Service
β saves transaction (PENDING)
ββββΆ Fraud-Detection-Service
β evaluates risk score
β if score > threshold:
ββββΆ Fraud-Case-Service (open case)
ββββΆ Notification-Service (send alert)
β update transaction β FLAGGED / APPROVED
Client
βββPOST /api/auth/loginβββΆ API-Gateway
ββββΆ Auth-Service
β validates credentials
β returns JWT token
Client stores JWT and attaches to subsequent requests as Bearer token
- All endpoints (except
/api/auth/**) require a valid JWT Bearer token - The API-Gateway validates tokens before forwarding requests
- Each service independently verifies claims where needed
- Passwords are stored with BCrypt hashing
Copyright (c) 2026 Sathish Kumar B
Educational Use Only License
This project is provided for educational and learning purposes only.
You may NOT copy, modify, redistribute, or use this code for commercial purposes
without prior written permission from the copyright owner.
See the LICENSE file for full terms.
Sathish Kumar B
- GitHub: @Sathish292004
π‘ For service-specific documentation, see the
README.mdinside each service folder.