diff --git a/docs/index.md b/docs/index.md index b79e7d1..55fe86f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -23,9 +23,10 @@ │ └── {config_name}.json # 各 mod 的配置 ├── public/ # 静态资源(图标、图片等) ├── src/ -│ ├── app/ # Next.js App Router(页面、布局) +│ ├── app/ # Next.js App Router(页面、布局、tRPC Route Handler) │ ├── components/ # 可复用 UI 组件 -│ ├── lib/ # 后端逻辑(与前端直接调用,不创建 API Route) +│ ├── lib/ # 纯后端逻辑,无 React 依赖 +│ ├── services/ # 业务编排层(Server Actions + tRPC Router) │ └── types/ # TypeScript 类型定义 ├── docs/ # 本文档 ├── package.json @@ -47,9 +48,10 @@ | 目录 | 职责 | |------|------| -| `app/` | Next.js App Router 页面与布局 | +| `app/` | Next.js App Router 页面与布局,以及唯一的 tRPC Route Handler | | `components/` | 可复用的 Ant Design 组件 | -| `lib/` | 纯后端逻辑(读取配置、调用 API、模板解析等),可供前端直接引用 | +| `lib/` | 纯后端逻辑(平台 API 请求、模板解析、工具函数),无 React 依赖 | +| `services/` | 业务编排层,注入全局 client 单例,通过 Server Actions 暴露给前端或 tRPC Router 调用 | | `types/` | TypeScript 类型/接口定义,使用 Zod schema 统一校验并导出类型 | ### 代码质量