Skip to content

Repository files navigation

Payflow API — Backend Service

Build Java 25 Spring Boot License: MIT PRs Welcome

Payflow is a transactional payments backend built using Java 25 and Spring Boot 4.x, designed to evolve from a baseline REST API into an enterprise-grade payment system with ACID guarantees, event-driven architecture, and observability.


Current Status

The project is evolving through a phased implementation roadmap. See the full plan in Phased Roadmap.

Phase Description Status
Phase 0 Baseline REST API — User & Transaction CRUD with H2 in-memory storage ✅ Complete
Phase 1 Project hygiene — Spotless, Checkstyle, GitHub Actions CI ✅ Complete
Phase 2 Domain model hardening, DTO layer, validation, error handling ⬜ Not Started
Phase 3+ Concurrency control, Flyway, security, observability, and more ⬜ Not Started

Implemented Features

  • REST API: Basic CRUD endpoints for User registration and Transaction creation.
  • Layered Architecture: Controller → Service → Repository pattern with Spring Data JPA.
  • In-Memory Database: H2 with auto-generated schema for zero-dependency local development.
  • Code Quality: Spotless (Eclipse formatter) + Checkstyle enforced at Maven validate phase.
  • CI Pipeline: GitHub Actions workflow running mvn clean verify on push/PR to main.
  • Actuator: Health, info, and metrics endpoints exposed.

Target Architecture (Roadmap)

The following features are planned and will be implemented across future phases:

  • ACID transaction hardening with pessimistic locking and deadlock avoidance
  • Balance ledger with double-entry bookkeeping for auditability
  • DTO layer with input validation and RFC 7807 error responses
  • PostgreSQL with Flyway-managed schema migrations
  • Durable idempotency engine with SHA-256 payload hashing
  • Transactional outbox pattern for reliable event streaming
  • JWT authentication and authorization
  • Resilience4j fault tolerance (rate limiting, retry, circuit breaker)
  • Redis caching and distributed locking
  • Kafka event streaming
  • Structured logging with MDC trace correlation and Prometheus metrics
  • Multi-stage Docker build with full-stack Docker Compose
  • Kubernetes manifests with health probes and graceful shutdown
  • Gen-AI spend insights with Spring AI

See System Architecture Guide for detailed design documentation.


Project Documentation

Doc Description
📘 System Architecture Design patterns, concurrency control, observability
🗓️ Phased Roadmap Step-by-step evolution plan
🌐 API Specification Endpoints, payloads, validation rules, error formats
📋 Conventions Coding standards, Git workflow, testing rules
📜 Architecture Decisions Decision records with context and trade-offs

Quick Start

Prerequisites

  • JDK 25 (Temurin recommended)
  • Maven 3.9+

Build & Run

# Build and run tests
mvn clean verify

# Start locally (H2 in-memory, port 8080)
mvn spring-boot:run
  • H2 Console: http://localhost:8080/h2-console
    • JDBC URL: jdbc:h2:mem:payupidb
    • Credentials: user / user

Docker

docker-compose up --build

License

This project is licensed under the MIT License — see the LICENSE file for details.

About

Payflow - High-throughput, ACID-compliant payments backend built with Java 25 & Spring Boot 4. Features pessimistic locking, durable idempotency, transactional outbox, Redis caching, Kafka streaming & Spring AI.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Used by

Contributors

Languages