0.11.0: arc42 and ArchiMate examples; ref in every diagram kind
Six example models next to the three C4 ones: arc42 (Cinema Tickets, IoT Telemetry, Team Wiki) by section, ArchiMate (Insurance Claims, HR Onboarding, Logistics Tracking) by layer, each validated with 0 errors and 0 warnings. resolveRefs and the editor schemas now take ref: in workflow and dataflow nodes, sequence participants and lifecycle states, as the skill already did. Example tests check each framework's folders.
This commit is contained in:
1 parent
f4df6a0834
commit
0745de822a
85 files changed
+2945
-67
No files matched your search
@@ -0,0 +1,30 @@
|
||||
schema_version: 1
|
||||
diagram_type: architecture
|
||||
meta:
|
||||
title: Technical context
|
||||
output: technical-context.html
|
||||
components:
|
||||
- ref: customer
|
||||
pos: [40, 60]
|
||||
size: [130, 60]
|
||||
- ref: usher
|
||||
pos: [40, 260]
|
||||
size: [130, 60]
|
||||
- ref: tickets
|
||||
pos: [290, 160]
|
||||
size: [150, 60]
|
||||
- ref: psp
|
||||
pos: [560, 60]
|
||||
size: [150, 60]
|
||||
- ref: mail
|
||||
pos: [560, 160]
|
||||
size: [150, 60]
|
||||
- ref: pos
|
||||
pos: [560, 260]
|
||||
size: [150, 60]
|
||||
connections:
|
||||
- { from: customer, to: tickets, label: HTTPS JSON, variant: emphasis }
|
||||
- { from: usher, to: tickets, label: HTTPS app }
|
||||
- { from: tickets, to: psp, label: REST webhook, variant: security }
|
||||
- { from: tickets, to: mail, label: SMTP TLS }
|
||||
- { from: tickets, to: pos, label: REST VPN }
|
||||
@@ -0,0 +1,49 @@
|
||||
schema_version: 1
|
||||
diagram_type: architecture
|
||||
meta:
|
||||
title: Booking API - level 2
|
||||
output: booking.html
|
||||
decisions: [seat-holds-with-ttl]
|
||||
components:
|
||||
- ref: web
|
||||
pos: [40, 160]
|
||||
size: [130, 60]
|
||||
- id: programme
|
||||
type: backend
|
||||
label: Programme
|
||||
sublabel: shows, halls
|
||||
pos: [250, 60]
|
||||
size: [130, 60]
|
||||
- id: seats
|
||||
type: backend
|
||||
label: Seat Holds
|
||||
sublabel: lock, release
|
||||
pos: [250, 160]
|
||||
size: [130, 60]
|
||||
- id: checkout
|
||||
type: backend
|
||||
label: Checkout
|
||||
sublabel: orders, webhook
|
||||
pos: [250, 260]
|
||||
size: [130, 60]
|
||||
- ref: seatlock
|
||||
pos: [460, 160]
|
||||
size: [130, 60]
|
||||
decisions: [seat-holds-with-ttl]
|
||||
- ref: db
|
||||
pos: [460, 60]
|
||||
size: [130, 60]
|
||||
- ref: psp
|
||||
pos: [460, 360]
|
||||
size: [150, 60]
|
||||
boundaries:
|
||||
- kind: region
|
||||
label: Booking API
|
||||
wraps: [programme, seats, checkout]
|
||||
connections:
|
||||
- { from: web, to: programme, label: browse }
|
||||
- { from: web, to: seats, label: hold, variant: emphasis }
|
||||
- { from: web, to: checkout, label: pay }
|
||||
- { from: programme, to: db, label: SQL }
|
||||
- { from: seats, to: seatlock, label: SET NX, decisions: [seat-holds-with-ttl] }
|
||||
- { from: checkout, to: psp, label: session, variant: security }
|
||||
@@ -0,0 +1,64 @@
|
||||
schema_version: 1
|
||||
diagram_type: architecture
|
||||
meta:
|
||||
title: Building blocks - level 1
|
||||
output: level-1.html
|
||||
decisions: [booking-owns-seat-inventory]
|
||||
components:
|
||||
- ref: web
|
||||
pos: [40, 110]
|
||||
size: [130, 60]
|
||||
- ref: mobile
|
||||
pos: [40, 210]
|
||||
size: [130, 60]
|
||||
- ref: scanner
|
||||
pos: [40, 360]
|
||||
size: [130, 60]
|
||||
- ref: booking
|
||||
pos: [250, 160]
|
||||
size: [130, 60]
|
||||
- ref: seatlock
|
||||
pos: [460, 60]
|
||||
size: [130, 60]
|
||||
- ref: db
|
||||
pos: [460, 260]
|
||||
size: [130, 60]
|
||||
- ref: ticketing
|
||||
pos: [250, 360]
|
||||
size: [130, 60]
|
||||
- ref: possync
|
||||
pos: [670, 260]
|
||||
size: [130, 60]
|
||||
- ref: psp
|
||||
pos: [900, 160]
|
||||
size: [150, 60]
|
||||
- ref: pos
|
||||
pos: [900, 260]
|
||||
size: [150, 60]
|
||||
- ref: mail
|
||||
pos: [900, 460]
|
||||
size: [150, 60]
|
||||
boundaries:
|
||||
- kind: region
|
||||
label: Cinema Tickets
|
||||
wraps: [web, mobile, scanner, booking, seatlock, db, ticketing, possync]
|
||||
connections:
|
||||
- { from: web, to: booking, label: JSON, variant: emphasis }
|
||||
- { from: mobile, to: booking, label: JSON }
|
||||
- { from: booking, to: seatlock, label: hold }
|
||||
- { from: booking, to: db, label: SQL }
|
||||
- { from: booking, to: psp, label: checkout, variant: security }
|
||||
- { from: booking, to: ticketing, label: issue, labelAt: [315, 234] }
|
||||
- { from: scanner, to: ticketing, label: check-in }
|
||||
- { from: ticketing, to: db, label: SQL }
|
||||
- { from: ticketing, to: mail, label: QR mail }
|
||||
- { from: possync, to: db, label: SQL }
|
||||
- { from: possync, to: pos, label: sales, decisions: [booking-owns-seat-inventory] }
|
||||
cards:
|
||||
- dot: amber
|
||||
title: 8 Crosscutting concepts
|
||||
items:
|
||||
- "Times in UTC; shown in cinema local time"
|
||||
- "Every write carries an idempotency key"
|
||||
- "QR payload signed with an Ed25519 key"
|
||||
- "Structured logs with order id as trace key"
|
||||
@@ -0,0 +1,27 @@
|
||||
schema_version: 1
|
||||
diagram_type: sequence
|
||||
meta:
|
||||
title: Runtime - book seats
|
||||
output: book-seats.html
|
||||
viewBox: [1060, 680]
|
||||
column_fit: spread
|
||||
decisions: [seat-holds-with-ttl]
|
||||
participants:
|
||||
- { ref: customer }
|
||||
- { ref: web }
|
||||
- { ref: booking }
|
||||
- { ref: seatlock }
|
||||
- { ref: psp }
|
||||
- { ref: ticketing }
|
||||
- { ref: mail }
|
||||
messages:
|
||||
- { from: customer, to: web, y: 170, label: pick seats, variant: emphasis }
|
||||
- { from: web, to: booking, y: 214, label: POST /holds }
|
||||
- { from: booking, to: seatlock, y: 258, label: SET NX TTL 8m, decisions: [seat-holds-with-ttl] }
|
||||
- { from: seatlock, to: booking, y: 302, label: OK, variant: return }
|
||||
- { from: booking, to: web, y: 346, label: hold id, variant: return }
|
||||
- { from: web, to: psp, y: 390, label: hosted checkout, variant: security }
|
||||
- { from: psp, to: booking, y: 434, label: webhook paid, variant: security }
|
||||
- { from: booking, to: ticketing, y: 478, label: issue tickets }
|
||||
- { from: ticketing, to: mail, y: 522, label: QR e-mail }
|
||||
- { from: mail, to: customer, y: 566, label: tickets, variant: return }
|
||||
@@ -0,0 +1,19 @@
|
||||
schema_version: 1
|
||||
diagram_type: sequence
|
||||
meta:
|
||||
title: Runtime - check-in at the door
|
||||
output: check-in.html
|
||||
viewBox: [900, 480]
|
||||
column_fit: spread
|
||||
decisions: [signed-qr-codes]
|
||||
participants:
|
||||
- { ref: usher }
|
||||
- { ref: scanner }
|
||||
- { ref: ticketing }
|
||||
- { ref: db }
|
||||
messages:
|
||||
- { from: usher, to: scanner, y: 180, label: scan QR, variant: emphasis, note: signature checked offline, decisions: [signed-qr-codes] }
|
||||
- { from: scanner, to: ticketing, y: 230, label: POST /checkins }
|
||||
- { from: ticketing, to: db, y: 280, label: first scan wins }
|
||||
- { from: ticketing, to: scanner, y: 330, label: valid seat 7F, variant: return }
|
||||
- { from: scanner, to: usher, y: 380, label: green light, variant: return }
|
||||
@@ -0,0 +1,58 @@
|
||||
schema_version: 1
|
||||
diagram_type: architecture
|
||||
meta:
|
||||
title: Deployment - production
|
||||
output: production.html
|
||||
components:
|
||||
- ref: customer
|
||||
pos: [40, 160]
|
||||
size: [130, 60]
|
||||
- id: ingress
|
||||
type: security
|
||||
label: Ingress
|
||||
sublabel: TLS, WAF
|
||||
pos: [250, 160]
|
||||
size: [130, 60]
|
||||
- ref: web
|
||||
pos: [460, 60]
|
||||
size: [130, 60]
|
||||
- ref: booking
|
||||
pos: [460, 160]
|
||||
size: [130, 60]
|
||||
- ref: ticketing
|
||||
pos: [460, 260]
|
||||
size: [130, 60]
|
||||
- ref: possync
|
||||
pos: [460, 360]
|
||||
size: [130, 60]
|
||||
- ref: seatlock
|
||||
pos: [710, 110]
|
||||
size: [130, 60]
|
||||
- ref: db
|
||||
pos: [710, 260]
|
||||
size: [130, 60]
|
||||
- ref: pos
|
||||
pos: [250, 460]
|
||||
size: [150, 60]
|
||||
- ref: scanner
|
||||
pos: [40, 460]
|
||||
size: [130, 60]
|
||||
boundaries:
|
||||
- kind: region
|
||||
label: EU cloud - k8s cluster
|
||||
wraps: [ingress, web, booking, ticketing, possync]
|
||||
- kind: security-group
|
||||
label: Managed data zone
|
||||
wraps: [seatlock, db]
|
||||
- kind: region
|
||||
label: Cinema site
|
||||
wraps: [pos, scanner]
|
||||
connections:
|
||||
- { from: customer, to: ingress, label: HTTPS, variant: emphasis }
|
||||
- { from: ingress, to: web, label: route }
|
||||
- { from: ingress, to: booking, label: route }
|
||||
- { from: booking, to: seatlock, label: TLS }
|
||||
- { from: booking, to: db, label: TLS }
|
||||
- { from: ticketing, to: db, label: TLS }
|
||||
- { from: possync, to: pos, label: VPN, variant: security }
|
||||
- { from: scanner, to: ingress, label: HTTPS }
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
schema_version: 1
|
||||
decision:
|
||||
id: seat-holds-with-ttl
|
||||
title: Seat holds as Redis keys with a TTL
|
||||
status: accepted
|
||||
date: 2026-09-08
|
||||
elements: [booking, seatlock]
|
||||
diagrams: [0500-building-blocks/booking.archify, 0600-runtime/book-seats.archify]
|
||||
context: >
|
||||
A customer may spend minutes at the payment page. Holding seats
|
||||
as rows in the database left orphans when a browser closed, and
|
||||
a nightly job freed them far too late for Friday shows.
|
||||
decision: >
|
||||
A hold is one Redis key per seat, set with SET NX and an
|
||||
8-minute TTL. The payment webhook turns holds into an order in
|
||||
PostgreSQL; an expired key frees the seat without any job.
|
||||
consequences: >
|
||||
Holds survive no Redis restart; at worst a customer re-picks
|
||||
seats. The webhook must check the hold still exists before it
|
||||
confirms the order, otherwise it refunds.
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
schema_version: 1
|
||||
decision:
|
||||
id: booking-owns-seat-inventory
|
||||
title: The Booking API owns the seat inventory
|
||||
status: accepted
|
||||
date: 2026-09-22
|
||||
elements: [booking, db, possync, pos]
|
||||
diagrams: [0500-building-blocks/level-1.archify]
|
||||
context: >
|
||||
The box-office POS and the web shop both sold seats from their
|
||||
own copy of the seat map. Twice a month a seat was sold at the
|
||||
counter and online.
|
||||
decision: >
|
||||
The Tickets DB is the only seat inventory. The POS asks POS Sync
|
||||
for a seat before it prints a ticket; POS Sync writes the sale
|
||||
through the same rules as online orders.
|
||||
consequences: >
|
||||
The counter needs the network to sell; a fallback block of
|
||||
reserved seats per show covers outages. The POS vendor adapter
|
||||
is ours to maintain.
|
||||
@@ -0,0 +1,19 @@
|
||||
schema_version: 1
|
||||
decision:
|
||||
id: signed-qr-codes
|
||||
title: Signed QR codes checked offline at the door
|
||||
status: accepted
|
||||
date: 2026-10-06
|
||||
elements: [ticketing, scanner]
|
||||
diagrams: [0600-runtime/check-in.archify]
|
||||
context: >
|
||||
Cinema Wi-Fi drops when a full hall arrives. A scanner that
|
||||
needs the server for every ticket stops the queue.
|
||||
decision: >
|
||||
The Ticket Service signs each QR payload (ticket id, show,
|
||||
seat) with a private key. The scanner app verifies it with the
|
||||
public key and queues check-ins until it is online again.
|
||||
consequences: >
|
||||
A forwarded ticket scans twice while offline; the second scan
|
||||
is flagged when the queue syncs. Key rotation needs an app
|
||||
update window.
|
||||
@@ -0,0 +1,72 @@
|
||||
schema_version: 1
|
||||
model:
|
||||
id: cinema-tickets
|
||||
name: Cinema Tickets
|
||||
description: >
|
||||
An arc42 example: online and mobile seat booking for a small
|
||||
cinema chain. This overview is section 3 (business context) with
|
||||
cards for sections 1, 2, 10, 11 and 12. 0300-context holds the
|
||||
technical context (3), 0500-building-blocks the building block
|
||||
view (5), 0600-runtime the runtime view (6), 0700-deployment the
|
||||
deployment view (7), decisions/ the architecture decisions (9).
|
||||
Crosscutting concepts (8) are a card on the level-1 diagram.
|
||||
diagram_type: architecture
|
||||
meta:
|
||||
title: Cinema Tickets - business context
|
||||
output: main.html
|
||||
components:
|
||||
- ref: customer
|
||||
pos: [40, 60]
|
||||
size: [130, 60]
|
||||
- ref: usher
|
||||
pos: [40, 260]
|
||||
size: [130, 60]
|
||||
- ref: tickets
|
||||
pos: [280, 160]
|
||||
size: [150, 60]
|
||||
- ref: psp
|
||||
pos: [540, 60]
|
||||
size: [150, 60]
|
||||
- ref: mail
|
||||
pos: [540, 160]
|
||||
size: [150, 60]
|
||||
- ref: pos
|
||||
pos: [540, 260]
|
||||
size: [150, 60]
|
||||
connections:
|
||||
- { from: customer, to: tickets, label: books seats, variant: emphasis }
|
||||
- { from: usher, to: tickets, label: checks in }
|
||||
- { from: tickets, to: psp, label: payments, variant: security }
|
||||
- { from: tickets, to: mail, label: tickets }
|
||||
- { from: tickets, to: pos, label: seat sales }
|
||||
cards:
|
||||
- dot: cyan
|
||||
title: 1 Quality goals
|
||||
items:
|
||||
- "No seat is ever sold twice"
|
||||
- "Checkout under 2 s at Friday peak"
|
||||
- "Door check-in works offline"
|
||||
- dot: slate
|
||||
title: 2 Constraints
|
||||
items:
|
||||
- "Existing box-office POS stays"
|
||||
- "Card data only at the provider"
|
||||
- "Team of four; hosted in the EU"
|
||||
- dot: emerald
|
||||
title: 10 Quality scenarios
|
||||
items:
|
||||
- "500 holds on one show in 1 min: no double sale"
|
||||
- "Wi-Fi down at the door: scans go on, sync later"
|
||||
- "Payment fails: seats free again within 8 min"
|
||||
- dot: rose
|
||||
title: 11 Risks
|
||||
items:
|
||||
- "POS vendor API is slow and undocumented"
|
||||
- "Forwarded QR e-mails: first scan wins"
|
||||
- dot: violet
|
||||
title: 12 Glossary
|
||||
items:
|
||||
- "Show: one screening of a film in a hall"
|
||||
- "Hold: a seat locked for one customer"
|
||||
- "Check-in: first valid scan of a ticket"
|
||||
- "POS: point-of-sale till at the box office"
|
||||
@@ -0,0 +1,57 @@
|
||||
schema_version: 1
|
||||
elements:
|
||||
web:
|
||||
type: frontend
|
||||
label: Web Shop
|
||||
sublabel: React
|
||||
brand: react
|
||||
description: >
|
||||
Programme, seat map and checkout in the browser.
|
||||
mobile:
|
||||
type: frontend
|
||||
label: Mobile App
|
||||
sublabel: iOS and Android
|
||||
description: >
|
||||
The same booking flow as the web shop, plus a ticket wallet.
|
||||
scanner:
|
||||
type: frontend
|
||||
label: Scanner App
|
||||
sublabel: door phones
|
||||
description: >
|
||||
Reads QR codes at the door; checks signatures offline.
|
||||
booking:
|
||||
type: backend
|
||||
label: Booking API
|
||||
sublabel: Node.js
|
||||
brand: node-js
|
||||
description: >
|
||||
Shows, seat maps, seat holds and orders; the only writer of
|
||||
the seat inventory.
|
||||
diagram: 0500-building-blocks/booking.archify
|
||||
ticketing:
|
||||
type: backend
|
||||
label: Ticket Service
|
||||
sublabel: QR, check-in
|
||||
description: >
|
||||
Issues signed QR tickets, sends them by e-mail and records
|
||||
check-ins at the door.
|
||||
possync:
|
||||
type: backend
|
||||
label: POS Sync
|
||||
sublabel: adapter
|
||||
description: >
|
||||
Exchanges seat sales with the box-office POS in both directions.
|
||||
seatlock:
|
||||
type: database
|
||||
label: Seat Locks
|
||||
sublabel: Redis
|
||||
brand: redis
|
||||
description: >
|
||||
Short-lived seat holds with a TTL while the customer pays.
|
||||
db:
|
||||
type: database
|
||||
label: Tickets DB
|
||||
sublabel: PostgreSQL
|
||||
brand: postgresql
|
||||
description: >
|
||||
Shows, seats, orders and tickets; the source of truth.
|
||||
@@ -0,0 +1,14 @@
|
||||
schema_version: 1
|
||||
elements:
|
||||
customer:
|
||||
type: external
|
||||
label: Moviegoer
|
||||
sublabel: web and mobile
|
||||
description: >
|
||||
Picks a show, holds seats and pays; gets the tickets by e-mail.
|
||||
usher:
|
||||
type: external
|
||||
label: Usher
|
||||
sublabel: door staff
|
||||
description: >
|
||||
Scans tickets at the auditorium door with the scanner app.
|
||||
@@ -0,0 +1,30 @@
|
||||
schema_version: 1
|
||||
elements:
|
||||
tickets:
|
||||
type: cloud
|
||||
label: Cinema Tickets
|
||||
sublabel: the system
|
||||
description: >
|
||||
Online booking, seat holds, e-mail tickets and door check-in
|
||||
for the five cinemas of the fictional Lantern Cinemas chain.
|
||||
diagram: 0500-building-blocks/level-1.archify
|
||||
psp:
|
||||
type: external
|
||||
label: Payment provider
|
||||
sublabel: hosted checkout
|
||||
description: >
|
||||
Takes card and wallet payments on its own page; we never see
|
||||
card numbers.
|
||||
pos:
|
||||
type: external
|
||||
label: Box-office POS
|
||||
sublabel: in each cinema
|
||||
description: >
|
||||
Till system at the counter; sells walk-in seats from the same
|
||||
seat map.
|
||||
mail:
|
||||
type: external
|
||||
label: E-mail service
|
||||
sublabel: transactional
|
||||
description: >
|
||||
Delivers ticket e-mails with QR codes and receipts.
|
||||
Reference in new issue
Block a user