Skip to content

eric-muganga/ecommerce-microservices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E-Commerce Platform with Microservices

Spring Boot Microservices Design Patterns Docker Kubernetes License

An E-Commerce Platform built using Spring Boot and a Microservices Architecture. This project adheres to industry-standard design patterns and demonstrates modern software development practices, including distributed systems, containerization, and cloud-native technologies.


Features

  • User Authentication: Secure authentication using JWT and OAuth2.
  • Product Catalog: CRUD operations for products with search and filtering.
  • Shopping Cart: Add/remove products and save cart for logged-in users.
  • Order Management: Place orders, track order status, and view order history.
  • Payment Integration: Seamless payment processing using Stripe/PayPal.
  • Inventory Management: Track product stock levels and notify sellers.
  • Recommendation Engine: Suggest products based on user behavior.
  • Notifications: Email and SMS notifications for order updates.
  • Analytics: Generate reports for sales, revenue, and customer behavior.

Microservices Architecture

The application is divided into the following microservices:

  1. User Service: Handles user registration, authentication, and profile management.
  2. Product Service: Manages product catalog, categories, and inventory.
  3. Cart Service: Manages shopping cart functionality. (Repo not linked yet)
  4. Order Service: Handles order creation, payment processing, and order tracking.
  5. Payment Service: Integrates with third-party payment gateways.
  6. Notification Service: Sends emails, SMS, or push notifications.
  7. Recommendation Service: Provides product recommendations. (Repo not linked yet)
  8. API Gateway: Acts as a single entry point for all client requests.
  9. Service Discovery (Eureka Server): Uses Netflix Eureka for service registration and discovery.
  10. Inventory Service: Tracks product stock levels and notifies sellers.
  11. Config Server: Centralized configuration management using Spring Cloud Config. (Repo not linked yet)

Industry Design Patterns

This project implements the following industry-standard design patterns:

1. Layered Architecture

  • Controller Layer: Handles HTTP requests and responses.
  • Service Layer: Contains business logic and interacts with repositories.
  • Repository Layer: Manages data access and database interactions.

2. Microservices Architecture

  • Single Responsibility Principle (SRP): Each microservice is responsible for a single business capability.
  • Decentralized Data Management: Each service has its own database, ensuring loose coupling.

3. API Gateway Pattern

  • The API Gateway acts as a single entry point for all client requests, routing them to the appropriate microservices.

4. Service Discovery

  • Netflix Eureka is used for service registration and discovery, enabling dynamic scaling and load balancing.

5. Circuit Breaker Pattern

  • Resilience4j is used to handle failures gracefully and prevent cascading failures in distributed systems.

6. Saga Pattern

  • The Saga Pattern is used to manage distributed transactions (e.g., order creation involving multiple services).

7. CQRS (Command Query Responsibility Segregation)

  • Separates read and write operations for better scalability and performance.

8. Event Sourcing

  • Stores the state of a business entity as a sequence of events, enabling auditability and replayability.

Technologies Used

  • Spring Boot: For building microservices.
  • Spring Cloud: For service discovery, API Gateway, and distributed configuration.
  • Spring Security: For authentication and authorization.
  • Spring Data JPA: For database interactions.
  • Docker: For containerization.
  • Kubernetes: For orchestration and scaling.
  • Kafka: For asynchronous communication between services.
  • Redis: For caching.
  • Elasticsearch: For advanced search functionality.
  • MySQL: For relational data storage.
  • MongoDB: For NoSQL data storage.
  • Swagger: For API documentation.
  • Prometheus: For monitoring and visualization.

Getting Started

Prerequisites

  • Java 17 or higher
  • Docker and Docker Compose
  • Kubernetes (optional)
  • Maven

Installation

  1. Clone the Repository:
    git clone https://github.com/eric-muganga/springboot-microservices-ecommerce-api.git
    cd springboot-microservices-ecommerce-api

About

An E-Commerce Platform built using Spring Boot and a Microservices Architecture. This project adheres to industry-standard design patterns and demonstrates modern software development practices, including distributed systems, containerization, and cloud-native technologies.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages