Skip to content

Cloud-native microservices finance system built with Spring Boot and Spring Cloud. Features customer management, payments, messaging layer, and comprehensive monitoring with Prometheus and Grafana.

Notifications You must be signed in to change notification settings

bhanuchaddha/Finance-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Finance System - Cloud Native Microservices Architecture 🏦

A comprehensive, production-ready cloud-native finance system built with Spring Boot microservices architecture. Demonstrates modern distributed systems patterns including service discovery, messaging, configuration management, and observability.

πŸ“‹ Overview

Finance System is a complete banking simulation featuring:

  • Customer management
  • Account management
  • Payment processing
  • Messaging layer for inter-service communication
  • Cloud-native architecture patterns
  • Comprehensive monitoring and observability

Perfect for learning microservices, Spring Cloud, distributed systems, and cloud-native application development.

✨ Features

Core Functionalities

  • πŸ‘€ Customer Management - Register and manage customers
  • πŸ’³ Account Management - Open and manage bank accounts
  • πŸ’° Payment Processing - Send money between accounts
  • πŸ“¨ Event-Driven Architecture - Redis-based messaging
  • βš™οΈ Configuration Management - Centralized config server
  • πŸ“Š Monitoring - Prometheus and Grafana integration

Technical Features

  • πŸ—οΈ Microservices Architecture - Separate services for each domain
  • πŸ”„ Service Discovery - Eureka-based service registration
  • βš–οΈ Load Balancing - Distributed load handling
  • πŸ” Security - JWT authentication (planned)
  • πŸ“ˆ Observability - Metrics, logging, and tracing
  • 🐳 Docker Support - Containerized deployment
  • ☸️ Kubernetes Ready - Cloud-native deployment

πŸ› οΈ Technology Stack

  • Java - Core programming language
  • Spring Boot - Application framework
  • Spring Cloud - Microservices toolkit
  • Redis - Message broker and caching
  • Maven - Build and dependency management
  • MapStruct - Object mapping
  • Lombok - Boilerplate reduction
  • Prometheus - Metrics collection
  • Grafana - Visualization and dashboards
  • Docker - Containerization

πŸ—οΈ Architecture

Service Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Config Server  β”‚ (Port 8085)
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
    β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”
    β”‚         β”‚
β”Œβ”€β”€β”€β–Όβ”€β”€β”€β” β”Œβ”€β”€β–Όβ”€β”€β”€β”€β”
β”‚Config β”‚ β”‚Config β”‚
β””β”€β”€β”€β”¬β”€β”€β”€β”˜ β””β”€β”€β”€β”¬β”€β”€β”€β”˜
    β”‚         β”‚
β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”
β”‚ Messaging Layer β”‚ (Port 6379)
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
    β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚         β”‚             β”‚
β”Œβ”€β”€β”€β–Όβ”€β”€β”€β” β”Œβ”€β”€β–Όβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”
β”‚Accountβ”‚ β”‚Paymentβ”‚ β”‚ Customer β”‚
β”‚(8081) β”‚ β”‚(8082) β”‚ β”‚  (8083)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Services

  1. Config Server (Port 8085)

    • Centralized configuration management
    • Spring Cloud Config
  2. Messaging Layer (Port 6379)

    • Redis-based message broker
    • Event-driven communication
  3. Account Service (Port 8081)

    • Account management
    • Account operations
  4. Customer Service (Port 8083)

    • Customer registration
    • Customer management
  5. Payment Service (Port 8082)

    • Payment processing
    • Transaction management

πŸš€ Getting Started

Prerequisites

  • Java 8+
  • Maven 3.x
  • Docker (for containerized deployment)
  • Redis (for messaging layer)

Installation

  1. Clone the repository:
git clone https://github.com/bhanuchaddha/Finance-System.git
cd Finance-System
  1. Build all services:
mvn clean install

Running Services

Startup Sequence:

  1. Config Server
  2. Messaging Layer (Redis)
  3. Account Service
  4. Customer Service
  5. Payment Service

Using Maven:

# Terminal 1 - Config Server
cd config-server
mvn spring-boot:run

# Terminal 2 - Messaging Layer
cd messaging-layer
mvn spring-boot:run

# Terminal 3 - Account Service
cd accounts
mvn spring-boot:run

# Terminal 4 - Customer Service
cd customers
mvn spring-boot:run

# Terminal 5 - Payment Service
cd payments
mvn spring-boot:run

Docker Deployment

Build all Docker images:

mvn clean install -Ddocker-build

Run Docker containers:

docker run -p 8085:8085 config-server
docker run -p 6379:6379 messaging-layer
docker run -p 8081:8081 accounts
docker run -p 8083:8083 customers
docker run -p 8082:8082 payments

πŸ“‘ API Documentation

Complete API documentation available at: Postman API Documentation

Example Endpoints

Customer Service:

POST /customers        # Register customer
GET  /customers/{id}   # Get customer details

Account Service:

POST /accounts         # Open account
GET  /accounts/{id}    # Get account details

Payment Service:

POST /payments         # Process payment
GET  /payments/{id}    # Get payment details

πŸ“Š Monitoring & Observability

Prometheus & Grafana

The system includes comprehensive monitoring:

  • JVM Metrics - Memory, CPU, threads
  • Application Metrics - Request rates, response times
  • Custom Metrics - Business-specific metrics

Setup:

  1. Start Prometheus with prometheus.yml
  2. Access Grafana at http://localhost:3000
  3. Import dashboards from wiki/ directory

Monitoring Dashboard: Monitoring Dashboard

Detailed setup guide: Application Monitoring

πŸ—οΈ Project Structure

Finance-System/
β”œβ”€β”€ accounts/              # Account Service
β”œβ”€β”€ customers/            # Customer Service
β”œβ”€β”€ payments/             # Payment Service
β”œβ”€β”€ messaging-layer/      # Redis Messaging
β”œβ”€β”€ config-server/        # Configuration Server
β”œβ”€β”€ api-testing/          # API Tests (Rest Assured)
β”œβ”€β”€ wiki/                 # Documentation
└── pom.xml               # Parent POM

πŸ”§ Configuration

Spring Cloud Config

Centralized configuration in config-server:

  • Database connections
  • Service URLs
  • Feature flags
  • Environment-specific settings

Application Properties

Each service has its own application.properties:

server.port=8081
spring.application.name=account-service
# Add service-specific configurations

πŸ§ͺ Testing

API Testing with Rest Assured:

cd api-testing
mvn test

Tests include:

  • Payment processing tests
  • Traffic generation
  • Integration tests

πŸ“š Cloud-Native Features

  • βœ… Service Discovery - Eureka integration
  • βœ… Load Balancing - Spring Cloud LoadBalancer
  • βœ… Configuration Management - Spring Cloud Config
  • βœ… Health Checks - Spring Boot Actuator
  • βœ… Monitoring - Prometheus metrics
  • βœ… Distributed Tracing - Zipkin integration (planned)
  • βœ… Circuit Breaker - Resilience patterns (planned)
  • βœ… API Gateway - Edge service (planned)

πŸ›£οΈ Roadmap

Functional Roadmap

  • Customer Service
  • Account Service
  • Payment Service
  • Messaging Layer
  • Loan Service
  • Payment event caching and replay

Technical Roadmap

  • Rest input validations
  • Enhanced logging
  • Distributed tracing (Zipkin)
  • Docker Compose setup
  • Kubernetes deployment
  • Authentication & JWT
  • Cassandra integration
  • Circuit breaker (Hystrix)
  • Error handling framework
  • Flyway migrations

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is open source and available for educational purposes.

πŸ”— Resources

🌟 Use Cases

  • Learning Microservices - Complete microservices tutorial
  • Cloud-Native Development - Modern architecture patterns
  • Spring Cloud - Spring Cloud ecosystem reference
  • Distributed Systems - Event-driven architecture
  • Observability - Monitoring and metrics

Built with Spring Boot & Spring Cloud ❀️

About

Cloud-native microservices finance system built with Spring Boot and Spring Cloud. Features customer management, payments, messaging layer, and comprehensive monitoring with Prometheus and Grafana.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published