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: 4 elements, 3 relationships
PERSON
Shopper
SYSTEM
Orders system
EXT
Payments
EXT
Shipping
places orders
charges
notifies
Legend
PERSON
person
SYSTEM
software system
EXT
external system
outside the boundary
uses
the system in scope
Orders system overview
2 / 5
Landscape
02 · Architecture
SECTION 02 · Architecture
Services and backbone
ARCH
Layered architecture: 2 layers, 4 nodes
ORDERS PLATFORM
Apps
Backbone
Storefront
Next.js
CLIENT
Orders API
Fargate
SVC
Event bus
managed
QUEUE
orders-db
Postgres
DB
Legend
CLIENT
client
SVC
service
QUEUE
queue
DB
database
calls
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
DB
Payments
third-party
EXT
1
2
3
4
5
1
calls
2
saves
3
charges
4
SQL
5
HTTPS
Legend
CONTROLLER
controller / route
SERVICE
service / use case
REPOSITORY
repository
GATEWAY
gateway
DB
database
EXT
external
contract / external
passive (state, middleware, store)
uses
network call
entry point
Orders system overview
4 / 5
One flow
04 · Sequence
SECTION 04 · Sequence
SEQUENCE
Sequence diagram: 4 messages between 3 actors
Client
Orders API
Payments
1
POST /orders
2
charge
3
ok
4
201 Created
Legend
call
response
the answer the caller gets
active
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
▸