Bookshop
Web storefront and order pipeline
Edge
App tier
Data tier
Third parties
Storefront
Next.js
CDN
Cloudflare
shop-api
REST API · Node.js
Instances3
Port:8080
order-worker
Fulfilment jobs
jobs
RabbitMQ
search-api
Search service
Elasticsearch
Search index
Orders DB
PostgreSQL
1Primary
2Replicas
Streaming replication
Sessions
Redis
Stripe
Payments API
HTTPS
enqueue
HTTP
diagram.html#The link keeps the view, selection, route and playback.
What the agent was asked
“Update the bookshop diagram: we added a search service (search-api) that the shop API queries over HTTP, backed by Elasticsearch. Put Stripe into a new 'Third parties' group, and add search to the checkout path view since the storefront uses it before buying.”
Written by a coding agent in the skill’s eval: it read the request, wrote the JSON, validated it and delivered the file.
Read about architecture diagramsThe JSON
{ "kind": "architecture", "title": "Bookshop", "subtitle": "Web storefront and order pipeline", "direction": "DOWN", "groups": [ { "id": "edge", "label": "Edge" }, { "id": "app", "label": "App tier" }, { "id": "data", "label": "Data tier" }, { "id": "third-parties", "label": "Third parties" } ], "nodes": [ { "id": "web", "type": "client", "card": { "title": "Storefront", "subtitle": "Next.js", "brand": "nextdotjs" } }, { "id": "cdn", "type": "gateway", "group": "edge", "card": { "title": "CDN", "subtitle": "Cloudflare", "brand": "cloudflare" } }, { "id": "api", "type": "service", "group": "app", "card": { "title": "shop-api", "subtitle": "REST API · Node.js", "brand": "nodedotjs", "rows": [ { "label": "Instances", "value": "3" }, { "label": "Port", "value": ":8080", "mono": true } ], "footer": { "left": { "text": "eu-west-1", "icon": "region" }, "right": { "text": "HTTPS", "icon": "secure" } } }, "evidence": [ { "file": "services/api/src/server.ts", "line": 12, "note": "Express app and routes" } ] }, { "id": "worker", "type": "service", "group": "app", "card": { "title": "order-worker", "subtitle": "Fulfilment jobs" } }, { "id": "jobs", "type": "queue", "group": "app", "card": { "title": "jobs", "subtitle": "RabbitMQ", "brand": "rabbitmq" } }, { "id": "search-api", "type": "service", "group": "app", "card": { "title": "search-api", "subtitle": "Search service" } }, { "id": "elasticsearch", "type": "database", "group": "data", "card": { "title": "Elasticsearch", "subtitle": "Search index", "brand": "elasticsearch" } }, { "id": "db", "type": "database", "group": "data", "card": { "title": "Orders DB", "subtitle": "PostgreSQL", "brand": "postgresql", "stats": [ { "value": "1", "label": "Primary" }, { "value": "2", "label": "Replicas" } ], "statsNote": "Streaming replication" } }, { "id": "cache", "type": "cache", "group": "data", "card": { "title": "Sessions", "subtitle": "Redis", "brand": "redis" } }, { "id": "stripe", "type": "external", "group": "third-parties", "card": { "title": "Stripe", "subtitle": "Payments API", "brand": "stripe" } } ], "edges": [ { "id": "web-cdn", "from": "web", "to": "cdn", "label": "HTTPS" }, { "id": "cdn-api", "from": "cdn", "to": "api" }, { "id": "api-db", "from": "api", "to": "db" }, { "id": "api-cache", "from": "api", "to": "cache" }, { "id": "api-jobs", "from": "api", "to": "jobs", "kind": "async", "label": "enqueue" }, { "id": "jobs-worker", "from": "jobs", "to": "worker", "kind": "async" }, { "id": "worker-db", "from": "worker", "to": "db" }, { "id": "api-stripe", "from": "api", "to": "stripe" }, { "id": "api-search", "from": "api", "to": "search-api", "label": "HTTP" }, { "id": "search-elasticsearch", "from": "search-api", "to": "elasticsearch" } ], "views": [ { "id": "checkout", "label": "Checkout path", "caption": "What a purchase touches", "nodes": ["web", "cdn", "api", "search-api", "stripe", "db"] }, { "id": "state", "label": "State", "caption": "Where data lives", "nodes": ["db", "cache", "jobs"] } ]}More architecture examples
All examples- Sample web appArchitecture10 nodes
- Production deployment ownershipArchitecture12 nodes
- Food Delivery PlatformArchitecture16 nodesWritten by an agent“Draw our food-delivery platform. Customers use an iOS app and a React web app. Both go through an API gateway (Kong) to four services: accounts, restaurants, orders and a dispatch service that assigns couriers. Orders and accounts use a shared Postgres cluster (one primary, two read replicas); restaurants has its own MongoDB. Orders publishes events to Kafka; dispatch and a notifications worker consume them. Notifications sends push through Firebase and SMS through Twilio. Sessions and rate limits live in Redis. Payments go from orders to Stripe. Auth is Auth0. Add a view for the order path.”
- Production VPCArchitecture9 nodesWritten by an agent“Turn this Mermaid into a stackmap diagram.”