A comprehensive, production-ready e-commerce platform built using microservices architecture with Spring Boot, Spring Cloud, and modern technologies.
This platform implements a complete microservices-based e-commerce solution with the following core components:
- Discovery Service (Eureka Server) - Service registry and discovery
- Config Service (Spring Cloud Config) - Centralized configuration management
- API Gateway (Spring Cloud Gateway) - Request routing and filtering
- User Service - User management and authentication
- Product Catalog Service - Product management with caching and search
- Order Service - Order processing and management
- Payment Service - Payment processing with Razorpay integration
- Notification Service - Multi-channel notifications
- Email Service - Event-driven email processing
- Search Service - Advanced product search with Elasticsearch
| Component | Technology |
|---|---|
| Framework | Spring Boot 3.2.0, Spring Cloud 2023.0.0 |
| Database | MySQL 8.0 |
| Caching | Redis 7.0 |
| Message Broker | Apache Kafka |
| Search Engine | Elasticsearch 8.11.0 |
| Payment Gateway | Razorpay |
| Service Discovery | Netflix Eureka |
| API Gateway | Spring Cloud Gateway |
| Configuration | Spring Cloud Config |
| Monitoring | Prometheus, Grafana |
| Containerization | Docker, Docker Compose |
- Java 17+
- Maven 3.8+
- Docker & Docker Compose
- Node.js (for frontend, if needed)
git clone https://github.com/your-repo/ecommerce-microservices-platform.git
cd ecommerce-microservices-platformcd docker-compose
docker-compose up -dThis will start:
- MySQL (Port: 3306)
- Redis (Port: 6379)
- Kafka & Zookeeper (Ports: 9092, 2181)
- Elasticsearch (Port: 9200)
- Kibana (Port: 5601)
- RabbitMQ (Ports: 5672, 15672)
- Prometheus (Port: 9090)
- Grafana (Port: 3000)
# Build all services
mvn clean install
# Start services in order
cd discovery-service && mvn spring-boot:run &
cd config-service && mvn spring-boot:run &
cd api-gateway && mvn spring-boot:run &
cd user-service && mvn spring-boot:run &
cd product-catalog-service && mvn spring-boot:run &
cd order-service && mvn spring-boot:run &
cd payment-service && mvn spring-boot:run &
cd notification-service && mvn spring-boot:run &
cd email-service && mvn spring-boot:run &
cd search-service && mvn spring-boot:run &| Service | Port | URL |
|---|---|---|
| Discovery Service | 8761 | http://localhost:8761 |
| Config Service | 8888 | http://localhost:8888 |
| API Gateway | 8080 | http://localhost:8080 |
| User Service | 8081 | http://localhost:8081 |
| Product Catalog | 8082 | http://localhost:8082 |
| Order Service | 8083 | http://localhost:8083 |
| Payment Service | 8084 | http://localhost:8084 |
| Notification Service | 8085 | http://localhost:8085 |
| Email Service | 8086 | http://localhost:8086 |
| Search Service | 8087 | http://localhost:8087 |
- β User Registration & Authentication
- β Product Catalog Management
- β Advanced Product Search & Filtering
- β Shopping Cart & Checkout
- β Order Management
- β Payment Processing (Razorpay)
- β Email Notifications
- β Real-time Notifications
- β Microservices Architecture
- β Service Discovery & Load Balancing
- β Centralized Configuration
- β API Gateway with Rate Limiting
- β Circuit Breaker Pattern
- β Event-Driven Architecture (Kafka)
- β Redis Caching
- β Elasticsearch Integration
- β Monitoring & Observability
- β Containerized Deployment
Create .env files for each service or set the following environment variables:
# Database Configuration
DB_HOST=localhost
DB_PORT=3306
DB_USERNAME=root
DB_PASSWORD=password
# Redis Configuration
REDIS_HOST=localhost
REDIS_PORT=6379
# Kafka Configuration
KAFKA_BOOTSTRAP_SERVERS=localhost:9092
# Elasticsearch Configuration
ES_HOST=localhost
ES_PORT=9200
# Razorpay Configuration
RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_key_secret
# Email Configuration
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your_email@gmail.com
MAIL_PASSWORD=your_app_password# Register User
POST /api/users/register
{
"username": "john_doe",
"email": "john@example.com",
"password": "password123",
"firstName": "John",
"lastName": "Doe"
}
# Get User by ID
GET /api/users/{id}
# Search Users
GET /api/users/search?keyword=john# Create Product
POST /api/products
{
"name": "iPhone 15",
"description": "Latest iPhone model",
"price": 79999.00,
"stockQuantity": 100,
"category": "Electronics",
"brand": "Apple"
}
# Get Products by Category
GET /api/products/category/{category}
# Search Products
GET /api/products/search?q=iphone&category=Electronics&minPrice=50000&maxPrice=100000# Create Order
POST /api/orders
{
"userId": 1,
"items": [
{
"productId": 1,
"quantity": 2,
"price": 79999.00
}
]
}
# Get Orders by User
GET /api/orders/user/{userId}# Create Payment
POST /api/payments/create
{
"orderId": 1,
"amount": 159998.00,
"currency": "INR"
}
# Verify Payment
POST /api/payments/verify
{
"razorpayOrderId": "order_xxx",
"razorpayPaymentId": "pay_xxx",
"razorpaySignature": "signature_xxx"
}The platform provides powerful search capabilities through Elasticsearch:
- Full-text search across product name, description, and tags
- Category filtering with hierarchical support
- Price range filtering with min/max bounds
- Brand filtering with multiple brand selection
- Sorting by price, rating, popularity, newest
- Faceted search with aggregations
- Auto-complete suggestions
- Search result highlighting
# Basic text search
GET /api/search/products?q=smartphone
# Advanced filtering
GET /api/search/products?q=smartphone&category=Electronics&brand=Samsung&minPrice=20000&maxPrice=50000&sortBy=price&sortOrder=asc
# Search with facets
GET /api/search/products/facets?q=laptopEvent-driven email service that automatically sends emails for:
- User registration confirmation
- Order confirmation
- Payment success/failure
- Order status updates
- Password reset
- Newsletter subscriptions
- Welcome emails
- Order confirmations
- Payment receipts
- Shipping notifications
- Marketing campaigns
Real-time notification system supporting:
- WebSocket notifications
- Push notifications
- SMS notifications (configurable)
- In-app notifications
- JWT-based authentication
- Role-based access control (RBAC)
- API rate limiting
- CORS configuration
- Input validation & sanitization
- HTTPS enforcement
- CSRF protection
- XSS protection
- Security headers implementation
All services expose health endpoints:
GET /actuator/health
GET /actuator/info
GET /actuator/metrics- Prometheus - Metrics collection
- Grafana - Dashboards and visualization
- Kafka UI - Kafka cluster monitoring
- Spring Boot Actuator - Application metrics
- Request/response times
- Throughput (requests per second)
- Error rates
- Database connection pools
- Cache hit/miss ratios
- Queue depths
- Memory and CPU usage
# Build all services
mvn clean package
# Build Docker images
docker-compose -f docker-compose.services.yml build
# Deploy entire stack
docker-compose -f docker-compose.yml -f docker-compose.services.yml up -dKubernetes manifests are available in the k8s/ directory:
kubectl apply -f k8s/mvn testmvn verifyUse tools like JMeter or Gatling to test performance:
- Target: 1000+ concurrent users
- Response time: < 500ms for 95th percentile
- Throughput: 10,000+ requests per minute
- Create new Maven module
- Add service dependencies
- Implement business logic
- Register with Eureka
- Add to API Gateway routes
- Update Docker Compose
- Checkstyle for code formatting
- SpotBugs for static analysis
- JaCoCo for test coverage
- SonarQube integration
- Fork the repository
- Create a feature branch
- Implement your changes
- Add tests
- Update documentation
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue on GitHub
- Email: support@ecommerce-platform.com
- Documentation: Wiki
- β Core microservices implementation
- β Basic e-commerce features
- β Payment integration
- β Search functionality
- π Machine learning recommendations
- π Advanced analytics
- π Mobile app support
- π Multi-vendor marketplace
- π AI-powered chatbot
- π Blockchain integration
- π IoT device support
- π Global deployment
Built with β€οΈ using Spring Boot and Modern Microservices Architecture