Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PayFlowX

Enterprise Payment Processing Platform

PayFlowX is a production-oriented payment processing platform built using Java 21, Spring Boot Microservices, RabbitMQ, PostgreSQL, Redis, Docker, Kubernetes, Prometheus, Grafana, Zipkin, Jenkins, and GitHub Actions.

The platform is designed using modern distributed system principles, event-driven communication, observability-first architecture, fault tolerance patterns, and scalable microservice design.


Project Overview

PayFlowX simulates the core architecture of modern fintech platforms such as Stripe, Razorpay, Adyen, and PayPal.

The platform supports:

  • User Onboarding
  • Authentication & Authorization
  • Merchant Management
  • Order Processing
  • Payment Processing
  • Settlement Management
  • Notifications
  • Audit Logging
  • Distributed Tracing
  • Monitoring & Alerting
  • CI/CD Automation
  • Containerized Deployment

The objective of the project is to demonstrate enterprise backend engineering practices and production-grade microservice architecture.


Architecture Overview

Client Applications

API Gateway

Discovery Server (Eureka)

Microservices

  • Auth Service
  • User Service
  • Merchant Service
  • Order Service
  • Payment Service
  • Settlement Service
  • Notification Service
  • Audit Service

Infrastructure

  • PostgreSQL
  • RabbitMQ
  • Redis
  • Prometheus
  • Grafana
  • Zipkin
  • AlertManager
  • Jenkins
  • GitHub Actions
  • Docker
  • Kubernetes

Core Features

Authentication & Authorization

Auth Service provides centralized authentication and token management.

Features

  • JWT Authentication
  • Access Token Generation
  • Refresh Token Support
  • Role-Based Authorization
  • RSA Key Support
  • Strategy Pattern Based Token Generation

Supported JWT Algorithms

  • HS256
  • RS256

The authentication module uses the Strategy Pattern to dynamically select the JWT signing implementation.

Supported Roles

  • USER
  • ADMIN

User Service

Responsible for user lifecycle management.

Features

  • User Profile Management
  • KYC Submission
  • KYC Verification
  • Address Management
  • Account Suspension
  • Account Blocking
  • Eligibility Validation
  • User Metrics

Merchant Service

Responsible for merchant onboarding and management.

Features

  • Merchant Registration
  • Merchant Profile Management
  • Merchant Verification
  • Merchant Status Management
  • Merchant Validation
  • Merchant Metrics

A USER can enroll and become a Merchant through the Merchant Service.


Order Service

Responsible for order lifecycle management.

Features

  • Order Creation
  • Order Validation
  • Order Status Tracking
  • Order Event Publishing
  • Merchant Validation Integration

Payment Service

Responsible for payment processing and orchestration.

Features

  • Payment Creation
  • Payment Validation
  • Payment Processing
  • Payment Status Management
  • Payment Event Publishing
  • Idempotent Payment Handling

Design Pattern

Adapter Pattern is used for payment method routing.

Supported Payment Methods:

  • Card
  • UPI
  • Bank Transfer

Based on user selection, the appropriate payment adapter is dynamically selected.


Settlement Service

Responsible for merchant settlement processing.

Features

  • Settlement Generation
  • Settlement Tracking
  • Settlement Status Management
  • Settlement Event Publishing

Notification Service

Responsible for platform notifications.

Features

  • Event Driven Notifications
  • RabbitMQ Consumers
  • Retry Processing
  • Dead Letter Queue Handling
  • Email Sending

Supported Notification Categories:

  • User Notifications
  • Merchant Notifications
  • Order Notifications
  • Payment Notifications
  • Settlement Notifications

Audit Service

Acts as the platform audit trail.

Features

  • Audit Event Persistence
  • Cross-Service Event Tracking
  • Correlation ID Tracking
  • Compliance-Oriented Event Storage

Every business-critical event is persisted for traceability.


Event Driven Architecture

PayFlowX uses RabbitMQ as the messaging backbone.

Published Event Categories

User Events

  • USER_CREATED
  • USER_KYC_SUBMITTED
  • USER_KYC_APPROVED
  • USER_ACCOUNT_BLOCKED

Merchant Events

  • MERCHANT_CREATED
  • MERCHANT_VERIFIED
  • MERCHANT_SUSPENDED

Order Events

  • ORDER_CREATED
  • ORDER_UPDATED

Payment Events

  • PAYMENT_CREATED
  • PAYMENT_SUCCESS
  • PAYMENT_FAILED

Settlement Events

  • SETTLEMENT_CREATED
  • SETTLEMENT_COMPLETED

Audit Events

  • Cross-Service Audit Records

Reliability & Resilience

The platform incorporates multiple production-grade resilience patterns.

Implemented Patterns

  • Saga Pattern
  • Transactional Outbox Pattern
  • Idempotency Pattern
  • Retry Mechanisms
  • Dead Letter Queue Handling
  • Resilience4j Circuit Breakers
  • Resilience4j Retry
  • Resilience4j Rate Limiting

These patterns ensure fault tolerance and consistency across distributed services.


Redis Integration

Redis is used for:

  • Caching
  • Performance Optimization
  • Fast Data Access

Observability

Metrics

Implemented using:

  • Spring Boot Actuator
  • Micrometer
  • Prometheus

Business metrics are exposed from services and visualized through Grafana.


Logging

Centralized logging configuration includes:

  • Trace ID
  • Span ID
  • Correlation ID

Logback configuration is shared across services through a common logging strategy.


Distributed Tracing

Implemented using:

  • Micrometer Tracing
  • Zipkin

Allows end-to-end request tracing across service boundaries.


Monitoring Dashboards

Available Grafana Dashboards:

  • API Gateway Dashboard
  • Merchant Dashboard
  • Orders Dashboard
  • Payment Dashboard
  • Settlement Dashboard
  • Notification Dashboard
  • Notification DLQ Dashboard
  • Platform Health Dashboard

Alerting

AlertManager is configured for platform alerts.

Current Alerts Include:

  • Notification Dead Letter Queue Growth
  • Service Health Monitoring

Technology Stack

Backend

  • Java 21
  • Spring Boot
  • Spring Security
  • Spring Data JPA
  • Spring Cloud
  • OpenFeign

Database

  • PostgreSQL

Messaging

  • RabbitMQ

Caching

  • Redis

Observability

  • Micrometer
  • Prometheus
  • Grafana
  • Zipkin
  • AlertManager

DevOps

  • Docker
  • Docker Compose
  • Kubernetes
  • Jenkins
  • GitHub Actions

Documentation

  • OpenAPI 3
  • Swagger UI

CI/CD

GitHub Actions

Automated pipeline for:

  • Build Validation
  • Maven Packaging
  • Docker Image Creation
  • GitHub Container Registry Publishing

All services are built and published independently using matrix builds.


Jenkins

Jenkins pipeline supports:

  • Parallel Service Builds
  • SonarQube Analysis
  • Maven Packaging

Kubernetes Deployment

Kubernetes resources are available for:

  • Deployments
  • Services
  • ConfigMaps
  • Secrets
  • Horizontal Pod Autoscaling
  • Ingress
  • Namespace Isolation

Repository Structure

payflowx-platform
│
├── services
│   ├── discovery-server
│   ├── api-gateway
│   ├── auth-service
│   ├── user-service
│   ├── merchant-service
│   ├── order-service
│   ├── payment-service
│   ├── settlement-service
│   ├── notification-service
│   └── audit-service
│
├── infra
│   ├── prometheus
│   ├── grafana
│   ├── alertmanager
│   ├── jenkins
│   └── sonarqube
│
├── k8s
│
├── docs
│
└── scripts

Design Patterns Used

  • Strategy Pattern (JWT Algorithm Selection)
  • Adapter Pattern (Payment Method Routing)
  • Saga Pattern
  • Transactional Outbox Pattern

Current Platform Status

Completed:

  • Microservices Architecture
  • API Gateway
  • Service Discovery
  • Authentication & Authorization
  • User Management
  • Merchant Management
  • Order Management
  • Payment Management
  • Settlement Management
  • Notification Processing
  • Audit Logging
  • RabbitMQ Integration
  • Redis Integration
  • Saga Pattern
  • Transactional Outbox Pattern
  • Idempotency Handling
  • Resilience4j
  • Distributed Tracing
  • Metrics & Monitoring
  • Dockerization
  • Kubernetes Deployment Assets
  • CI/CD Pipelines

Future Enhancements

  • Payment Reconciliation Engine
  • Refund Management
  • Partial Refund Support
  • OpenTelemetry Migration
  • Centralized Log Aggregation (ELK/Loki)
  • Multi-Region Deployment
  • Advanced Fraud Detection

Learning Outcomes

This project demonstrates practical experience with:

  • Distributed Systems
  • Microservices Architecture
  • Event-Driven Design
  • Domain-Driven Service Boundaries
  • Secure Authentication
  • Messaging Systems
  • Fault Tolerance
  • Observability
  • CI/CD Automation
  • Kubernetes Deployments
  • Enterprise Backend Development

License

Licensed under the MIT License.

About

Production-grade payment orchestration platform demonstrating Spring Boot Microservices, Event-Driven Architecture, Distributed Transactions, Kubernetes, CI/CD, and Observability.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages