ATTENTION: This repository is archived, you can find the source code in the new repository that includes much more concepts and upto date - https://github.com/indalkaromkar/spring-boot-3-microservices-course
This repository contains the latest source code of the spring-boot-microservices tutorial
This microservices application consists of three main services:
- Product Service (Port 8080): Manages product catalog
- Order Service (Port 8081): Handles order processing
- Inventory Service (Port 8082): Manages stock levels
A microservices-based e-commerce system that allows you to:
- Browse and manage products
- Place orders
- Check inventory availability
- View Products: Access http://localhost:8080/swagger-ui.html to browse available products
- Place Orders: Use http://localhost:8081/swagger-ui.html to create and manage orders
- Check Inventory: Visit http://localhost:8082/swagger-ui.html to view stock levels
- GET /api/products - List all products
- POST /api/products - Create new product
- POST /api/orders - Place new order
- GET /api/inventory - Check stock availability
- Java 17+
- Maven 3.6+
- Docker (optional)
spring-boot-microservices/
├── product-service/ # Product management service
├── order-service/ # Order processing service
├── inventory-service/ # Inventory management service
└── docker-compose.yml # Docker orchestration
- Spring Boot 3.x
- Spring Data JPA
- H2/MySQL Database
- Docker
- OpenAPI 3.0
- Clone the repository
- Import as Maven project in your IDE
- Run each service individually or use Docker Compose
- Unit tests:
mvn test - Integration tests:
mvn verify - Skip tests:
mvn clean package -DskipTests
- Run
mvn clean package -DskipTeststo build the applications and create the docker image locally. - Run
docker-compose up -dto start the applications.
- Run
mvn clean verify -DskipTestsby going inside each folder to build the applications. - After that run
mvn spring-boot:runby going inside each folder to start the applications.
After starting the services, you can access the OpenAPI documentation at:
- Product Service: http://localhost:8080/swagger-ui.html
- Order Service: http://localhost:8081/swagger-ui.html
- Inventory Service: http://localhost:8082/swagger-ui.html
API specifications are also available in JSON format at:
- Product Service: http://localhost:8080/v3/api-docs
- Order Service: http://localhost:8081/v3/api-docs
- Inventory Service: http://localhost:8082/v3/api-docs