A Modern, Cloud-Native E-commerce Solution
Overview • Architecture • Features • Tech Stack • Getting Started
This is a robust, production-ready e-commerce platform built using microservices architecture. The platform demonstrates modern cloud-native application development practices, incorporating:
- Microservices Architecture: Independently deployable services
- Container Orchestration: Docker and Kubernetes ready
- Database Per Service: Independent data storage
- REST APIs: Modern API design principles
- Scalability: Horizontal scaling capabilities
- Resilience: Circuit breakers and fallback mechanisms
- Monitoring: Built-in health checks and metrics
┌─────────────────┐ ┌─────────────────┐
│ API Gateway │ │ Service Mesh │
│ (Future) │ │ (Future) │
└────────┬────────┘ └────────┬────────┘
│ │
│ │
┌────────┼───────────────────────┼────────┐
│ │ │ │
│ ┌───▼───┐ ┌────▼───┐ │
│ │Catalog│ │ Order │ │
│ │Service│─ ─ ─ ─ ─ ─ ─│Service│ │
│ └───┬───┘ └────┬───┘ │
│ │ │ │
│ ┌───▼───┐ ┌────▼───┐ │
│ │Catalog│ │ Order │ │
│ │ DB │ │ DB │ │
│ └───────┘ └────────┘ │
│ │
└────────────────────────────────────────┘
- Synchronous: REST APIs for direct service-to-service communication
- Asynchronous: Message queues for event-driven operations (planned)
- Service Discovery: Future implementation with Eureka/Consul
- Product Management
- CRUD operations for products
- Rich product metadata support
- Category management
- Price and inventory tracking
- Product search with filters
- Pagination and sorting
- Image handling support
- Order Processing
- Order creation and management
- Order status tracking
- Order history
- Multiple payment methods support (planned)
- Order validation
- Inventory checks
- Price calculation
- Tax computation (planned)
-
User Service
- Authentication and Authorization
- User profile management
- Address management
- Preferences storage
-
Payment Service
- Multiple payment gateway integration
- Payment processing
- Refund handling
- Payment status tracking
-
Notification Service
- Email notifications
- SMS alerts
- Push notifications
- Notification preferences
- Java 17: Latest LTS version with modern features
- Spring Boot: Rapid application development
- Spring Data JPA: Data persistence layer
- Spring Cloud: Microservices patterns implementation
- PostgreSQL: Robust, reliable database
- Docker: Containerization
- Maven: Dependency management and build tool
- Git: Version control
- JUnit 5: Testing framework
- Mockito: Mocking framework
- Swagger/OpenAPI: API documentation
- Lombok: Boilerplate code reduction
- Mapstruct: Object mapping
- Prometheus: Metrics collection
- Grafana: Metrics visualization
- ELK Stack: Log aggregation
- Jaeger: Distributed tracing
- Java 17+
- Docker & Docker Compose
- Maven 3.8+
- Git
- PostgreSQL (if running without Docker)
- Clone the Repository
git clone https://github.com/LohithVattikuti/E-commerece-Microservices.git
cd E-commerece-Microservices- Environment Setup
# Create necessary environment files
cp .env.example .env
# Configure your environment variables- Build Services
# Build all services
./mvnw clean package -DskipTests
# Or build individual services
cd catalog-service
./mvnw clean package
cd ../order-service
./mvnw clean package- Run with Docker Compose
docker-compose up --build- Run Without Docker
# Start Catalog Service
cd catalog-service
./mvnw spring-boot:run
# Start Order Service
cd order-service
./mvnw spring-boot:run- Products API
GET /api/products # List all products GET /api/products/{id} # Get product by ID POST /api/products # Create product PUT /api/products/{id} # Update product DELETE /api/products/{id} # Delete product GET /api/products/search# Search products
- Orders API
POST /api/orders # Create order GET /api/orders/{id} # Get order by ID GET /api/orders # List all orders PUT /api/orders/{id} # Update order status DELETE /api/orders/{id} # Cancel order
- Catalog Service: 1000 RPS with < 100ms latency
- Order Service: 500 RPS with < 200ms latency
- Horizontal scaling support
- Auto-scaling configurations included
- Load balancing ready
- JWT Authentication
- Role-Based Access Control
- API Key Authentication
- Rate Limiting
- Input Validation
- SQL Injection Prevention
- XSS Protection
- Clean Code principles
- SOLID design principles
- Twelve-Factor App methodology
- API-First design
- Test-Driven Development
- Continuous Integration/Deployment
- Code Quality Gates
- Comprehensive Documentation
- Service health endpoints
- Database connectivity checks
- External service dependency checks
- Request/Response times
- Error rates
- Resource usage
- Business metrics
- Structured JSON logging
- Correlation IDs
- Log levels configuration
- Centralized logging
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch
- Commit changes
- Create Pull Request
- Code Review
- Merge
This project is licensed under the MIT License - see the LICENSE file for details.
- Spring Boot team for the amazing framework
- Docker team for containerization
- PostgreSQL team for the reliable database
- All contributors and supporters
- Report bugs: Issue Tracker
- Get support: Discussions
- Contact maintainers: here
docker compose up --build
# catalog runs on :8081, order on :8082