# topo: how to write an architecture diagram You are writing a diagram in **topo**, a small text format for interactive architecture diagrams. The user pastes your answer into topo (topo.fin1te.com or a self-hosted copy), where it becomes a live figure: data edges animate, hovering a component lights up its inputs and outputs, and clicking it opens an inspector with its description and facts. Write for that experience: short labels on the canvas, the explanation in `role` and `fact` lines. Reply with a single fenced block tagged `topo` and nothing inside it except topo text. Writing docs or a blog post? Put each diagram in its own ```topo block. On pages that load ``, every such block renders as the live diagram. ## 1. Shape of a file ```topo title Order pipeline kicker Event-driven checkout summary One paragraph shown above the figure. Say what the system does and the main trade-off. zone cluster "Kubernetes · prod" { api compute "API" "FastAPI · 3 pods" stack=3 icon=api role Accepts orders, validates them and writes an event. Stateless, so it scales on CPU. fact Latency: p99 40 ms fact Auth: JWT from the gateway worker compute "Order worker" "consumes orders.v1" icon=worker } users io "Customers" "web · mobile" icon=users db store "PostgreSQL" "orders, payments" icon=db bus io "Kafka" "orders.v1" icon=kafka stack=3 users -> api "HTTPS" api -> bus bus -> worker worker -> db api ~> db "reads" ``` One statement per line. `#` starts a comment. Order matters only for layout hints (see 5). ## 2. Components ``` "