Micro Services for Ordering System for some (hardware) products.
- Introduction
- Features
- Requirements
- Quick Start
- API Usage
- Microservice Architecture
- Database Diagram
- Remarks for improvement
It is a RESTful API build on top of microservice architecture focused on ordering system.
Those are the features available:
- Manage Product catalog:
- allow adding new products to catalog;
- allow removing products from the catalog;
- get information about stock for a specific product;
- manage product stock (increase or decreasing the number of available items);
- Manage Ordering of Products from the catalog:
- create new order
- only known products are orderable;
- check on stock is done;
- orders have a state (running, delivered, cancelled);
- order can have its state updated:
- the product stock is updated on delivery of the order;
- show status and content of orders;
- create new order
The application can run locally, the requirements for each setup are listed below:
- Java 17 SDK
- Maven
- Postman
- or any other API Client;
Make sure to have Docker started on your local machine.
Start Zipkin application on its default port 9411
. In order to do that, run the following command:
$ docker run -d -p 9411:9411 openzipkin/zipkin
Start each Spring Boot application in the respective order:
- service-registry
- config-server
- product-service
- inventory-service
- order-service
- api-gateway
For example, go to the respective application's folder, and run:
$ cd ./service-registry
$ mvn spring-boot:run
Each application will run on its pre-defined port. Another option is to run them on the IDE of your preference.
Knows more at the Microservice Architecture section.
A Postman Collection can be found at this repository.
The collection has all the available endpoints within this project.
Below is the overview of the project's architecture:
Below is the overview of the project's database diagram:
Below are some remarks, stuff not yet done but seen as possible improvements:
- Use spring-boot-starter-validation to provide validation for the requests;
- Reducing microservice duplicity of Java Objects with shared libraries;
- Implement some sort of Security;
- Write Unit tests (JUnit);
- Change @repository layers to have a real Database like PostgresSQL instead of List and HashMap;