A fully functional Banking System built using Spring Boot Microservices, Eureka Service Registry, API Gateway, MongoDB, Docker, and Resilience4j Circuit Breakers.
This system supports:
- Creating bank accounts
- Deposits, Withdrawals, Transfers
- Storing transaction history
- Sending notifications
- Service discovery & load balancing
- Fault tolerance with circuit breakers
| Service | Port | Description |
|---|---|---|
| Eureka Server | 8761 | Service registry & discovery |
| API Gateway | 8080 | Routes incoming client requests |
| Account Service | 8081 | Manages account creation & balance updates |
| Transaction Service | 8082 | Handles deposit/withdraw/transfer |
| Notification Service | 8083 | Sends transaction notifications |
| MongoDB | 27017 | Shared database container |
- Java 17
- Spring Boot 3
- Spring Cloud Netflix Eureka
- Spring Cloud Gateway
- MongoDB
- RestTemplate
- Resilience4j Circuit Breaker
- Docker & Docker Compose
- SLF4J + Logback Logging
- JUnit + Mockito
BankApp-Microservices/
├── Eureka-Server/
├── ApiGateway/
├── Account-Service/
├── Transaction-Service/
├── Notification-Service/
├── docker-compose.yml
└── README.md
cd Eureka-Server
mvn spring-boot:run
Run each
cd Account-Service → mvn spring-boot:run
cd Transaction-Service → mvn spring-boot:run
cd Notification-Service → mvn spring-boot:run
cd ApiGateway → mvn spring-boot:run
http://localhost:8761
Every service should include a Dockerfile:
FROM eclipse-temurin:17-jdk
COPY ./target/*.jar app.jar
ENTRYPOINT ["java","-jar","app.jar"]
Step 2: Run Docker Compose
docker ps
POST /api/accounts
PUT /api/accounts/{accNo}/balance
PUT /api/accounts/{accNo}/status
GET /api/accounts/{accNo}
POST /api/transactions/deposit
POST /api/transactions/withdraw
POST /api/transactions/transfer
GET /api/transactions/{accNo}
POST /api/notifications/send
Used in TransactionService:
- If Account-Service is down → fallback creates a FAILED transaction.
- If Notification-Service is down → fallback logs a warning.
- Ensures the system remains stable and never fully crashes.
Each service includes:
- Unit tests using JUnit + Mockito
- Mock service tests
- Circuit breaker fallback tests
- REST controller tests using RestTemplate
mvn test
- All services use SLF4J + Logback
- API Gateway logs every incoming request
- Transaction Service logs every deposit, withdrawal, and transfer
- Notification Service logs every message sent
