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.

E-Commerce Microservices

🧭 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:

  1. Add authentication and authorization (OAuth2/JWT)
  2. Implement circuit breakers with Resilience4j
  3. Add API versioning strategies
  4. Create integration tests for service communication
  5. Implement caching with Redis
  6. Add monitoring with Prometheus and Grafana
  7. Implement saga pattern for distributed transactions

šŸ“– Documentation

Available guides:


šŸ¤ 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

Hello, How are you today?


Please share your details below

Start a Conversation

Expect delay in response

Hello, How are you today? !


Expect delay in response

powered by PandaC