Skip to content

pltthakan/fintech-realtime-processing

Repository files navigation

Fintech Realtime Processing Platform

A real-time fintech transaction processing platform built with Spring Boot microservices, Apache Kafka, PostgreSQL, MongoDB, Redis, RabbitMQ, Docker, and Spring Cloud.

The system processes financial transactions through an event-driven pipeline that includes validation, fraud detection, balance updates, notifications, and transaction archiving.

Local configuration

Copy .env.example to .env and replace every password and JWT_SECRET before starting the stack. .env is intentionally ignored by Git.

The Docker Compose defaults expose only the frontend, API gateway, and local-only operational interfaces. Internal microservices, databases, and brokers are reachable only on the Docker network.

For an existing PostgreSQL volume, apply schema updates with ./manage.sh migrate before starting a version that requires a new table or column.


Architecture Overview

Ekran Resmi 2026-04-07 22 56 47

The project uses a Kafka topic pipeline where each microservice is responsible for one stage of the transaction lifecycle.


UI Preview

Ekran Resmi 2026-04-13 00 42 18 Ekran Resmi 2026-06-23 12 06 51
See more screenshots

Accounts

Ekran Resmi 2026-04-13 00 43 25

Transactions

Ekran Resmi 2026-04-13 00 44 25

New Transaction

Ekran Resmi 2026-04-13 00 47 26 Ekran Resmi 2026-04-13 00 47 14

Administrator tasks

Ekran Resmi 2026-06-23 12 04 39 Ekran Resmi 2026-06-23 12 06 41 Ekran Resmi 2026-06-23 12 05 09 Ekran Resmi 2026-06-23 12 05 36

Features

  • Real-time transaction processing
  • Event-driven microservice architecture
  • Fraud and AML validation pipeline
  • Account balance update and transaction persistence
  • Email / SMS / push notification support
  • PostgreSQL for operational data
  • MongoDB for completed transaction archive
  • Redis for cache, session, and distributed lock support
  • RabbitMQ for asynchronous notification delivery
  • Eureka-based service discovery
  • API Gateway routing with Spring Cloud Gateway
  • Immutable audit trail for account and transaction access/changes
  • Docker Compose environment for all services
  • Kafka UI for topic monitoring

Tech Stack

Backend

  • Java 21
  • Spring Boot
  • Spring Cloud Gateway
  • Spring Security
  • Spring Data JPA
  • Hibernate
  • Spring Cloud Netflix Eureka

Messaging

  • Apache Kafka
  • Kafka Connect
  • RabbitMQ

Databases

  • PostgreSQL
  • MongoDB
  • Redis

Frontend

  • React

Infrastructure

  • Docker
  • Docker Compose
  • Kafka UI
  • Zookeeper

Microservices

API Gateway

Port: 8080

Responsibilities:

  • Single entry point for the frontend
  • Route requests to microservices
  • Future support for rate limiting, JWT validation, and logging

User Service

Port: 8081

Responsibilities:

  • User registration and authentication
  • JWT token generation
  • Role-based access control

Database schema:

  • user_service

Account Service

Port: 8082

Responsibilities:

  • Update account balances
  • Process transfer operations
  • Persist account and transaction information
  • Store account/transaction audit records in audit_service.audit_logs

Consumes:

  • transaction-checked

Produces:

  • transaction-processed

Database schema:

  • account_service

Audit log API

GET /api/v1/audit-logs?page=0&size=50 is routed through the API Gateway and is restricted to the ADMIN role. Optional actorUsername, action, and resourceType filters are supported. It returns the actor, time, action, account/transaction resource, service, and trusted client IP.

Successful account and transaction reads/creates are recorded automatically. Audit records are append-only at the application level; no update or delete API is exposed.


Transaction Service

Port: 8083

Responsibilities:

  • Receive transaction requests
  • Perform initial validation
  • Publish transaction events to Kafka

Produces:

  • transaction-raw

Database schema:

  • transaction_service

Fraud Detection Service

Port: 8084

Responsibilities:

  • Fraud and AML checks
  • Detect suspicious transaction behavior
  • Validate transaction amount and frequency

Consumes:

  • transaction-raw

Produces:

  • transaction-checked

Database schema:

  • fraud_service

Notification Service

Port: 8085

Responsibilities:

  • Send email, SMS, or push notifications
  • Forward notification tasks to RabbitMQ workers

Consumes:

  • transaction-processed

Produces:

  • transaction-completed

Reporting Service

Port: 8086

Responsibilities:

  • Dashboard and reporting APIs
  • Query completed transactions from MongoDB
  • Provide analytics and statistics

Eureka Server

Port: 8761

Responsibilities:

  • Service registration and discovery
  • Dynamic routing and load balancing support

Kafka Topic Pipeline

transaction-raw
    ↓
transaction-validated
    ↓
transaction-checked
    ↓
transaction-processed
    ↓
transaction-completed

Each topic represents a stage of the transaction lifecycle.

Reliable event delivery

The money-movement path uses the Transactional Outbox and Consumer Inbox patterns:

  • transaction-service stores the new transaction and its transaction-raw outbox event in the same PostgreSQL transaction.
  • account-service atomically claims each transaction event in processed_events, updates balances, and writes the next outbox event.
  • Duplicate Kafka deliveries are ignored by the (consumer_name, event_id) primary key, so a balance operation is applied once.
  • Outbox publishers wait for Kafka acknowledgement before marking an event PUBLISHED. Failed sends stay PENDING and are retried.
  • Account consumer failures are retried and then published to transaction-dlq instead of being swallowed.

Because outbox delivery is intentionally at-least-once, downstream consumers must also be idempotent when they perform non-repeatable side effects.


Database Design

PostgreSQL

Used for operational and transactional data.

Schemas:

  • user_service
  • account_service
  • transaction_service
  • fraud_service

Example tables:

  • users
  • accounts
  • transactions
  • fraud_checks

MongoDB

Used to archive completed transactions and support reporting queries.

The archive flow:

transaction-completed
      ↓
Kafka Connect Sink
      ↓
MongoDB

Service Discovery

All services register themselves in Eureka.

Example configuration:

spring:
  application:
    name: transaction-service

eureka:
  client:
    service-url:
      defaultZone: http://localhost:8761/eureka/

Example gateway route:

uri: lb://TRANSACTION-SERVICE

Running the Project

1. Clone the repository

git clone <repository-url>
cd fintech-realtime-processing

2. Start the infrastructure

docker-compose up -d

This starts:

  • PostgreSQL
  • MongoDB
  • Redis
  • RabbitMQ
  • Kafka
  • Zookeeper
  • Kafka UI

3. Start Eureka Server

cd eureka-server
mvn spring-boot:run

Open:

http://localhost:8761

4. Start the microservices

Run the following services in order:

  1. user-service
  2. transaction-service
  3. fraud-detection-service
  4. account-service
  5. notification-service
  6. reporting-service
  7. api-gateway

Example:

cd transaction-service
mvn spring-boot:run

Monitoring

Kafka UI:

http://localhost:9090

Eureka Dashboard:

http://localhost:8761

API Gateway:

http://localhost:8080

System Monitoring & Infrastructure

View infrastructure dashboards

Kafka UI

Ekran Resmi 2026-04-13 00 55 00

RabbitMQ

Ekran Resmi 2026-04-13 00 59 48

Eureka

Ekran Resmi 2026-04-13 00 54 31

Future Improvements

  • Distributed transaction management with Saga Pattern
  • Extend Consumer Inbox idempotency to notification and reporting side effects
  • Operational DLQ replay tooling
  • Centralized logging with ELK or Grafana
  • OpenTelemetry and tracing
  • Resilience4j circuit breaker and retry
  • Kubernetes deployment
  • AI-based fraud detection model

Example Resume Description

Developed a real-time fintech transaction processing platform using Spring Boot microservices, Apache Kafka, PostgreSQL, MongoDB, Redis, RabbitMQ, and Docker. Designed an event-driven Kafka topic pipeline for fraud detection, balance processing, notifications, and transaction archiving.

About

Real-time fintech transaction processing platform built with Spring Boot microservices, Kafka, Redis, PostgreSQL, MongoDB, RabbitMQ, Eureka, API Gateway, Docker, and React.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors