E-Commerce Microservices
Educational e-commerce platform demonstrating microservices architecture with Spring Boot 3.x, Spring Cloud, service discovery, API gateway, event-driven communication, and Kubernetes deployment.

š§ Overview
An e-commerce platform demonstrating microservices architecture with Spring Boot. The system includes multiple independent services communicating through REST APIs and event streaming, with centralized configuration, service discovery, and API gateway patterns.
E-Commerce Microservices is an educational project built with Spring Boot 3.x and Spring Cloud. The architecture includes 5 business services (Customer, Product, Order, Payment, Notification), 3 infrastructure services (Config Server, Discovery, Gateway), and supporting components like PostgreSQL, MongoDB, Kafka, and Zipkin.
Topics covered:
- šļø Microservices Architecture ā Independent services with defined boundaries
- š Service Discovery ā Eureka server for dynamic service registration
- š API Gateway ā Centralized routing and load balancing
- āļø Centralized Config ā Spring Cloud Config Server
- š” Event-Driven ā Kafka for asynchronous communication
- š³ Deployment ā Docker Compose and Kubernetes options
š Key Features
- Service Discovery ā Eureka for automatic service registration and discovery
- API Gateway ā Single entry point with routing and load balancing
- Config Server ā Centralized configuration management
- Event Streaming ā Kafka for order and payment events
- Distributed Tracing ā Zipkin for request tracking across services
- Multiple Databases ā PostgreSQL for transactional data, MongoDB for notifications
- Container Orchestration ā Docker Compose and Kubernetes deployment
- Monitoring Tools ā PgAdmin, Mongo Express, MailDev for development
āļø How It Works
# Start everything
docker-compose -f docker-compose.infra.yml -f docker-compose.services.yml up -d
Access API Gateway at http://localhost:8080, Eureka at http://localhost:8761
š¦ Services Breakdown
Infrastructure Services
- Config Server (8888) ā Centralized configuration management with Spring Cloud Config
- Discovery Service (8761) ā Eureka server for service registry
- Gateway Service (8080) ā API Gateway for routing and load balancing
Business Services
- Customer Service (8090) ā Customer management and profiles
- Product Service (8050) ā Product catalog and inventory, includes Flyway migrations
- Order Service (8070) ā Order processing and management
- Payment Service (8060) ā Payment processing and transactions
- Notification Service (8040) ā Email notifications for orders and payments
Supporting Infrastructure
- PostgreSQL ā Transactional data storage
- MongoDB ā Notifications and customer data
- Apache Kafka ā Event streaming between services
- Zipkin ā Distributed tracing and monitoring
- MailDev ā Email testing in development
š¬ Quick Start
git clone https://github.com/pandaind/springboot-microservices.git
cd springboot-microservices/deployment
docker-compose -f docker-compose.infra.yml -f docker-compose.services.yml up -d
Access API Gateway at http://localhost:8080 and Eureka Dashboard at http://localhost:8761
Topics Covered
- š ļø Microservices Patterns ā Service decomposition, API Gateway, Service Discovery
- š Spring Cloud ā Config Server, Eureka, Gateway routing
- š Inter-Service Communication ā REST APIs and Kafka messaging
- š Data Management ā PostgreSQL with JPA, MongoDB integration
- š” DevOps ā Docker multi-container setup, Kubernetes deployment
- š Observability ā Distributed tracing with Zipkin, service monitoring
š§ Potential Extensions
Areas for experimentation:
- Add authentication and authorization (OAuth2/JWT)
- Implement circuit breakers with Resilience4j
- Add API versioning strategies
- Create integration tests for service communication
- Implement caching with Redis
- Add monitoring with Prometheus and Grafana
- Implement saga pattern for distributed transactions
š Documentation
Available guides:
- Kubernetes Deployment Guide ā Local K8s setup
- API Testing Guide ā Postman usage
- Enhancement Roadmap ā Future improvements
š¤ Contributing
This is a learning project. You can:
- Study the microservices communication patterns
- Fork and experiment with new services
- Add documentation or architecture diagrams
- Submit improvements via pull requests