{
  "schema_version": 1,
  "diagram_type": "architecture",
  "meta": {
    "title": "剑的 AI 实验室｜系统架构",
    "locale": "zh-CN",
    "output": "jian-ai-lab.architecture.html",
    "quality_profile": "showcase",
    "viewBox": [1380, 860],
    "views": [
      {
        "id": "visitor-path",
        "label": "访客主路径",
        "focus": ["visitor", "cloudflare_edge", "site_ui", "community_api", "d1"],
        "note": "从公开域名进入网站，再到社区记录的持久化数据。"
      },
      {
        "id": "identity-media",
        "label": "身份与媒体",
        "focus": ["site_ui", "turnstile", "community_api", "supabase_auth", "r2"],
        "note": "查看注册验证、访问令牌和实验媒体保存路径。"
      },
      {
        "id": "discovery-publish",
        "label": "发现与发布",
        "focus": ["sites_pipeline", "site_ui", "project_content", "github_sources", "radar_repo"],
        "note": "查看网站版本发布和每日 GitHub 项目收录链路。"
      }
    ]
  },
  "components": [
    {
      "id": "visitor",
      "type": "external",
      "label": "访客与实验者",
      "sublabel": "浏览器",
      "pos": [40, 354],
      "size": [150, 72]
    },
    {
      "id": "cloudflare_edge",
      "type": "cloud",
      "label": "jianailab.com",
      "sublabel": "Cloudflare DNS / HTTPS",
      "pos": [250, 354],
      "size": [170, 72]
    },
    {
      "id": "site_ui",
      "type": "frontend",
      "label": "网站界面",
      "sublabel": "Next.js / React / Vinext",
      "pos": [500, 354],
      "size": [190, 72]
    },
    {
      "id": "community_api",
      "type": "backend",
      "label": "社区与实验 API",
      "sublabel": "Cloudflare Worker 路由",
      "pos": [780, 354],
      "size": [190, 72]
    },
    {
      "id": "d1",
      "type": "database",
      "label": "D1 数据库",
      "sublabel": "用户 / 项目 / 实验 / 互动",
      "pos": [1060, 270],
      "size": [190, 72]
    },
    {
      "id": "r2",
      "type": "cloud",
      "label": "R2 媒体存储",
      "sublabel": "图片 / 音频 / 视频",
      "pos": [1060, 448],
      "size": [190, 72]
    },
    {
      "id": "turnstile",
      "type": "security",
      "label": "Cloudflare Turnstile",
      "sublabel": "注册与登录人机验证",
      "pos": [500, 108],
      "size": [190, 72]
    },
    {
      "id": "supabase_auth",
      "type": "security",
      "label": "Supabase Auth",
      "sublabel": "邮箱身份与访问令牌",
      "pos": [780, 108],
      "size": [190, 72]
    },
    {
      "id": "sites_pipeline",
      "type": "cloud",
      "label": "ChatGPT Sites",
      "sublabel": "源码版本与公开部署",
      "pos": [250, 108],
      "size": [170, 72]
    },
    {
      "id": "project_content",
      "type": "backend",
      "label": "项目档案与官方动态",
      "sublabel": "项目库 / 竞技场数据",
      "pos": [500, 618],
      "size": [190, 72]
    },
    {
      "id": "github_sources",
      "type": "external",
      "label": "GitHub 原仓库",
      "sublabel": "README / 版本 / 许可证",
      "pos": [780, 618],
      "size": [190, 72]
    },
    {
      "id": "radar_repo",
      "type": "external",
      "label": "Jian AI Lab Radar",
      "sublabel": "公开每日收录档案",
      "pos": [1060, 734],
      "size": [190, 72]
    }
  ],
  "connections": [
    {
      "id": "visitor-to-edge",
      "from": "visitor",
      "to": "cloudflare_edge",
      "label": "HTTPS",
      "variant": "emphasis"
    },
    {
      "id": "edge-to-ui",
      "from": "cloudflare_edge",
      "to": "site_ui",
      "label": "访问公开页面",
      "variant": "emphasis"
    },
    {
      "id": "ui-to-api",
      "from": "site_ui",
      "to": "community_api",
      "label": "实验与社区请求",
      "variant": "emphasis"
    },
    {
      "id": "api-to-d1",
      "from": "community_api",
      "to": "d1",
      "label": "读写结构化记录"
    },
    {
      "id": "api-to-r2",
      "from": "community_api",
      "to": "r2",
      "label": "上传与读取媒体"
    },
    {
      "id": "ui-to-turnstile",
      "from": "site_ui",
      "to": "turnstile",
      "label": "发起人机验证",
      "variant": "security",
      "labelAt": [672, 286]
    },
    {
      "id": "api-to-supabase",
      "from": "community_api",
      "to": "supabase_auth",
      "label": "验证访问令牌",
      "variant": "security"
    },
    {
      "id": "sites-to-ui",
      "from": "sites_pipeline",
      "to": "site_ui",
      "label": "发布已验证版本",
      "variant": "dashed",
      "fromSide": "bottom",
      "toSide": "top",
      "via": [[335, 224], [595, 224]]
    },
    {
      "id": "ui-to-project-content",
      "from": "site_ui",
      "to": "project_content",
      "label": "读取项目档案",
      "labelAt": [595, 520]
    },
    {
      "id": "content-to-github",
      "from": "project_content",
      "to": "github_sources",
      "label": "核验官方资料",
      "variant": "dashed"
    },
    {
      "id": "content-to-radar",
      "from": "project_content",
      "to": "radar_repo",
      "label": "同步每日收录",
      "variant": "dashed",
      "fromSide": "bottom",
      "toSide": "left",
      "via": [[595, 742], [1018, 742], [1018, 770]],
      "labelAt": [800, 728]
    }
  ],
  "cards": [
    {
      "dot": "cyan",
      "title": "公开访问",
      "items": [
        "自定义域名进入 Next.js / React 网站",
        "项目库、竞技场、实验田和收成区共用一套界面"
      ]
    },
    {
      "dot": "emerald",
      "title": "社区数据",
      "items": [
        "D1 保存结构化记录，R2 保存实验媒体",
        "Supabase Auth 提供邮箱身份和访问令牌"
      ]
    },
    {
      "dot": "violet",
      "title": "项目发现",
      "items": [
        "GitHub 官方资料是事实来源",
        "每日核验结果同步进入网站与公开 Radar 仓库"
      ]
    }
  ]
}
