Files
xk-docs/docs/projects/xk-admin/architecture.md
2026-07-08 15:04:42 +08:00

56 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
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.
# xk-admin 基类架构
## 技术架构
```mermaid
graph TB
subgraph Monorepo
APP[apps/web-antd<br/>主应用]
INT[internal/<br/>内部共享包]
PKG[packages/<br/>共享工作区包]
PLAY[playground/<br/>开发调试]
end
subgraph 主应用 web-antd
MAIN[main.ts] --> VUE[Vue 3 App]
VUE --> ROUTER[Vue Router]
VUE --> PINIA[Pinia Store]
VUE --> UI[Ant Design Vue]
ROUTER --> VIEWS[views/*]
VIEWS --> API[api/*]
API --> HTTP[axios]
end
HTTP --> BACKEND[xk-api<br/>后端 API]
```
## 目录结构
| 目录 | 说明 |
|------|------|
| `adapter/` | API 适配器,统一请求格式 |
| `api/` | API 接口定义,按模块组织 |
| `components/` | 共享 Vue 组件 |
| `composables/` | Vue Composition API 复用逻辑 |
| `layouts/` | 页面布局(侧边栏、顶栏、内容区) |
| `locales/` | 国际化资源文件 |
| `router/` | 路由配置和守卫 |
| `store/` | Pinia 状态管理 |
| `views/` | 页面视图,按模块组织 |
| `utils/` | 工具函数 |
## 构建工具
- **Vite**: 开发服务器和构建
- **Turborepo**: Monorepo 任务编排和缓存
- **pnpm**: 包管理workspace 协议)
- **TypeScript**: 类型检查
## 开发命令
```bash
pnpm dev # 启动开发服务器
pnpm build # 生产构建
pnpm lint # 代码检查
```