-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Monolith E-Commerce Demo | ||
|
||
This repository provides a minimal example showcasing the Monolith-Architecture in an E-Commerce setting. | ||
This setting includes orders, payment and shipping. | ||
|
||
This demo is part of an article on Enterprise Architecture-Patterns. | ||
The article, including the complete explanation of the E-Commerce-Example, can be found [here](https://github.com/Beleg-6-EAP/Belegarbeit). | ||
|
||
## Get running | ||
|
||
Either run the docker image via plain docker: | ||
```bash | ||
bash> sudo docker build -t demo-monolith-ecommerce . | ||
bash> sudo docker run -p 8080:8080 demo-monolith-ecommerce | ||
``` | ||
or with the given `docker-compose`: | ||
```bash | ||
bash> sudo docker-compose up | ||
``` | ||
|
||
Either will start a web-server running on `http://localhost:8080` with the following endpoints: | ||
|
||
- CreateOrder: `POST /api/orders` | ||
- AllOrders: `GET /api/orders` | ||
- AllPayments: `GET /api/payments` | ||
- AllShipments: `GET /api/shipments` | ||
|
||
We start with en empty database. | ||
To create an order `POST` below request to `http://localhost:8080/api/orders`: | ||
|
||
```json | ||
{ | ||
"userId": "1234-5678-8765-4321", | ||
"amount": 42.0, | ||
"status": "New" | ||
} | ||
``` | ||
|
||
This will initiate payment as well as shipment. | ||
|
||
It's success can be checked by requesting the other endpoints via `GET`. | ||
|
||
## Troubleshooting | ||
|
||
If there is any trouble or if you have any questions, feel free to open an issue! |