you can read descriptions in baeldung
The project contains the following subprojects:
- Gateway-service
- Discovery-service (combined with Config-service)
- Auth-service
- Order-service
- Payment-service
- Delivery-service
All services worked as demonstration
To run PostgreSQL with Kafka you have to execute the command in project root Report-service:
$sudo docker-compose up -d
Also, you have convenient UI for Apache Kafka at URL
Now you can run application services from your IDE in this order
- Discovery
- Auth-service
- Order-service
- Delivery-service
- Inventory-service
- Payment-service
- Gateway-service
After that you can find Swagger UI of every service at URL.
http://localhost:8080/some-prefix/swagger-ui/index.html
Don't forget to put actual port number and prefix of service
At Gateway, you can find joined Swagger UI http://localhost:9090/swagger-ui.html
You can use those curl commands, or you can do all that with Swagger UI
To create user use this request to auth service
curl -X 'POST' \
'http://localhost:8083/auth/user/signup' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"name": "some_user",
"password": "some_pass"
}'
After that you can get a token
curl -X 'POST' \
'http://localhost:8083/auth/auth/token/generate' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"name": "some_user",
"password": "some_pass"
}'
Now you can use this token to authenticate requests to other service
To create an order you can send POST request:
curl -X 'POST' \
'http://localhost:9090/api/order' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-H 'Bearer <put token here>'
-d '{
"description": "string",
"departureAddress": "string",
"destinationAddress": "string",
"cost": 0
}'
You can list orders with GET request:
curl -X 'GET' \
'http://localhost:9090/api/order' \
-H 'accept: */*' \
-H 'Bearer <put token here>'
You can change status of order with PATCH request:
curl -X 'PATCH' \
'http://localhost:8080/api/order/1' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-H 'Bearer <put token here>'
-d '{
"status": "REGISTERED",
"serviceName": "ORDER_SERVICE",
"comment": "Some comment to status"
}'
To run all services with docker-compose use this command
docker-compose -f docker-compose.yml -f docker-compose.services.yml up -d