Skip to content

SahilAnower/EcomEase

Repository files navigation

EcomEase - Backend Microservices Application

EcomEase is a scalable backend microservices architecture designed for an e-commerce platform. This project demonstrates the use of modern technologies to build a distributed system using microservices. The system incorporates services for managing products, orders, carts, and more, while leveraging Spring Boot, Spring Cloud, RabbitMQ, Feign Clients, and other cutting-edge technologies.

Features

  • Product Service: Manage products, categories, availability, and pricing.
  • Cart Service: Handle cart creation, management, and total price calculation.
  • Order Service: Place and manage orders with automatic inventory updates (bonus: coupons).
  • Config Server: Centralized configuration management using Spring Cloud Config.
  • Gateway Server: API Gateway for routing and load balancing using Spring Cloud Gateway.
  • Eureka Server: Service discovery and registry using Netflix Eureka.
  • Message Brokers: Integration with RabbitMQ for asynchronous communication for inventory updates.
  • Feign Clients: Inter-service communication using declarative REST clients.
  • Database Management: SQL scripts for schema creation and seamless database integration.

Architecture

The system is built with a modular architecture:

  1. Microservices:

    • Product Service: Manages product inventory and pricing.
    • Cart Service: Handles cart operations and integrates with Product Service to calculate total price.
    • Order Service: Processes orders and updates product inventory.
  2. Infrastructure:

    • Gateway Server: Acts as the single entry point for all client requests.
    • Eureka Server: Enables dynamic discovery of microservices.
    • Config Server: Provides centralized configuration management for all services.
  3. Communication:

    • Synchronous communication using Feign Clients.
    • Asynchronous communication using RabbitMQ.
  4. Database:

    • Each microservice has its own database.
    • Schema defined using SQL scripts for data consistency.

Technologies Used

  • Spring Boot
  • Spring Cloud Gateway
  • Spring Cloud Eureka
  • Spring Cloud Config
  • Feign Clients
  • RabbitMQ
  • Hibernate / JPA
  • H2 in-memory DB
  • Docker

Prerequisites

  • Java 17
  • Maven
  • Docker
  • RabbitMQ
  • H2/SQL

Getting Started

1. Clone the Repository

git clone https://github.com/SahilAnower/EcomEase.git
cd EcomEase

2. Build the Project

mvn clean install

3. Start Services

Ensure you have Docker installed and running, then start the required dependencies (e.g., RabbitMQ) using Docker Compose.

docker-compose up

For running rabbitmq in local: docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:4.0-management. This runs the rabbitmq server on port 5672, and the management server on port 15672.

4. Run Individual Services

Navigate to each service folder and run the following:

mvn spring-boot:run

5. Access the Application

Configuration

Configuration is managed using Spring Cloud Config. The configuration files are stored in https://github.com/SahilAnower/EcomEase-config github project.

Example Configurations

  • Product Service: products.yml/products-prod.yml/products-qa.yml

Database

Each microservice has its own database schema defined in the respective src/main/resources/schema.sql file.

Future Enhancements

  • Scaling: Enhance auto-scaling using Kubernetes.
  • Monitoring: Add centralized logging and monitoring with ELK stack or Prometheus/Grafana.

Contributing

Contributions are welcome! Please fork the repository and create a pull request with detailed information about your changes.

License

This project is licensed under the MIT License. See the LICENSE file for details.


For any questions or support, please open an issue in the repository or contact Sahil Anower.

About

Highlighting the ease of e-commerce.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages