This monorepo contains a fully modularized eCommerce backend system built with Spring Boot and a microservices architecture.
This project is designed following microservices best practices. It includes:
- API Gateway: Central entry point for all client requests.
- Service Discovery (Eureka): Allows services to find and communicate with each other.
- Config Server: Centralized configuration management for all services.
- Product Service: Manages products and catalog.
- User Service: Manages authentication, registration, and user data.
- Order Service: Manages order creation, cart functionality, and checkout process.
ecommerce-microservices/
│
├── README.md
├── .gitignore
├── docker-compose.yml (optional)
│
├── config-server/ # Spring Cloud Config Server
├── discovery-server/ # Eureka Server
├── api-gateway/ # Spring Cloud Gateway
├── product-service/ # Product microservice
├── user-service/ # User/Auth microservice
└── order-service/ # Order/Checkout microservice
- Java 17+
- Spring Boot
- Spring Cloud (Eureka, Config, Gateway)
- Spring Security
- Spring Data JPA / Hibernate
- MySQL
- Docker & Docker Compose (optional)
- Lombok
git clone https://github.com/OsamaNuserat/ecommerce-microservices.git
cd ecommerce-microservicesEach microservice is a Spring Boot application. You can run them individually using:
cd discovery-server
./mvnw spring-boot:runRepeat this for:
config-serverapi-gatewayproduct-serviceuser-serviceorder-service
ℹ️ You must run
discovery-serverandconfig-serverbefore other services.
- Each service gets its configuration from the
config-server - Properties are stored in a Git repo or inside
config-server/src/main/resources
http://localhost:8080/products→ Product APIs via Gatewayhttp://localhost:8080/users→ User APIs via Gatewayhttp://localhost:8080/orders→ Order APIs via Gateway
The actual ports and endpoints depend on the gateway and service routes.
- Spring Security (initially with basic auth or in-memory users)
- JWT-based authentication can be added later
You can use docker-compose.yml to orchestrate services locally:
docker-compose up --build- JWT Authentication
- Inventory Service
- Payment Gateway Integration
- Notification Service (Email/SMS)
- Admin Dashboard with Role Management
- Osama Nuserat – osamanuserat.com
This project is open source and free to use under the MIT License.