games-development-ai/docs/architecture/assets/02-六层技术分层总图.svg
zizi f9d6baa5f4 docs(arch-atlas): 总图叙 apex 系统全景图说——第一期收口(导览式·7系统级图+七领域导航)
读一份文档完成整个系统了解+据图 review:§2 七张跨域系统级图(六域生命周期/六层分层/
现行SAA线‖远期tier2轨边界/跨域数据飞轮/失败降级补偿全景/端到端鉴权信任边界/角色×端)+
§3 领域导航(每域讲什么故事+最该据图review的命门缝+链接)+§4 按角色下钻路径。
单源只链不重画;6 SVG 经脚本核良构/零溢出/脚注转义;9 源档 commit hash 防漂移门;
现行vs远期严格标(tier2远期待spike虚线/Dify废/网关双校验未来态)。
第一期=总图叙+7域图说(运维/产品/架构/沙箱/后端/前端/运营)全收口。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 12:35:15 +00:00

121 lines
9.9 KiB
XML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1480 820" font-family="-apple-system,'PingFang SC','Microsoft YaHei',Segoe UI,sans-serif">
<defs>
<marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="3" orient="auto" markerUnits="strokeWidth"><path d="M0,0 L8,3 L0,6 Z" fill="#334155"/></marker>
<style>
.t{fill:#0f172a}.mut{fill:#475569}.sm{font-size:12px}.xs{font-size:11px}.xxs{font-size:10px}
.h1{font-size:24px;font-weight:700}.h2{font-size:14px;font-weight:700}.lbl{font-size:13px;font-weight:600}
.flow{stroke:#334155;stroke-width:2;fill:none}.flowb{stroke:#64748b;stroke-width:1.6;fill:none;stroke-dasharray:6 4}
.badge{font-size:10.5px;font-weight:700}.fut{font-size:10px;font-weight:700;fill:#b45309}
</style>
</defs>
<rect x="0" y="0" width="1480" height="820" fill="#f8fafc"/>
<text x="40" y="38" class="t h1">图 2 · 六层技术分层总图</text>
<text x="40" y="58" class="mut sm">系统级权威分层视图:用户从浏览器进来,自上而下穿过六层 + 一条旁路可观测。这是 architecture/README §1 那张分层图的高保真升版,带生产维度徽章与 future-state 诚实标注。</text>
<!-- 状态约定条 -->
<rect x="40" y="76" width="1400" height="32" rx="8" fill="#fffbeb" stroke="#d97706" stroke-width="1.4" stroke-dasharray="7 5"/>
<text x="52" y="97" class="xs t" font-weight="700">状态约定:</text>
<text x="128" y="97" class="xs mut">实心块 = 现行已部署;虚线框 + 「future」= 框架自带依赖但 MVP 运行时未启动(Nacos / RocketMQ),凡涉异步 MQ / 服务注册的设计一律按"进程内调用 / 本地配置"折算。</text>
<!-- 主栈区 -->
<!-- 接入层 -->
<rect x="40" y="124" width="1080" height="56" rx="10" fill="#e0f2fe" stroke="#0284c7" stroke-width="1.6"/>
<text x="56" y="147" class="t lbl">① 接入层 — 把请求接进来</text>
<text x="56" y="167" class="xs mut">CDN(静态资源 / 游戏包加速)· Nginx(前端托管 / SSL 终结)</text>
<!-- 前端应用 -->
<rect x="40" y="190" width="1080" height="56" rx="10" fill="#f5f3ff" stroke="#7c3aed" stroke-width="1.6"/>
<text x="56" y="213" class="t lbl">前端应用 — 用户看到的界面</text>
<text x="56" y="233" class="xs mut">game-studio(Vue3 + Vant · 创作者 + 玩家) | game-admin(Vue3 + Element Plus · 运营 + 管理员)</text>
<!-- 网关层 -->
<rect x="40" y="256" width="1080" height="50" rx="10" fill="#f1f5f9" stroke="#475569" stroke-width="1.6"/>
<text x="56" y="278" class="t lbl">② 网关层 — 统一入口</text>
<text x="56" y="296" class="xs mut">Spring Cloud Gateway:路由 / 限流 / 鉴权软转发 / 灰度MVP 单体下软转发,权限强制在服务侧单点,详见图 6</text>
<!-- 业务服务层 -->
<rect x="40" y="316" width="1080" height="76" rx="10" fill="#fefce8" stroke="#ca8a04" stroke-width="1.8"/>
<text x="56" y="338" class="t lbl">③ 业务服务层 — 13 个游戏业务模块(jar 聚合进 Huijing 单体)</text>
<text x="56" y="360" class="xs mut">studio · project · aigc · runtime · feed · telemetry · pay · trade · community · ip · compliance · biz · ad</text>
<text x="56" y="380" class="xxs mut">四簇:创作链路 分发与数据 变现链路 平台与合规13 模块聚类与依赖见架构图说,不在此重画)</text>
<!-- 基座层 + AI 生成层 并列 -->
<rect x="40" y="402" width="528" height="96" rx="10" fill="#ecfdf5" stroke="#059669" stroke-width="1.6"/>
<text x="56" y="424" class="t lbl">④ 基础设施层 — Huijing 原生开箱即用</text>
<text x="56" y="446" class="xs mut">system 用户 / 权限 / OAuth2</text>
<text x="56" y="464" class="xs mut">infra 文件 / 任务 / 日志 · bpm 工作流</text>
<text x="56" y="486" class="xxs t" font-weight="700">复用现成 60% 后台能力,不自研</text>
<rect x="592" y="402" width="528" height="96" rx="10" fill="#eff6ff" stroke="#2563eb" stroke-width="1.8"/>
<text x="608" y="424" class="t lbl">⑤ AI 生成层 — 现行生成主线</text>
<text x="608" y="446" class="xs mut">SAA 裸图编排16 节点)→ new-api 网关OpenAI 兼容)</text>
<text x="608" y="464" class="xs mut">→ 便宜 LLMDeepSeek / MiniMax→ 九门兜底</text>
<text x="608" y="486" class="xxs t" font-weight="700">LittleJS + Runner v2 引擎 / 插件库(深度见生成引擎子树)</text>
<!-- 中间件层 -->
<rect x="40" y="508" width="1080" height="92" rx="10" fill="#f8fafc" stroke="#334155" stroke-width="1.8"/>
<text x="56" y="530" class="t lbl">⑥ 中间件层 — 数据与存储</text>
<rect x="56" y="540" width="200" height="46" rx="7" fill="#fff" stroke="#475569" stroke-width="1.3"/>
<text x="66" y="560" class="xs t">MySQL 8.0</text>
<text x="66" y="578" class="xxs mut">业务实体 / 事务一致</text>
<rect x="268" y="540" width="200" height="46" rx="7" fill="#fff" stroke="#475569" stroke-width="1.3"/>
<text x="278" y="560" class="xs t">Redis 7</text>
<text x="278" y="578" class="xxs mut">候选集 / 幂等去重</text>
<rect x="480" y="540" width="200" height="46" rx="7" fill="#fff" stroke="#475569" stroke-width="1.3"/>
<text x="490" y="560" class="xs t">MinIO / 阿里云 OSS</text>
<text x="490" y="578" class="xxs mut">游戏包 / 素材 / 封面</text>
<!-- future-state -->
<rect x="692" y="540" width="416" height="46" rx="7" fill="#fff7ed" stroke="#d97706" stroke-width="1.4" stroke-dasharray="6 4"/>
<text x="702" y="560" class="xs t">Nacos · RocketMQ</text>
<text x="702" y="578" class="xxs mut">框架自带 · MVP 未部署 broker / registry · 异步与注册按进程内折算</text>
<text x="1050" y="560" class="fut">future</text>
<!-- 旁路可观测层 -->
<rect x="1148" y="124" width="292" height="476" rx="12" fill="#f1f5f9" stroke="#0ea5e9" stroke-width="2" stroke-dasharray="6 4"/>
<text x="1164" y="148" class="t h2">旁路 · 可观测性层</text>
<text x="1290" y="148" class="fut"></text>
<text x="1164" y="172" class="xs mut">不在主链路上,横向旁路监控</text>
<rect x="1164" y="186" width="260" height="40" rx="6" fill="#dcfce7" stroke="#16a34a" stroke-width="1.4"/>
<text x="1174" y="204" class="xs t">已在:SAA 节点 observation</text>
<text x="1174" y="218" class="xxs mut">每节点一条 Micrometer span</text>
<rect x="1164" y="234" width="260" height="124" rx="6" fill="#fff7ed" stroke="#d97706" stroke-width="1.4" stroke-dasharray="6 4"/>
<text x="1174" y="254" class="xs t" font-weight="700">待接线(设计已出·未接码):</text>
<text x="1174" y="274" class="xs mut">OTel 统一采集 → Collector</text>
<text x="1174" y="292" class="xs mut">Prometheus指标</text>
<text x="1174" y="310" class="xs mut">Grafana+ 夜莺(告警)</text>
<text x="1174" y="328" class="xs mut">Sentry / Tempo / Loki选型待定</text>
<text x="1174" y="348" class="xxs mut">admin 观测入口整套新建</text>
<text x="1164" y="382" class="xxs t" font-weight="700">旁路铁律:观测栈挂掉,</text>
<text x="1164" y="400" class="xxs t" font-weight="700">绝不影响被观测的服务。</text>
<text x="1164" y="424" class="xxs mut">落地态全貌见运维图说图 6;</text>
<text x="1164" y="442" class="xxs mut">本图只标"接"这个状态分界。</text>
<line x1="1144" y1="362" x2="1146" y2="362" class="flowb"/>
<line x1="1120" y1="362" x2="1146" y2="362" class="flowb" marker-end="url(#arrow)"/>
<text x="1124" y="356" class="xxs mut">采集</text>
<!-- 主栈纵向流箭头 -->
<line x1="580" y1="180" x2="580" y2="188" class="flow" marker-end="url(#arrow)"/>
<line x1="580" y1="246" x2="580" y2="254" class="flow" marker-end="url(#arrow)"/>
<line x1="580" y1="306" x2="580" y2="314" class="flow" marker-end="url(#arrow)"/>
<line x1="300" y1="392" x2="300" y2="400" class="flow" marker-end="url(#arrow)"/>
<line x1="856" y1="392" x2="856" y2="400" class="flow" marker-end="url(#arrow)"/>
<line x1="580" y1="498" x2="580" y2="506" class="flow" marker-end="url(#arrow)"/>
<!-- 贯穿取向带 -->
<rect x="40" y="616" width="1400" height="58" rx="12" fill="#f0fdf4" stroke="#16a34a" stroke-width="1.6"/>
<text x="56" y="640" class="t h2" fill="#15803d">贯穿始终的设计取向:先简后扩、能复用就不自研。</text>
<text x="56" y="662" class="xs mut">后端复用 Huijing 现成 60% 后台能力、生成不自研大模型而接通用模型、引擎不自研而用成熟 LittleJS——这条取向直接决定了系统能用很小的团队建议 5 人)与很低的成本(约 ¥4,300/月、上限 &lt; ¥5,000/月)跑起来,同时为单体平滑长成微服务预留路径。</text>
<!-- 图例 -->
<text x="40" y="710" class="t h2">图例:</text>
<rect x="120" y="696" width="34" height="20" rx="5" fill="#ffffff" stroke="#475569" stroke-width="1.8"/><text x="162" y="711" class="t xs">现行已部署层</text>
<rect x="280" y="696" width="34" height="20" rx="5" fill="#fff7ed" stroke="#d97706" stroke-width="1.8" stroke-dasharray="6 4"/><text x="322" y="711" class="t xs">future / 接(未部署·未接码)</text>
<line x1="540" y1="706" x2="590" y2="706" class="flow" marker-end="url(#arrow)"/><text x="598" y="710" class="t xs">请求自上而下穿层</text>
<g class="badge"><rect x="760" y="697" width="56" height="18" rx="3" fill="#16a34a"/><text x="765" y="710" fill="#fff">成本</text>
<rect x="824" y="697" width="56" height="18" rx="3" fill="#0ea5e9"/><text x="829" y="710" fill="#fff">可观测</text>
<rect x="888" y="697" width="56" height="18" rx="3" fill="#7c3aed"/><text x="893" y="710" fill="#fff">伸缩</text></g>
<text x="954" y="710" class="mut xs">复用不自研=成本 · 旁路监控=可观测 · 单体长成微服务=伸缩</text>
<text x="40" y="748" class="mut xs">映射:architecture/架构/README §1六层分层+ §2.5future-state 折算)| 状态:现(含 future-state 标注)| 设计变动须同步本图</text>
</svg>