A production-ready microservices application demonstrating modern backend architecture patterns with Java 17, Spring Boot 3, Docker, and Kubernetes.
+------------------+
| Config Server |
| (Port 8888) |
+--------+---------+
|
+----------+ +---------------+ +-------v--------+ +------------------+
| Client +--->+ API Gateway +--->+ Service +--->+ Order Service |
| | | (Port 8080) | | Discovery | | (Port 8081) |
+----------+ +-------+-------+ | (Eureka 8761) | +--------+---------+
| +-------+---------+ |
| | +--------v---------+
| +------------->+ Inventory Service|
| | | (Port 8082) |
| | +------------------+
| |
| +------------->+ Notification Svc |
| | (Port 8083) |
| +------------------+
|
+---> PostgreSQL | MongoDB | Redis | Kafka
| Service | Description | Port | Tech |
|---|---|---|---|
| API Gateway | Routes requests, rate limiting, authentication | 8080 | Spring Cloud Gateway |
| Service Discovery | Service registration and discovery | 8761 | Netflix Eureka |
| Config Server | Centralized configuration management | 8888 | Spring Cloud Config |
| Order Service | Order creation, processing, and management | 8081 | Spring Boot, PostgreSQL, Kafka |
| Inventory Service | Stock management, availability checks | 8082 | Spring Boot, MySQL, Redis |
| Notification Service | Event-driven notifications (email, SMS) | 8083 | Spring Boot, Kafka |
- Microservices Architecture - Loosely coupled services with clear domain boundaries
- API Gateway - Centralized routing, rate limiting, JWT authentication
- Service Discovery - Dynamic service registration with Netflix Eureka
- Centralized Configuration - Spring Cloud Config Server with Git-backed configs
- Event-Driven Communication - Kafka for asynchronous inter-service messaging
- Circuit Breaker - Resilience4j for fault tolerance and fallback mechanisms
- Distributed Tracing - Zipkin and Micrometer for request tracing across services
- Database per Service - PostgreSQL, MySQL, MongoDB for polyglot persistence
- Caching - Redis for inventory lookups and session management
- Containerized - Docker Compose for local development, Kubernetes for production
- CI/CD - GitHub Actions with automated testing, scanning, and deployment
- Testing - JUnit 5, Mockito, Testcontainers for integration tests
- Language: Java 17
- Framework: Spring Boot 3.2, Spring Cloud 2023.x
- Databases: PostgreSQL, MySQL, MongoDB, Redis
- Messaging: Apache Kafka
- Testing: JUnit 5, Mockito, Testcontainers
- Build: Maven
- Containerization: Docker, Docker Compose
- Orchestration: Kubernetes, Helm Charts
- CI/CD: GitHub Actions
- Monitoring: Prometheus, Grafana, Zipkin
- Java 17+
- Maven 3.8+
- Docker & Docker Compose
# Clone the repository
git clone https://github.com/Chandu0501/spring-boot-microservices.git
cd spring-boot-microservices
# Start all services
docker-compose up -d
# Verify services are running
curl http://localhost:8761 # Eureka Dashboard
curl http://localhost:8080/api/orders # API Gateway -> Order Service# Start Config Server first
cd config-server && mvn spring-boot:run
# Start Service Discovery
cd service-discovery && mvn spring-boot:run
# Start business services
cd order-service && mvn spring-boot:run
cd inventory-service && mvn spring-boot:run# Run all tests
mvn clean test
# Run with coverage report
mvn clean verify jacoco:report| Method | Endpoint | Description |
|---|---|---|
| POST | /api/orders |
Create a new order |
| GET | /api/orders/{id} |
Get order by ID |
| GET | /api/orders |
List all orders (paginated) |
| PUT | /api/orders/{id}/status |
Update order status |
| DELETE | /api/orders/{id} |
Cancel an order |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/inventory/{sku} |
Check stock availability |
| PUT | /api/inventory/{sku} |
Update stock quantity |
| POST | /api/inventory |
Add new inventory item |
| GET | /api/inventory/low-stock |
Get low stock alerts |
# Apply Kubernetes manifests
kubectl apply -f k8s/namespace.yaml
kubectl apply -f k8s/configmaps/
kubectl apply -f k8s/deployments/
kubectl apply -f k8s/services/spring-boot-microservices/
├── api-gateway/ # API Gateway (Spring Cloud Gateway)
├── service-discovery/ # Eureka Server
├── config-server/ # Spring Cloud Config
├── order-service/ # Order management microservice
├── inventory-service/ # Inventory management microservice
├── notification-service/ # Event-driven notification service
├── docker-compose.yml # Local development environment
├── k8s/ # Kubernetes deployment manifests
└── .github/workflows/ # CI/CD pipeline definitions
Access monitoring tools after deployment:
- Eureka Dashboard: http://localhost:8761
- Grafana: http://localhost:3000
- Prometheus: http://localhost:9090
- Zipkin: http://localhost:9411
Sai Chandu Vallaboju
- GitHub: @Chandu0501
- LinkedIn: Sai Chandu Vallaboju
This project is licensed under the MIT License - see the LICENSE file for details.