-
Notifications
You must be signed in to change notification settings - Fork 1
I. Features and Functionality
This page covers the features and functionality of the ecommerce application and assumes the project is already ready to run.
Each service automatically creates a Swagger UI. You should find the Swagger UI page for each service at <serviceUrl>/swagger/index.html
.
The Swagger UI allows you to test the services Web API Endpoints.
To test the Endpoints for example:
- Click on
/api/authentication/register
- Click
Try it out
- Optionally change the POST body data
- Click
Execute
Then swagger makes a request to the endpoint and you should see a similar result like the following. There you can see the response.
Most Endpoints will need a authorization. For that obtain the jwt from the login endpoint. Then click on the Authorize
button and enter the jwt with the format Bearer <token>
in the dialog.
Find further informations about swagger here
This is a short overview of all features the user can execute via the api:
Feature | Service | Endpoint | Frontend Feature at Url |
---|---|---|---|
Customer registers new account | Account Service | POST /api/Authentication/register | /auth/register |
Customer loggs into Account | Account Service | POST/api/Authentication/login | /auth/login |
Customer views profile data | Account Service | GET /api/CustomerProfile | TBD |
Customer edits Profile data | Account Service | PUT /api/CustomerProfile | TBD |
Customer deletes Profile/Account | Account Service | DELETE /api/CustomerProfile | TBD |
Customer searches for products | Inventory Service | GET /api/Products | /shop |
Customer views single product | Inventory Service | TBD | TBD |
Customer adds product to cart | Shopping Cart Service | PUT /api/ShoppingCart/items/{productId} | /shop |
Customer removes product from cart | Shopping Cart Service | DELETE /api/ShoppingCart/{productId} | /shopping-cart |
Customer view cart | Shopping Cart Service | GET /api/ShoppingCart | /shopping-cart |
Customer checks out cart | Shopping Cart Service | PATCH /api/ShoppingCart/state/ckeckout | /shopping-cart?checkout=true |
Customer pays order* | Fulfillment Service | PUT /api/Orders/{orderId}/state/pay | /order/{orderId} |
Customer cancels order | Fulfillment Service | PUT /api/Orders/{orderId}/state/cancel | TBD |
Adminsitrator ships order | Fulfillment Service | PUT /api/OrderManagement/{orderId}/state/ship | /admin/orders |
Order is delivred by logistics service** | Fulfillment Service | PUT /api/OrderManagement/{orderId}/state/deliver | TBD |
Adminsitrator views revenue | Fulfillment | GET /api/revenue | /admin/revenue |
Adminsitrator edit product informations | Inventory Service | PATCH /api/ProductManagement/{id} | /admin/products/{productId} |
Adminsitrator adds stock | Inventory Service | PUT /api/ProductManagement/{id}/stock/add | /admin/products/{productId} |
Adminsitrator removes stock | Inventory Service | PUT /api/ProductManagement/{id}/stock/remove | /admin/products/{productId} |
Adminsitrator adds new product | Inventory Service | POST /api/ProductManagement | /products/add |
Adminsitrator deletes product | Inventory Service | DELETE /api/ProductManagement/{id} | /admin/products/{productId} |
* Payment is for simplicity reasons a blackbox feature. This feature should usually not be an API endpoint, it should be handled by a payment provider. The application should then automatically validate the payment process at the payment provider.
** Delivery is as well a blackbox feature, with the same reasons as above. After the order has been dispatched, a logistics service provider will usually issue the order. This would require the use of their services to track the status. For that potentially another small service could observe the commissioned logistic service provider, and the parcel state could be directed into the system.
There are also some important features running in the background:
Feature | Service |
---|---|
Reservate products when put in shopping cart | Shopping Cart Service |
Remove products reservation when product is removed from shopping cart | Shopping Cart Service |
Timeout shopping cart and remove reservation | Shopping Cart Service |
Remove product stock when products shopping cart is ckecked out | Inventory Service |
Read product stock when order is canceled | Inventory Service |
The Web ui is build in a separate project that can be found here. That project is not necessary.
The frontend project is build with angular and is a single page application. It offers a simple user interface to interact with the backend services. The frontend is not necessary to use the backend services. The backend services can be used with any other client that can send http requests. It is definitely not a production ready frontend. It is just a simple frontend to test and simplify the use of the backend services.
The frontend startup is already setup in the docker-compose.webui.yml
file. Simply start it with docker-compose -f docker-compose.webui.yml up
.
It will start all services and the frontend. The frontend is then available at http://localhost:4200
.
The pages for a normal customer should be accessible completely through ui interaction. There is also an admin area, that is only accessible when logged in as an administrator at the url /admin
.
For further information check out the frontend repository https://github.com/fredyyy998/ecommerce-frontend.
-
Web UI: http://localhost:4200
-
Microservices
- Inventory service: http://localhost:8080
- Account service: http://localhost:8081
- ShoppingCart service: http://localhost:8082
- Fulfillment service: http://localhost:8083
-
Infrastructure
- Postgres Database: localhost:5432
- Kafka: localhost:19092