Opening the shared document…
Diagram playground
Write a diagram as text and it renders here as you type. Canvas editing for six of ten notations. Nothing leaves your browser. Syntax reference ·
1
archlab 1.0
2
schema "https://arch-lab.dev/schema/v1/diagram.schema.json"
3
title "Order Shop"
4
description "A deliberately small model of one flow: a customer places an order in an online shop."
5
created 2026-07-27T00:00:00Z
6
updated 2026-07-27T00:00:00Z
7
generator "arch-lab" "0.1.0"
8
9
@component d-cmp-order-service "Order Service — Components" owner=order-service
10
desc "The parts that place one order. Boundary nodes come from the container view."
11
view 1 0 0
12
ext-email-cmp:external ^d-cnt-order-shop/ext-email (752,520 160x80)
13
ext-order-db:database ^d-cnt-order-shop/order-db (496,688 176x80)
14
ext-payment-cmp:external ^d-cnt-order-shop/ext-payment (240,688 160x80)
15
ext-storefront:external ^d-cnt-order-shop/storefront (480,40 176x80)
16
order-api:component "Order API Handler" [Go / chi] (480,192 176x88)
17
desc "Validates the request and maps errors to HTTP responses."
18
order-repository:component "Order Repository" [Go / pgx] (496,520 176x88)
19
desc "Persistence for the order record."
20
payment-client:component "Payment Client" [Go] (240,520 176x88)
21
desc "Adapter for the payment provider's REST API."
22
place-order-usecase:component "Place Order Use Case" [Go] (472,352 192x88)
23
desc "Takes payment, saves the order, then sends the confirmation."
24
25
order-api -> place-order-usecase : "Invokes with a validated order" id=e-api-usecase
26
payment-client -> ext-payment-cmp : "Authorises and captures the card" [HTTPS/JSON] ~e-orders-payment id=e-payment-provider
27
order-repository <-> ext-order-db : "Inserts and reads orders" [SQL/TCP] ~e-orders-db id=e-repo-db
28
ext-storefront -> order-api : "POST /orders" [HTTP/JSON] ~e-storefront-orders id=e-storefront-api
29
place-order-usecase -> ext-email-cmp : "Sends the order confirmation" [HTTPS/JSON] ~e-orders-email id=e-usecase-email
30
place-order-usecase -> payment-client : "Requests payment authorisation" id=e-usecase-payment
31
place-order-usecase -> order-repository : "Saves the accepted order" id=e-usecase-repo
32
33
@container d-cnt-order-shop "Order Shop — Containers" owner=order-shop
34
desc "The deployable pieces that place one order."
35
view 1 0 0
36
ext-customer:person ^d-ctx-root/customer (480,40 160x88)
37
ext-email:external ^d-ctx-root/email-provider (688,560 160x80)
38
ext-payment:external ^d-ctx-root/payment-provider (480,560 160x80)
39
order-db:database "Order Database" @postgresql~ [PostgreSQL 16] (264,560 176x88)
40
desc "Orders and their payment status. System of record."
41
order-service:container "Order Service" @golang~ [Go 1.22] >d-cmp-order-service (472,376 176x88)
42
desc "Accepts an order, takes payment, and records it."
43
storefront:container "Storefront Web App" @nextjs~ [Next.js 15] (472,208 176x88)
44
desc "Product pages, the cart, and the checkout form."
45
46
ext-customer -> storefront : "Browses products and checks out" [HTTPS] ~e-customer-shop id=e-customer-storefront
47
order-service <-> order-db : "Reads and writes orders" [SQL/TCP] id=e-orders-db
48
order-service -> ext-email : "Sends order confirmation" [HTTPS/JSON] ~e-shop-email id=e-orders-email
49
order-service -> ext-payment : "Authorises payment" [HTTPS/JSON] ~e-shop-payment id=e-orders-payment
50
storefront -> order-service : "Submits the order" [HTTP/JSON] id=e-storefront-orders
51
52
path checkout "Placing an order"
53
beat "A shopper checks out in the storefront."
54
ext-customer -> storefront
55
beat "The storefront submits the order to the service."
56
storefront -> order-service
57
beat "Which authorises the payment, stores the order, and confirms it by email."
58
order-service -> ext-payment
59
order-service -> order-db
60
order-service -> ext-email
61
62
@context d-ctx-root "Order Shop — System Context"
63
desc "Who places orders and which third parties fulfil them."
64
view 1 0 0
65
customer:person "Customer" (480,80 160x96)
66
desc "Shopper picking products and placing an order."
67
email-provider:external "Email Provider" [REST API] (640,600 200x96)
68
desc "Third party that delivers order confirmation emails."
69
order-shop:system "Order Shop" [Next.js / Go] >d-cnt-order-shop (400,320 320x120)
70
desc "Small online shop: browse products, place an order, pay."
71
payment-provider:external "Payment Provider" [REST API] (280,600 200x96)
72
desc "Third party that authorises and captures card payments."
73
74
customer -> order-shop : "Places an order" [HTTPS] id=e-customer-shop
75
order-shop -> email-provider : "Sends order confirmation" [HTTPS/JSON] id=e-shop-email
76
order-shop -> payment-provider : "Authorises payment" [HTTPS/JSON] id=e-shop-payment
Tab indents · Esc then Tab leaves the editor · syntax reference
Read-only
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.
Order Shop
A deliberately small model of one flow: a customer places an order in an online shop.