This project is a modular, microservice-based e-commerce backend built using Spring Boot, tailored for managing a computer store. It follows a service-oriented architecture to ensure scalability, maintainability, and ease of integration with other systems like frontend apps or external services.
- Java
- Spring boot
- Maven
- MySQL
- Kafka
- Docker
- Observation tools
- This project is secured using Spring Security, JWT authentication, and a Spring Cloud Gateway.
- Only the admin has permission to add, update, and delete product data.
- Users can change their password and account details, and account recovery is supported if a password is forgotten.
- Each user has exclusive access to their shopping cart and can place orders independently.
- Only the admin can view all user orders.
- When an order is placed, the Order Service, Product Service, and Inventory Service work together to validate the order.
- Before confirming the order, the inventory is checked for stock availability.
- If anything fails during the process, the system automatically rolls back inventory changes to maintain data consistency.
- After an order is successfully placed, order details are sent to the admin's email using Kafka via the Notification Service.
- When inventory levels are low, a low stock alert is also emailed to the admin using Kafka.
- The application supports pagination and sorting of products.
- Products can be browsed by category, and users can apply filters.
- I have created separate classes for different product types instead of a single general product class, making the filtering logic easier to maintain.
- Each microservice (product-service, inventory-service, order-service, user-service) uses a separate database schema.
- All databases are hosted on a single MySQL container, keeping infrastructure lightweight for local development.
- Observability tools integrated:
- Prometheus and Grafana for metrics monitoring
- EFK Stack (Elasticsearch, FluentBit, Kibana) for log aggregation
- Zipkin for distributed tracing
- OpenAPI is used to document the APIs, making it easier for clients or frontend developers to understand and consume them.
- This project is fully containerized using Docker, providing a real microservice environment.
- This setup makes local deployment simple and demonstrates cloud-native architecture principles.
- Built following Object-Oriented Programming (OOP) principles and backend microservice architecture standards.
- An integration test suite is included under a dedicated
integration-tests
folder. - Some key screenshots are included for better understanding and demonstration.
Follow these steps to clone, build, and run the e-commerce backend microservices project.
git clone https://github.com/tisitha/e-commerce-computer-store--microservice.git
cd e-commerce-computer-store--microservice
mvn clean package -DskipTests
docker-compose up
- Spring Web
- Spring Data JPA
- Spring Security
- JsonWebToken
- Spring Cloud
- Spring Reactive Gateway
- Netflix Eureka
- Spring Mail
- Spring Validation
- MySQL Driver
- Spring Kafka
- OpenFeign
- Lombok
- Actuator
- Prometheus
- OpenAPI
- Zipkin
- OpenTelemetry
- Rest Assured
- Junit 5