A comprehensive microservices ecosystem implementing ALL major Spring Cloud patterns and technologies for hands-on learning and interview preparation.
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Client Apps │ │ Load Balancer │ │ API Gateway │
│ │────│ │────│ (Port: 8080) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
┌────────────────────────────────┼────────────────────────────────┐
│ │ │
┌─────────▼─────────┐ ┌─────────▼─────────┐ ┌─────────▼─────────┐
│ User Service │ │ Order Service │ │Notification Service│
│ (Port: 8081) │ │ (Port: 8082) │ │ (Port: 8083) │
└───────────────────┘ └───────────────────┘ └───────────────────┘
│ │ │
└────────────────────────────────┼────────────────────────────────┘
│
┌─────────────────────────────────────────┼─────────────────────────────────────────┐
│ │ │
┌─────────▼─────────┐ ┌─────────▼─────────┐ ┌─────────▼─────────┐
│ Eureka Server │ │ Admin Dashboard │ │ Zipkin Server │
│ (Port: 8761) │ │ (Port: 8090) │ │ (Port: 9411) │
└───────────────────┘ └───────────────────┘ └───────────────────┘
- ✅ Service Discovery - Eureka Server & Client
- ✅ API Gateway - Spring Cloud Gateway with custom filters
- ✅ Load Balancing - Client-side with Ribbon/LoadBalancer
- ✅ Circuit Breaker - Resilience4j for fault tolerance
- ✅ Distributed Tracing - Zipkin & Sleuth
- ✅ Service Monitoring - Spring Boot Admin
- ✅ Synchronous - REST APIs with OpenFeign
- ✅ Asynchronous - RabbitMQ message queues
- ✅ Event-Driven - Domain events and event sourcing
- ✅ Request-Response - HTTP-based communication
- ✅ Publish-Subscribe - Event broadcasting
- ✅ Database per Service - H2, PostgreSQL, MongoDB
- ✅ Distributed Transactions - Saga pattern
- ✅ Event Sourcing - Event store implementation
- ✅ CQRS - Command Query Responsibility Segregation
- ✅ Data Consistency - Eventually consistent patterns
- ✅ OAuth2 & JWT - Centralized authentication
- ✅ API Security - Gateway-level security
- ✅ Service-to-Service - Internal API security
- ✅ Rate Limiting - Per-service and global limits
- ✅ Distributed Logging - Centralized log aggregation
- ✅ Metrics Collection - Micrometer & Prometheus
- ✅ Health Checks - Service health monitoring
- ✅ Performance Monitoring - APM integration
- ✅ Containerization - Docker & Docker Compose
- ✅ Service Mesh - Istio integration ready
- ✅ Auto-scaling - Kubernetes deployment configs
- ✅ Blue-Green Deployment - Zero-downtime deployments
| Service | Port | Database | Purpose |
|---|---|---|---|
| Eureka Server | 8761 | - | Service registry and discovery |
| API Gateway | 8080 | Redis | Entry point, routing, filters, security |
| User Service | 8081 | PostgreSQL | User management, authentication |
| Order Service | 8082 | H2 | Order processing, inventory |
| Notification Service | 8083 | MongoDB | Email, SMS, push notifications |
| Admin Dashboard | 8090 | - | Service monitoring and management |
| Zipkin Server | 9411 | - | Distributed tracing |
- User registration and authentication
- Profile management
- JWT token generation
- Password encryption
- User preferences
- Order creation and management
- Inventory tracking
- Payment processing simulation
- Order status updates
- Integration with User Service
- Email notifications
- SMS alerts
- Push notifications
- Event-driven messaging
- Template management
- Spring Boot 2.7.x - Microservice foundation
- Spring Cloud 2021.0.x - Cloud-native patterns
- Java 11+ - Programming language
- Eureka - Service registry and discovery
- Spring Cloud Gateway - API gateway
- OpenFeign - Declarative REST client
- Ribbon/LoadBalancer - Client-side load balancing
- Resilience4j - Circuit breaker, retry, rate limiter
- Zipkin & Sleuth - Distributed tracing
- Micrometer - Metrics collection
- Spring Boot Admin - Service monitoring
- RabbitMQ - Message broker
- Spring Cloud Stream - Event-driven microservices
- Apache Kafka - Event streaming (optional)
- PostgreSQL - User service database
- H2 - Order service (in-memory)
- MongoDB - Notification service
- Redis - Caching layer
- Spring Security - Authentication & authorization
- OAuth2 & JWT - Token-based security
- API Key authentication - Service-to-service
- Docker - Containerization
- Docker Compose - Local orchestration
- Kubernetes - Production deployment
- Prometheus & Grafana - Monitoring stack
- Java 11+
- Maven 3.6+
- Docker & Docker Compose
- PostgreSQL (optional - can use Docker)
- RabbitMQ (optional - can use Docker)
# Start databases and message broker
docker-compose up -d postgres rabbitmq redis
# Or start all infrastructure
docker-compose up -d# 1. Service Discovery
cd eureka-server && mvn spring-boot:run
# 2. API Gateway
cd api-gateway && mvn spring-boot:run
# 3. Business Services
cd user-service && mvn spring-boot:run
cd order-service && mvn spring-boot:run
cd notification-service && mvn spring-boot:run
# 4. Monitoring Services
cd admin-dashboard && mvn spring-boot:run
cd zipkin-server && mvn spring-boot:run- Eureka Dashboard: http://localhost:8761
- API Gateway: http://localhost:8080
- Admin Dashboard: http://localhost:8090
- Zipkin Tracing: http://localhost:9411
- RabbitMQ Management: http://localhost:15672 (admin/admin123)
- Grafana: http://localhost:3000 (admin/admin123)
- Prometheus: http://localhost:9090
- Service Discovery - How services find each other
- API Gateway - Single entry point pattern
- Configuration Management - Externalized config
- Load Balancing - Distributing requests
- Circuit Breaker - Fault tolerance patterns
- Distributed Tracing - Request flow tracking
- Event-Driven Architecture - Async communication
- Database per Service - Data isolation
- Saga Pattern - Distributed transactions
- CQRS & Event Sourcing - Advanced data patterns
- Service Mesh - Infrastructure layer
- Observability - Monitoring and alerting
- How do microservices communicate?
- What is service discovery and why is it needed?
- How do you handle distributed transactions?
- What are the challenges of microservices?
- How do you monitor distributed systems?
- What is the difference between orchestration and choreography?
- How do you handle data consistency?
- What are the security considerations?
- Service failure handling
- Database migration strategies
- Scaling individual services
- Debugging distributed systems
- Performance optimization
- Security implementation
docs/
├── architecture/ # System design and patterns
├── api/ # API documentation
├── deployment/ # Deployment guides
├── monitoring/ # Observability setup
├── security/ # Security implementation
├── troubleshooting/ # Common issues and solutions
└── interview-prep/ # Interview questions and answers
- IntelliJ IDEA / VS Code configurations
- Code formatting and style guides
- Debugging configurations
- Testing setups
- Unit tests for individual services
- Integration tests for service communication
- Contract testing with Pact
- End-to-end testing scenarios
- Performance testing with JMeter
- GitHub Actions workflows
- Automated testing
- Docker image building
- Kubernetes deployment
- Monitoring and alerting setup
By working with this project, you'll gain hands-on experience with:
- Microservices Architecture - Design patterns and best practices
- Spring Cloud Ecosystem - All major components and integrations
- Distributed Systems - Challenges and solutions
- DevOps Practices - Containerization, orchestration, monitoring
- System Design - Scalability, reliability, performance
- Interview Skills - Real-world scenarios and problem-solving
This project serves as a complete reference implementation for microservices architecture, covering everything from basic service communication to advanced patterns like CQRS and event sourcing.
Perfect for developers preparing for microservices interviews or wanting to understand distributed systems architecture in practice! 🚀
Complete Microservices Implementation:
- ✅ Service discovery and registration (Eureka)
- ✅ API Gateway with routing and security
- ✅ Database per service pattern
- ✅ Event-driven architecture (RabbitMQ)
- ✅ Distributed tracing (Zipkin)
- ✅ Service monitoring (Admin Dashboard)
- ✅ Containerization (Docker)
- ✅ Comprehensive documentation
- ✅ Complete API testing suite
- ✅ Production deployment guides
Quick Start:
# Docker (Recommended)
.\start-docker.bat
# Local Development
.\start-services.bat
# Health Check
.\check-services.batAccess Points:
- API Gateway: http://localhost:8080
- Eureka Dashboard: http://localhost:8761
- Admin Dashboard: http://localhost:8090
- RabbitMQ Management: http://localhost:15672 (admin/admin123)
- Grafana: http://localhost:3000 (admin/admin123)
- Zipkin Tracing: http://localhost:9411
- Prometheus: http://localhost:9090
- Project Summary - Complete project overview
- Microservices Concepts - Core concepts and patterns
- Interview Guide - Interview preparation
- API Testing Guide - Complete testing suite
- Architecture Guide - Detailed system design
- Request Lifecycle - Request flow analysis
- Deployment Guide - Production deployment
- Service Status - Health monitoring
- Troubleshooting - Issue resolution