{
  "schema_version": 1,
  "diagram_type": "architecture",
  "meta": {
    "title": "Hbada 微服务运行入口与服务职责",
    "locale": "zh-CN",
    "quality_profile": "showcase",
    "viewBox": [
      1360,
      600
    ]
  },
  "components": [
    {
      "id": "client",
      "type": "frontend",
      "label": "App / 后台 / 设备回调",
      "sublabel": "HTTP 与 WebSocket 入口",
      "pos": [
        575,
        30
      ],
      "size": [
        210,
        76
      ]
    },
    {
      "id": "gateway",
      "type": "backend",
      "label": "hbada-gateway",
      "sublabel": "手工路由 · 8080",
      "pos": [
        575,
        210
      ],
      "size": [
        210,
        76
      ]
    },
    {
      "id": "identity",
      "type": "backend",
      "label": "hbada-identity",
      "sublabel": "身份与权限 · 9201",
      "pos": [
        25,
        445
      ],
      "size": [
        170,
        76
      ]
    },
    {
      "id": "system",
      "type": "backend",
      "label": "hbada-system",
      "sublabel": "系统与站内消息 · 9202",
      "pos": [
        215,
        445
      ],
      "size": [
        170,
        76
      ]
    },
    {
      "id": "device",
      "type": "backend",
      "label": "hbada-device",
      "sublabel": "设备与控制 · 9203",
      "pos": [
        405,
        445
      ],
      "size": [
        170,
        76
      ]
    },
    {
      "id": "insight",
      "type": "backend",
      "label": "hbada-insight",
      "sublabel": "坐姿与习惯分析 · 9204",
      "pos": [
        595,
        445
      ],
      "size": [
        170,
        76
      ]
    },
    {
      "id": "realtime",
      "type": "backend",
      "label": "hbada-realtime",
      "sublabel": "实时消息投递 · 9205",
      "pos": [
        785,
        445
      ],
      "size": [
        170,
        76
      ]
    },
    {
      "id": "media",
      "type": "backend",
      "label": "hbada-media",
      "sublabel": "文件与存储 · 9206",
      "pos": [
        975,
        445
      ],
      "size": [
        170,
        76
      ]
    },
    {
      "id": "notification",
      "type": "backend",
      "label": "hbada-notification",
      "sublabel": "通知告警 · 内部 API · 9207",
      "pos": [
        1165,
        445
      ],
      "size": [
        170,
        76
      ]
    }
  ],
  "connections": [
    {
      "id": "client_gateway",
      "to": "gateway",
      "label": "HTTP / WS",
      "variant": "emphasis",
      "from": "client",
      "fromSide": "bottom",
      "toSide": "top",
      "labelAt": [
        680,
        158
      ]
    },
    {
      "id": "gateway_identity",
      "to": "identity",
      "label": "HTTP 路由",
      "from": "gateway",
      "fromSide": "bottom",
      "toSide": "top",
      "labelAt": [
        110,
        413
      ]
    },
    {
      "id": "gateway_system",
      "to": "system",
      "label": "HTTP 路由",
      "from": "gateway",
      "fromSide": "bottom",
      "toSide": "top",
      "labelAt": [
        300,
        413
      ]
    },
    {
      "id": "gateway_device",
      "to": "device",
      "label": "HTTP 路由",
      "from": "gateway",
      "fromSide": "bottom",
      "toSide": "top",
      "labelAt": [
        490,
        413
      ]
    },
    {
      "id": "gateway_insight",
      "to": "insight",
      "label": "HTTP 路由",
      "from": "gateway",
      "fromSide": "bottom",
      "toSide": "top",
      "labelAt": [
        680,
        413
      ]
    },
    {
      "id": "gateway_realtime",
      "to": "realtime",
      "label": "WS / HTTP",
      "from": "gateway",
      "fromSide": "bottom",
      "toSide": "top",
      "labelAt": [
        870,
        413
      ]
    },
    {
      "id": "gateway_media",
      "to": "media",
      "label": "HTTP 路由",
      "from": "gateway",
      "fromSide": "bottom",
      "toSide": "top",
      "labelAt": [
        1060,
        413
      ]
    }
  ],
  "cards": [
    {
      "dot": "cyan",
      "title": "实际部署单元",
      "items": [
        "7 个后端服务 + 1 个 Gateway；网关按路径转发。notification 仅供内部调用，无公网路由。"
      ]
    },
    {
      "dot": "emerald",
      "title": "基础设施与依赖",
      "items": [
        "各服务经 Nacos 注册发现；共享 MySQL / Redis 的逻辑职责详见独立基础设施图与详细文档。"
      ]
    },
    {
      "dot": "amber",
      "title": "当前范围",
      "items": [
        "设备分区消费者只在 device，WebSocket 连接与 Pub/Sub 监听只在 realtime。"
      ]
    }
  ]
}
