Skip to content

Banking System (Kubernetes, Spring Boot, Neo4j, Postgres, Redis, Docker)

License

Notifications You must be signed in to change notification settings

7irelo/loretta-bank

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Loretta Bank

loretta_home

loretta_transfer

loretta_login

loretta_load

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.

Project Structure

The project is divided into two main parts:

  1. Server: A Spring Boot application consisting of multiple microservices.
  2. Client: A React application that interacts with the backend services.

Prerequisites

  • Java 22
  • Maven 3.8+
  • Docker
  • Kubernetes cluster
  • Node.js 16+
  • PostgreSQL 14+
  • Neo4j (for customer-support-service)
  • Redis (used across all services)

Getting Started

Server Setup

Microservices

The backend consists of the following microservices:

  • User Service: Manages user data and authentication.
    • API Endpoint: /api/users
  • Account Service: Manages bank accounts.
    • API Endpoint: /api/account
  • Transaction Service: Handles transactions between accounts.
    • API Endpoint: /api/transactions
  • Loan Service: Manages loan applications and information.
    • API Endpoint: /api/loans
  • Card Service: Manages credit and debit cards.
    • API Endpoint: /api/cards
  • Customer Support Service: Handles customer support tickets and inquiries.
    • API Endpoint: /api/customer-support
    • Database: Uses Neo4j for storing customer support-related data.

Each service is a separate Spring Boot application and utilizes Redis for caching and session management.

Building the Server

  1. Clone the repository:

    git clone https://github.com/7irelo/loretta-bank.git
    cd loretta-bank/server
  2. Build the project:

    mvn clean install
  3. Run the services locally: Each service can be run independently. Navigate to each service directory and use:

    mvn spring-boot:run

Docker and Kubernetes

  1. Build Docker images for each service:

    docker build -t user-service:latest -f docker/Dockerfile.user .
  2. 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
  3. Deploy to Kubernetes: Apply the Kubernetes configurations for each service:

    kubectl apply -f kubernetes/deployment.user.yaml

Client Setup

The frontend is a React application that interacts with the backend services.

  1. Navigate to the client directory:

    cd ../client
  2. Install dependencies:

    npm install
  3. Run the client locally:

    npm start

The client application will be accessible at http://localhost:3000.

Configuration

Server Configuration

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

Client Configuration

The client configuration can be adjusted in the src/config.js file to set API endpoints and other global settings.

Running Tests

Server Tests

To run tests for the server, execute the following command in the server root:

mvn test

Client Tests

To run tests for the client, use:

npm test

Deployment

For production deployment, ensure the following:

  1. Docker Images: All services should be containerized and pushed to a Docker registry.
  2. Kubernetes Cluster: Services are deployed to a Kubernetes cluster using the provided YAML configurations.
  3. Environment Variables: Set appropriate environment variables for database connections, API keys, etc.

Contributing

Contributions are welcome! Please fork the repository and create a pull request with your changes.

License

This project is licensed under the MIT License - see the LICENSE file for details.