A demo microservices project implementing an order system using Spring Boot, Spring Cloud, and Eureka for service discovery.
This project demonstrates a microservices architecture for an order system. It comprises several independent services, including an API Gateway, Authentication Service, Eureka Server for service discovery, Order Service, Product Service, and Review Service. Each service is built with Spring Boot and designed to communicate with each other within a distributed system.
spring-boot-starter-data-mongodb). ⭐springdoc-openapi-starter-webmvc-ui). 📄This project is a collection of Spring Boot microservices. To run it, you will need to have Java Development Kit (JDK) 17 or higher and Apache Maven installed.
Clone the Repository:
git clone https://github.com/phambaophuc/order-system-ms.git
cd order-system-ms
Build Each Microservice:
Navigate to each microservice directory and build it using Maven. For example, for the Eureka Server:
cd eureka-server
mvn clean install
cd ..
Repeat this for config-server, api-gateway, auth-service, order-service, product-service, and review-service.
Run the Services:
The services are typically run using their respective Maven Spring Boot plugins or by executing the generated JAR files.
Eureka Server: Start this service first to enable service discovery.
cd eureka-server
mvn spring-boot:run
Access the Eureka dashboard at http://localhost:8761.
Config Server: Start the config server to manage externalized configurations.
cd config-server
mvn spring-boot:run
API Gateway: This service routes requests to other microservices.
cd api-gateway
mvn spring-boot:run
The API Gateway will likely expose endpoints for the other services.
Other Services (Auth, Order, Product, Review): Start these services in any order after Eureka and the Config Server are running.
cd auth-service
mvn spring-boot:run
cd order-service
mvn spring-boot:run
cd product-service
mvn spring-boot:run
cd review-service
mvn spring-boot:run
Note: The exact ports for each service are determined by their Spring Boot configuration (e.g., application.properties or application.yml), which are not fully detailed in the provided analysis. The docker-compose.yaml file is present but its content was not provided, suggesting it might be used for orchestration but requires further setup.
This project is designed as a set of microservices that work together to form an order system. The primary interaction point is the API Gateway, which acts as the entry point for all client requests.
order-service.product-service.review-service.auth-service handles user authentication, likely providing tokens for protected API access.http://localhost:PORT where PORT is the port configured for the API Gateway.Example Workflow (Conceptual):
auth-service. You might receive a JWT token upon successful login.product-service.order-service. This might involve calls to product-service to verify product availability.review-service, potentially associating it with a specific order or product.Specific API endpoints and request/response formats would be detailed in the Swagger UI documentation for each service (accessible via their respective endpoints, e.g., http://localhost:PORT/swagger-ui.html).
The project is organized into several microservices, each residing in its own directory:
order-system-ms/
├── api-gateway/
│ └── pom.xml
├── auth-service/
│ └── pom.xml
├── config-server/
│ ├── pom.xml
│ └── .mvn/
│ └── wrapper/
│ ├── maven-wrapper.jar
│ └── maven-wrapper.properties
├── eureka-server/
│ └── pom.xml
├── order-service/
│ └── pom.xml
├── product-service/
│ └── pom.xml
├── review-service/
│ └── pom.xml
├── docker-compose.yaml
├── .idea/
│ ├── ... (IDE specific files)
└── README.md
Each subdirectory (e.g., api-gateway, order-service) contains a Spring Boot application managed by Maven, defined by its pom.xml file.
Detailed API documentation can be found by accessing the Swagger UI for each microservice. Once the services are running, you can typically find the UI at the following endpoints:
http://localhost:<auth-port>/swagger-ui.htmlhttp://localhost:<order-port>/swagger-ui.htmlhttp://localhost:<product-port>/swagger-ui.htmlhttp://localhost:<review-port>/swagger-ui.htmlNote: The specific ports are not provided in the analysis and would need to be determined from the service's configuration files.
This project is not currently under any specified license. Please refer to the repository owner for licensing details.
Developed with ❤️ by phambaophuc
✨ Feel free to fork, star, and contribute to this project! ✨