{
  "schemaVersion": "0.1",
  "diagramFamily": "architecture",
  "scene": {
    "id": "pr-architecture-after",
    "title": "Architecture (after PR adds Payments service)",
    "units": "px",
    "canvas": { "width": 1100, "height": 520 }
  },
  "layoutStrategy": {
    "algorithm": "hierarchical",
    "direction": "LR",
    "nodeSpacing": 50,
    "rankSpacing": 120
  },
  "elements": [
    { "id": "client", "kind": "node", "nodeType": "actor", "shape": "roundedRect", "label": "Web Client", "icon": "lucide:globe" },
    { "id": "gateway", "kind": "node", "nodeType": "service", "shape": "roundedRect", "label": "API Gateway", "icon": "lucide:network" },
    { "id": "auth", "kind": "node", "nodeType": "service", "shape": "roundedRect", "label": "Auth Service", "icon": "lucide:lock" },
    { "id": "users", "kind": "node", "nodeType": "service", "shape": "roundedRect", "label": "Users Service", "icon": "lucide:users" },
    { "id": "orders", "kind": "node", "nodeType": "service", "shape": "roundedRect", "label": "Orders Service", "icon": "lucide:package" },
    { "id": "payments", "kind": "node", "nodeType": "service", "shape": "roundedRect", "label": "Payments Service", "icon": "lucide:credit-card" },
    { "id": "stripe", "kind": "node", "nodeType": "externalSystem", "shape": "roundedRect", "label": "Stripe", "icon": "lucide:external-link" },
    { "id": "postgres", "kind": "node", "nodeType": "database", "shape": "cylinder", "label": "PostgreSQL", "icon": "lucide:database" },
    { "id": "redis", "kind": "node", "nodeType": "database", "shape": "cylinder", "label": "Redis", "icon": "lucide:database" },
    { "id": "e_client_gw", "kind": "edge", "from": { "elementId": "client" }, "to": { "elementId": "gateway" }, "label": "HTTPS", "router": "orthogonal" },
    { "id": "e_gw_auth", "kind": "edge", "from": { "elementId": "gateway" }, "to": { "elementId": "auth" }, "label": "validates", "router": "orthogonal" },
    { "id": "e_gw_users", "kind": "edge", "from": { "elementId": "gateway" }, "to": { "elementId": "users" }, "router": "orthogonal" },
    { "id": "e_gw_orders", "kind": "edge", "from": { "elementId": "gateway" }, "to": { "elementId": "orders" }, "router": "orthogonal" },
    { "id": "e_orders_payments", "kind": "edge", "from": { "elementId": "orders" }, "to": { "elementId": "payments" }, "label": "triggers", "router": "orthogonal" },
    { "id": "e_payments_stripe", "kind": "edge", "from": { "elementId": "payments" }, "to": { "elementId": "stripe" }, "label": "charges", "router": "orthogonal" },
    { "id": "e_users_db", "kind": "edge", "from": { "elementId": "users" }, "to": { "elementId": "postgres" }, "router": "orthogonal" },
    { "id": "e_orders_db", "kind": "edge", "from": { "elementId": "orders" }, "to": { "elementId": "postgres" }, "router": "orthogonal" },
    { "id": "e_payments_db", "kind": "edge", "from": { "elementId": "payments" }, "to": { "elementId": "postgres" }, "router": "orthogonal" },
    { "id": "e_orders_redis", "kind": "edge", "from": { "elementId": "orders" }, "to": { "elementId": "redis" }, "label": "cache", "router": "orthogonal" }
  ]
}
