Banking Microservices Architecture
This project implements a banking system using a microservices architecture. The system is built with Spring Boot and Micronaut frameworks, providing a robust and scalable solution for banking operations. The project consists of 6 microservices that handle different aspects of the banking domain, from user management to financial transactions.
The application is built using the following components:
| Service | Framework | Port | Description |
|---|---|---|---|
| Eureka Server | Spring Boot | 8761 | Service discovery and registration |
| API Gateway | Spring Boot | 8999 | Entry point for all client requests |
| User Service | Micronaut | 8090 | Manages user accounts and authentication |
| Account Service | Micronaut | 8091 | Handles bank accounts and balances |
| Transaction Service | Micronaut | 8092 | Processes financial transactions |
| Loan Service | Micronaut | 8093 | Manages loan applications and processing |
- Spring Boot: For Eureka Server and API Gateway
- Micronaut: For domain-specific microservices
- Spring Cloud Netflix: For service discovery
- Spring Cloud Gateway: For API routing
- JPA/Hibernate: For database operations
- RESTful APIs: For inter-service communication
Service discovery server that allows microservices to find and communicate with each other.
Access the Dashboard: http://localhost:8761/
Entry point for all client requests, routing them to the appropriate microservice.
Access the Gateway: http://localhost:8999/
Manages user information and authentication.
API Endpoints:
GET /user- Get all usersGET /user/{id}- Get user by IDPOST /user/save- Create a new userGET /user/findById/{id}- Find user by IDGET /user/findByEmail/{email}- Find user by emailPOST /user/delete/{id}- Delete userPUT /user/update/{id}- Update user details
Manages bank accounts and account balances.
API Endpoints:
POST /account/user/{userId}- Create account for a userGET /account/user/{userId}- Get all accounts for a userGET /account/{accountId}- Get account by IDGET /account/user/{userId}/{accountId}- Get specific account for a userDELETE /account/delete/{accountId}- Delete accountGET /account/user/{userId}/{accountId}/balance- Get account balancePUT /account/{accountId}/deduct/{amount}- Deduct balance from accountPUT /account/{accountId}/add/{amount}- Add balance to account
Processes financial transactions between accounts.
API Endpoints:
GET /transaction/{id}- Get transaction by IDGET /transaction/- Get all transactionsPOST /transaction/send- Create a new transactionPOST /transaction/sendFromLoan- Create a transaction from loanGET /transaction/account/{accountId}- Get transactions by account IDGET /transaction/{accountId}/sent- Get sent transactionsGET /transaction/{accountId}/received- Get received transactions
Manages loan applications, approvals, and repayments.
API Endpoints:
POST /loan/apply- Apply for a loanGET /loan/{id}- Get loan by IDGET /loan/user/{id}- Get loans by user IDPUT /loan/approve/{loanId}- Approve a loanGET /loan/{loanId}/repayment- Get repayment amount for a loanPUT /loan/{loanId}/pay- Pay a loan
- Java 17 or higher
- Maven
- A relational database MySQL
-
Clone the repository
git clone https://github.com/Vin-it-9/Bank-Managment-Microservice.git cd Bank-Managment-Microservice -
Start Eureka Server
cd eureka-server ./mvnw spring-boot:run -
Start API Gateway
cd api-gateway ./mvnw spring-boot:run -
Start the domain microservices
# Start User Service cd user-service ./mvnw mn:run # Start Account Service cd account-service ./mvnw mn:run # Start Transaction Service cd transaction-service ./mvnw mn:run # Start Loan Service cd loan-service ./mvnw mn:run
-
Verify the setup
- Access the Eureka Dashboard at http://localhost:8761/
- Ensure all microservices are registered with Eureka
- Test API endpoints through the API Gateway at http://localhost:8999/
-
Creating a User Account
- Register a user through the User Service
- Create a bank account for the user through the Account Service
-
Making Transactions
- Transfer money between accounts using the Transaction Service
- Check account balance through the Account Service
-
Applying for Loans
- Submit loan application through the Loan Service
- Approve/process loans through admin endpoints
- Transfer loan amount to user account through Transaction Service
- Set up repayment schedule and track payments
Security implementations include:
- Authentication
- Secure communication between services