How kartik1502/spring-boot-microservices-banking-application works
Project type and purpose
• This is a Spring-Boot Microservices Banking Application. It uses Spring Cloud for service discovery (Eureka), an API Gateway for routing and security, and independent microservices for user management, accounts, fund transfers, and transactions. Each microservice uses its own MySQL database and communicates via Feign clients and service discovery.
Main components
a. Clients (Web/Mobile)
b. API Gateway (Spring Cloud Gateway)
c. Service Registry (Eureka)
d. Authentication & Authorization (Keycloak)
e. Microservices:
• User Service
• Account Service
• Fund Transfer Service
• Transaction Service
• Sequence Generator Service
f. Databases (one per microservice; e.g., MySQL instances)
g. External systems (if any—here Keycloak and potentially email/SMS for future notifications)
Relationships and data flows
1. Client sends request → API Gateway
2. API Gateway authenticates/authorizes via Keycloak
3. API Gateway looks up service instances in Service Registry and forwards request to the appropriate microservice
4. Microservices call other microservices using Feign clients (through the gateway or via service discovery)
5. Microservices persist data to their own databases
6. For ID generation, microservices call the Sequence Generator Service
Architectural patterns and design principles
• Microservice per bounded context (User, Account, Fund Transfer, Transaction, Sequence Generator)
• Database per service (isolated schemas, independent scaling)
• Service Discovery (Eureka) prevents hard-coding endpoints
• API Gateway centralizes routing, authentication, rate limiting, and cross-cutting concerns
• Feign clients for declarative inter-service calls
• Keycloak for centralized auth (OAuth2/OpenID Connect)
• Exception handling and DTO mapping layers inside each service
Technology stack
• Spring Boot (each service)
• Spring Cloud Netflix Eureka (Service Registry)
• Spring Cloud Gateway (API Gateway)
• Spring Security + Keycloak adapter
• Spring Data JPA + MySQL
• OpenFeign for inter-service communication
• Maven for build management
• Dockerfile in User-Service for containerization
• Postman collection for API testing