Loretta Bank is a modern online banking system built with a Spring Boot backend and a React frontend. The system consists of multiple microservices deployed on a Kubernetes cluster and provides features for user management, account management, transactions, loans, cards, and customer support.
The project is divided into two main parts:
- Server: A Spring Boot application consisting of multiple microservices.
- Client: A React application that interacts with the backend services.
- Java 22
- Maven 3.8+
- Docker
- Kubernetes cluster
- Node.js 16+
- PostgreSQL 14+
- Neo4j (for customer-support-service)
- Redis (used across all services)
The backend consists of the following microservices:
- User Service: Manages user data and authentication.
- API Endpoint:
/api/users
- API Endpoint:
- Account Service: Manages bank accounts.
- API Endpoint:
/api/account
- API Endpoint:
- Transaction Service: Handles transactions between accounts.
- API Endpoint:
/api/transactions
- API Endpoint:
- Loan Service: Manages loan applications and information.
- API Endpoint:
/api/loans
- API Endpoint:
- Card Service: Manages credit and debit cards.
- API Endpoint:
/api/cards
- API Endpoint:
- Customer Support Service: Handles customer support tickets and inquiries.
- API Endpoint:
/api/customer-support
- Database: Uses Neo4j for storing customer support-related data.
- API Endpoint:
Each service is a separate Spring Boot application and utilizes Redis for caching and session management.
-
Clone the repository:
git clone https://github.com/7irelo/loretta-bank.git cd loretta-bank/server
-
Build the project:
mvn clean install
-
Run the services locally: Each service can be run independently. Navigate to each service directory and use:
mvn spring-boot:run
-
Build Docker images for each service:
docker build -t user-service:latest -f docker/Dockerfile.user .
-
Push images to a container registry:
docker tag user-service:latest your-dockerhub-repo/user-service:latest docker push your-dockerhub-repo/user-service:latest
-
Deploy to Kubernetes: Apply the Kubernetes configurations for each service:
kubectl apply -f kubernetes/deployment.user.yaml
The frontend is a React application that interacts with the backend services.
-
Navigate to the client directory:
cd ../client
-
Install dependencies:
npm install
-
Run the client locally:
npm start
The client application will be accessible at http://localhost:3000
.
The server configuration files are located in src/main/resources/application.properties
for each service. Key configurations include:
-
Database Connection:
spring.datasource.url=jdbc:postgresql://postgres-service:5432/lorettabank spring.datasource.username=postgres spring.datasource.password=your_password
-
Redis Configuration:
spring.redis.host=redis-service spring.redis.port=6379
-
Neo4j Configuration (for customer-support-service):
spring.data.neo4j.uri=bolt://neo4j-service:7687 spring.data.neo4j.username=neo4j spring.data.neo4j.password=your_password
The client configuration can be adjusted in the src/config.js
file to set API endpoints and other global settings.
To run tests for the server, execute the following command in the server root:
mvn test
To run tests for the client, use:
npm test
For production deployment, ensure the following:
- Docker Images: All services should be containerized and pushed to a Docker registry.
- Kubernetes Cluster: Services are deployed to a Kubernetes cluster using the provided YAML configurations.
- Environment Variables: Set appropriate environment variables for database connections, API keys, etc.
Contributions are welcome! Please fork the repository and create a pull request with your changes.
This project is licensed under the MIT License - see the LICENSE file for details.