This repository contains the backend implementation for a scalable ecommerce application. The architecture is designed using microservices to ensure modularity, scalability, and maintainability.
- Features
- Tech Stack
- Microservices Overview
- Architecture
- Prerequisites
- Installation
- Usage
- Environment Variables
- Contributing
- License
- Contact
- Microservices Architecture: Decoupled services for user management, product handling, orders, shopping cart, notifications, and a gateway for API routing.
- Scalability: Each service can be scaled independently to handle increased load.
- Dockerized Services: Containerized using Docker for consistent environments and easy deployment.
- API Gateway: Centralized entry point for managing and routing requests to appropriate services.
- Java: Java runtime for building scalable network applications.
- Docker: Containerization platform for packaging applications.
- MongoDB: NoSQL database for data storage.
- PostgreSQL: Sql database for data storage.
- Redis: For caching.
- ELK: For service log monitoring.
- Kafka: For messaging queue.
- JWT: JSON Web Tokens for authentication.
- JavaMailSender: Module for sending emails.
- Websockets: For Chat management between users and sellers.
- User Service: Manages user registration, authentication, and profile management.
- Product Service: Handles product listings, categories, and inventory management.
- Order Service: Manages order creation, status updates, and order history.
- Shopping Cart Service: Manages users' shopping carts, including adding/removing items.
- Notification Service: Sends email and SMS notifications to users.
- ChatService: Manages conversation between customers and sellers.
- Delivery service: Manages delivery with real-time tracking using GPS.
In addition to the core microservices, the following components were included to enhance the scalability, reliability, and manageability of the e-commerce platform:
- API Gateway: Serves as the entry point for all client requests, routing them to the appropriate microservice. Used Spring Cloud Gateway for this purpose.
- Service Discovery: Automatically detects and manages service instances. I used Eureka for this purpose.
- Centralized Logging: Aggregates logs from all microservices for easy monitoring and debugging. Used the ELK stack (Elasticsearch, Logstash, Kibana) for this purpose.
- Docker & Docker Compose: Containerize each microservice and manage their orchestration, networking, and scaling. Docker Compose can be used to define and manage multi-container applications.
- CI/CD Pipeline: Automates the build, test, and deployment process of each microservice. Used GitHub Actions for this purpose.
- Caching: Caching data for the most made request to minimise database queries and improve efficiency. Redis is used for this purpose.
The application follows a microservices architecture, with each service running independently and communicating through HTTP. Docker is used to containerize each service, ensuring consistency across different environments.
- Docker: Ensure Docker is installed on your system. You can download it from the official website.
- Clone the repository:
git clone git@github.com:jumapaul/E-commerce-Backend-App.git cd E-commerce-Backend-App - Variables addition
- Add the necessary environment variables to Docker Compose and the various service configurations in the config server, and run.
docker compose up -dThis project is an implementation of an idea taken from Roadmap.sh https://roadmap.sh/projects/scalable-ecommerce-platform