This project is a microservices-based application that demonstrates a simple e-commerce system. It consists of several services that work together to handle product management, inventory tracking, and order processing.
- API Gateway: Acts as a single entry point for all client requests.
- Product Service: Manages product information.
- Inventory Service: Tracks product inventory.
- Order Service: Handles order creation and management.
- Java 21
- Spring Boot 3.x
- Spring Cloud
- MySQL
- Docker
- WireMock (for testing)
- Testcontainers (for integration testing)
- Java Development Kit (JDK) 21 or later
- Docker and Docker Compose
- Maven
-
Clone the repository:
git clone https://github.com/SEM24/Spring-Boot-3-Microservices.git cd microservices-project
-
Build the project:
mvn clean package
-
Start the services using Docker Compose:
docker-compose up -d
Once all services are up and running, you can access the API through the API Gateway at http://localhost:8084
.
-
Create a product:
POST http://localhost:8084/api/product { "name": "Samsung S20", "description": "Samsung Galaxy S20 smartphone", "price": 999.99 }
-
Check inventory:
GET http://localhost:8084/api/inventory?skuCode=Samsung S20&quantity=100
-
Place an order:
POST http://localhost:8084/api/order/create { "skuCode": "Samsung S20", "price": 999.99, "quantity": 100 }
The project includes unit tests and integration tests. To run the tests:
mvn test
This project is licensed under the MIT License - see the LICENSE file for details.