Banking Microservices is a Maven multi-module Spring Boot project by Sajal Halder that lays out a banking backend as independent services. It follows hexagonal architecture, clean code principles and SOLID design.
The repository is architecture-first. This page describes how it is organized and the engineering practices it sets down, and it is not a claim that every module is a production banking system.
Services
Six business services each own one part of a banking domain.
- user-managementUser accounts and authentication.
- account-serviceAccount management.
- transaction-serviceTransaction processing.
- card-serviceCard management.
- payment-servicePayment processing.
- notification-serviceNotifications.
Infrastructure and shared modules
- api-gatewayThe single entry point for external communication.
- service-discoveryEureka, so services find each other without hard-coded addresses.
- saga-coordinatorThe place for the saga pattern, which sequences a multi-service operation such as a payment as a series of local transactions with compensation when a step fails.
- common modulesShared DTOs, event definitions for asynchronous communication, and utilities.
Hexagonal architecture inside each service
Every service is split into three layers so business rules never depend on frameworks or databases.
- DomainModels, value objects, domain services, and the input and output ports that define how the outside world may interact with them.
- ApplicationUse-case orchestration built on the input and output ports.
- InfrastructureThe adapters: Spring configuration, persistence, Kafka messaging and REST controllers.
Engineering practices
- Clean codeMeaningful names, single responsibility, small functions, self-explanatory code and appropriate exceptions.
- SOLIDAll five principles are documented as the design baseline, with dependencies pointing at abstractions.
- Git workflowBranches for main, develop, feature, bugfix and release, conventional commit messages, pull requests into develop with a reviewer's approval and passing CI, and squash merges.
- CI/CD stagesBuild and unit tests, integration tests with Testcontainers, a security scan, a SonarQube quality gate, then deployment to staging and production.