A modern, scalable online banking system built using a microservices architecture with Java, Spring Boot, Apache Kafka, PostgreSQL, JPA/Hibernate, Docker, and more. This project demonstrates a modular, event-driven banking application with services for account management, transactions, loans, notifications, and authentication.
- Features
- Technologies
- Prerequisites
- Setup and Installation
- Running the Application
- Services
- Environment Variables
- Contributing
- License
- Account Management: Create, update, and manage user accounts and balances.
- Transaction Processing: Handle transfers, payments, and transaction history.
- Loan Management: Process loan applications, schedules, and credit scoring.
- Notification System: Send emails and SMS notifications using event-driven architecture.
- Authentication: Secure user authentication with JWT/OAuth2 via Keycloak.
- Service Discovery: Dynamic service registration and discovery with Eureka.
- Distributed Tracing: Monitor requests with Zipkin.
- Caching: Improve performance with EhCache .
- Event-Driven Communication: Asynchronous messaging with Kafka.
- Backend: Java, Spring Boot, Spring Cloud
- Databases: PostgreSQL (JPA/Hibernate), MongoDB
- Message Broker: Apache Kafka, Zookeeper
- Authentication: Keycloak (JWT/OAuth2)
- Service Discovery: Netflix Eureka
- API Gateway: Spring Cloud Gateway
- Distributed Tracing: Zipkin
- Docker: Version 20.10 or higher
- Docker Compose: Version 1.29 or higher
- Java: JDK 17 (for local development)
- Maven: For building Spring Boot services
- Git: To clone the repository
- Containerization: Docker, Docker Compose
- Monitoring: pgAdmin, Mongo Express
- Email Testing: Maildev
- Clone the Repository:
git clone https://github.com/your-username/online-banking-microservices-api.git cd online-banking-microservices-api
- Build the Project (optional, if running locally without Docker):
mvn clean install
- Configure Environment Variables:
- See the Environment Variables (#environment-variables) section for details.
- Update the docker-compose.yml file if needed.
- Start the Services with Docker Compose:
docker-compose up -d
- Verify Services:
- PostgreSQL:
localhost:5432
- Keycloak:
localhost:9098
- pgAdmin:
localhost:5050
- Zipkin:
localhost:9411
- MongoDB:
localhost:27017
- Mongo Express:
localhost:8081
- Kafka:
localhost:9092
- Maildev:
localhost:1080
(UI),localhost:1025
(SMTP)
- Stop the Services
docker-compose down
| Service | Description | Port |
|--------------------|--------------------------------------|------------|
| **PostgreSQL** | Relational database for core data | 5432 |
| **Keycloak** | Authentication and authorization | 9098 |
| **pgAdmin** | PostgreSQL management UI | 5050 |
| **Zipkin** | Distributed tracing | 9411 |
| **MongoDB** | NoSQL database for notifications | 27017 |
| **Mongo Express** | MongoDB management UI | 8081 |
| **Zookeeper** | Kafka coordination | 22181 |
| **Kafka** | Message broker | 9092 |
| **Maildev** | Email testing server | 1080, 1025 |
The following environment variables are defined in docker-compose.yml
. Customize them as needed:
Variable | Default Value | Description |
---|---|---|
POSTGRES_USER |
postgres |
PostgreSQL username |
POSTGRES_PASSWORD |
admin@123 |
PostgreSQL password |
KEYCLOAK_ADMIN |
admin |
Keycloak admin username |
KEYCLOAK_ADMIN_PASSWORD |
admin |
Keycloak admin password |
PGADMIN_DEFAULT_EMAIL |
[email protected] |
pgAdmin login email |
PGADMIN_DEFAULT_PASSWORD |
admin |
pgAdmin login password |
MONGO_INITDB_ROOT_USERNAME |
root |
MongoDB root username |
MONGO_INITDB_ROOT_PASSWORD |
password |
MongoDB root password |
- Fork the repository.
- Create a feature branch (
git checkout -b feature/your-feature
). - Commit your changes (
git commit -m "Add your feature"
). - Push to the branch (
git push origin feature/your-feature
). - Open a Pull Request.