DOCUMENT
OVERVIEW
Orders system overview
How the orders system fits together — context, landscape, one module, one flow.
Context
01 · C4 model
SECTION 01 · C4 model
The orders system in its world
C4 · CONTEXT
C4 diagram
Person
Shopper
Software System
Orders system
External System
Payments
External System
Shipping
1
2
3
1
places orders
2
charges
3
notifies
Person
Software System
External System
Orders system overview
2 / 5
Landscape
02 · Architecture
SECTION 02 · Architecture
Services and backbone
ARCH
Layered architecture
ORDERS PLATFORM
Apps
Backbone
Storefront
Next.js
Orders API
Fargate
Event bus
managed
orders-db
Postgres
Orders system overview
3 / 5
One module — the API internals
03 · Frontend logic
SECTION 03 · Frontend logic
Orders API — the request chain
LOGIC
Module graph
orders/api
Egress
«controller»
createOrder
POST /orders
«service»
OrderService
validate + place
«repository»
OrderRepo
persist
«gateway»
PaymentGateway
charge
orders-db
Postgres
Payments
third-party
1
2
3
4
5
1
calls
2
saves
3
charges
4
SQL
5
HTTPS
Orders system overview
4 / 5
One flow
04 · Sequence
SECTION 04 · Sequence
FLOW
Sequence diagram
Client
Orders API
Payments
1
POST /orders
2
charge
3
ok
4
201 Created
Orders system overview
5 / 5
‹
01 · Orders system overview
02 · Context
03 · Landscape
04 · One module — the API internals
05 · One flow
1
/ 5
›
Document
▸