|
|
@@ -3,254 +3,406 @@
|
|
|
## 版本信息
|
|
|
| 版本 | 日期 | 描述 | 作者 |
|
|
|
|------|------|------|------|
|
|
|
+| 3.3 | 2025-12-26 | 更新完整项目结构,包含allin-packages和mini-ui-packages | James |
|
|
|
| 3.2 | 2025-11-11 | 更新包结构,添加基础设施和业务模块包 | Winston |
|
|
|
| 3.1 | 2025-11-09 | 更新测试结构,清理重复测试文件 | James |
|
|
|
| 3.0 | 2025-10-22 | 更新为 monorepo 结构,添加 packages/server | Winston |
|
|
|
|
|
|
## 实际项目结构
|
|
|
```text
|
|
|
-d8d-mini-starter/
|
|
|
-├── mini/ # 小程序项目 (Taro + React)
|
|
|
+188-179-template-6/
|
|
|
+├── .bmad-core/ # BMad框架配置目录
|
|
|
+│ ├── agents/ # 代理配置
|
|
|
+│ ├── agent-teams/ # 团队配置
|
|
|
+│ ├── checklists/ # 检查清单
|
|
|
+│ ├── data/ # 知识库数据
|
|
|
+│ ├── tasks/ # 任务定义
|
|
|
+│ ├── templates/ # 模板文件
|
|
|
+│ ├── workflows/ # 工作流定义
|
|
|
+│ └── core-config.yaml # 核心配置文件
|
|
|
+├── .claude/ # Claude CLI配置
|
|
|
+│ └── commands/ # Claude命令定义
|
|
|
+├── .gitea/ # Gitea配置
|
|
|
+├── .github/ # GitHub Actions配置
|
|
|
+│ └── workflows/ # CI/CD工作流
|
|
|
+├── .git/ # Git版本控制
|
|
|
+├── allin-packages/ # AllIn业务包目录
|
|
|
+│ ├── channel-module/ # 渠道管理模块
|
|
|
+│ ├── channel-management-ui/ # 渠道管理UI
|
|
|
+│ ├── company-module/ # 企业管理模块
|
|
|
+│ ├── company-management-ui/ # 企业管理UI
|
|
|
+│ ├── disability-module/ # 残疾人管理模块
|
|
|
+│ ├── disability-person-management-ui/ # 残疾人个人管理UI
|
|
|
+│ ├── enums/ # 枚举类型包
|
|
|
+│ ├── order-module/ # 订单管理模块
|
|
|
+│ ├── order-management-ui/ # 订单管理UI
|
|
|
+│ ├── platform-module/ # 平台管理模块
|
|
|
+│ ├── platform-management-ui/ # 平台管理UI
|
|
|
+│ ├── salary-module/ # 薪资管理模块
|
|
|
+│ ├── salary-management-ui/ # 薪资管理UI
|
|
|
+│ └── statistics-module/ # 统计模块
|
|
|
+├── docs/ # 项目文档目录
|
|
|
+│ ├── architecture/ # 架构文档(分片)
|
|
|
+│ │ ├── coding-standards.md # 编码标准和测试策略
|
|
|
+│ │ ├── source-tree.md # 源码树和文件组织(本文件)
|
|
|
+│ │ ├── tech-stack.md # 技术栈
|
|
|
+│ │ └── ui-package-standards.md # UI包开发规范
|
|
|
+│ ├── prd/ # 产品需求文档(分片)
|
|
|
+│ ├── qa/ # QA文档
|
|
|
+│ ├── stories/ # 用户故事文档
|
|
|
+│ └── *.md # 其他项目文档
|
|
|
+├── mini/ # 商户小程序项目 (Taro + React)
|
|
|
│ ├── src/
|
|
|
-│ │ ├── app.tsx # 小程序入口
|
|
|
-│ │ ├── app.config.ts # 小程序配置
|
|
|
-│ │ ├── api.ts # API客户端
|
|
|
+│ │ ├── app.tsx # 小程序入口
|
|
|
+│ │ ├── app.config.ts # 小程序配置
|
|
|
+│ │ ├── api.ts # API客户端
|
|
|
│ │ ├── components/
|
|
|
-│ │ │ └── ui/ # UI组件库
|
|
|
-│ │ │ ├── avatar-upload.tsx # 头像上传组件
|
|
|
-│ │ │ ├── button.tsx # 按钮组件
|
|
|
-│ │ │ ├── card.tsx # 卡片组件
|
|
|
-│ │ │ ├── form.tsx # 表单组件
|
|
|
-│ │ │ ├── image.tsx # 图片组件
|
|
|
-│ │ │ ├── input.tsx # 输入框组件
|
|
|
-│ │ │ ├── label.tsx # 标签组件
|
|
|
-│ │ │ ├── navbar.tsx # 导航栏组件
|
|
|
-│ │ │ └── tab-bar.tsx # 标签栏组件
|
|
|
+│ │ │ └── ui/ # UI组件库
|
|
|
+│ │ │ ├── avatar-upload.tsx # 头像上传组件
|
|
|
+│ │ │ ├── button.tsx # 按钮组件
|
|
|
+│ │ │ ├── card.tsx # 卡片组件
|
|
|
+│ │ │ ├── form.tsx # 表单组件
|
|
|
+│ │ │ ├── image.tsx # 图片组件
|
|
|
+│ │ │ ├── input.tsx # 输入框组件
|
|
|
+│ │ │ ├── label.tsx # 标签组件
|
|
|
+│ │ │ ├── navbar.tsx # 导航栏组件
|
|
|
+│ │ │ └── tab-bar.tsx # 标签栏组件
|
|
|
│ │ ├── layouts/
|
|
|
-│ │ │ └── tab-bar-layout.tsx # 标签栏布局
|
|
|
+│ │ │ └── tab-bar-layout.tsx # 标签栏布局
|
|
|
│ │ ├── pages/
|
|
|
-│ │ │ ├── explore/ # 探索页面
|
|
|
+│ │ │ ├── explore/ # 探索页面
|
|
|
│ │ │ │ ├── index.tsx
|
|
|
│ │ │ │ └── index.config.ts
|
|
|
-│ │ │ ├── index/ # 首页
|
|
|
+│ │ │ ├── index/ # 首页
|
|
|
│ │ │ │ ├── index.tsx
|
|
|
│ │ │ │ └── index.config.ts
|
|
|
-│ │ │ ├── login/ # 登录页面
|
|
|
+│ │ │ ├── login/ # 登录页面
|
|
|
│ │ │ │ ├── index.tsx
|
|
|
│ │ │ │ ├── index.config.ts
|
|
|
-│ │ │ │ └── wechat-login.tsx # 微信登录
|
|
|
-│ │ │ ├── profile/ # 个人资料
|
|
|
+│ │ │ │ └── wechat-login.tsx # 微信登录
|
|
|
+│ │ │ ├── profile/ # 个人资料
|
|
|
│ │ │ │ ├── index.tsx
|
|
|
│ │ │ │ └── index.config.ts
|
|
|
-│ │ │ └── register/ # 注册页面
|
|
|
+│ │ │ └── register/ # 注册页面
|
|
|
│ │ │ ├── index.tsx
|
|
|
│ │ │ └── index.config.ts
|
|
|
-│ │ ├── schemas/ # 验证模式
|
|
|
-│ │ └── utils/ # 工具函数
|
|
|
+│ │ ├── schemas/ # 验证模式
|
|
|
+│ │ └── utils/ # 工具函数
|
|
|
│ ├── config/
|
|
|
-│ │ ├── dev.ts # 开发环境配置
|
|
|
-│ │ ├── index.ts # 配置入口
|
|
|
-│ │ └── prod.ts # 生产环境配置
|
|
|
+│ │ ├── dev.ts # 开发环境配置
|
|
|
+│ │ ├── index.ts # 配置入口
|
|
|
+│ │ └── prod.ts # 生产环境配置
|
|
|
+│ ├── tests/ # 测试文件
|
|
|
+│ ├── dist/ # 构建输出
|
|
|
│ └── package.json
|
|
|
-├── packages/ # 共享包
|
|
|
-│ ├── server/ # API服务器包 (@d8d/server) - 重构后
|
|
|
-│ │ ├── src/
|
|
|
-│ │ │ ├── api.ts # API路由导出
|
|
|
-│ │ │ └── index.ts # 服务器入口
|
|
|
-│ │ ├── tests/
|
|
|
-│ │ └── package.json
|
|
|
-│ ├── shared-types/ # 共享类型定义 (@d8d/shared-types)
|
|
|
-│ │ ├── src/
|
|
|
-│ │ │ └── index.ts # 类型定义导出
|
|
|
-│ │ └── package.json
|
|
|
-│ ├── shared-utils/ # 共享工具函数 (@d8d/shared-utils)
|
|
|
+├── mini-talent/ # 人才小程序项目 (Taro + React)
|
|
|
+│ ├── src/ # 源代码
|
|
|
+│ ├── tests/ # 测试文件
|
|
|
+│ └── package.json
|
|
|
+├── mini-ui-packages/ # 小程序UI组件包目录
|
|
|
+│ ├── mini-charts/ # 小程序图表组件
|
|
|
+│ ├── mini-enterprise-auth-ui/ # 企业认证UI
|
|
|
+│ ├── mini-shared-ui-components/ # 共享UI组件
|
|
|
+│ ├── mini-testing-utils/ # 测试工具
|
|
|
+│ ├── rencai-attendance-ui/ # 人才考勤UI
|
|
|
+│ ├── rencai-auth-ui/ # 人才认证UI
|
|
|
+│ ├── rencai-dashboard-ui/ # 人才仪表盘UI
|
|
|
+│ ├── rencai-employment-ui/ # 人才就业UI
|
|
|
+│ ├── rencai-personal-info-ui/ # 人才个人信息UI
|
|
|
+│ ├── rencai-settings-ui/ # 人才设置UI
|
|
|
+│ ├── rencai-shared-ui/ # 人才共享UI
|
|
|
+│ ├── yongren-dashboard-ui/ # 用人仪表盘UI
|
|
|
+│ ├── yongren-order-management-ui/ # 用人订单管理UI
|
|
|
+│ ├── yongren-settings-ui/ # 用人设置UI
|
|
|
+│ ├── yongren-shared-ui/ # 用人共享UI
|
|
|
+│ ├── yongren-statistics-ui/ # 用人统计UI
|
|
|
+│ └── yongren-talent-management-ui/ # 用人人才管理UI
|
|
|
+├── packages/ # 核心共享包目录
|
|
|
+│ # ==================== UI管理包 ====================
|
|
|
+│ ├── advertisement-management-ui/ # 广告管理UI
|
|
|
+│ ├── advertisement-type-management-ui/ # 广告类型管理UI
|
|
|
+│ ├── area-management-ui/ # 区域管理UI
|
|
|
+│ ├── auth-management-ui/ # 认证管理UI
|
|
|
+│ ├── bank-name-management-ui/ # 银行名称管理UI
|
|
|
+│ ├── delivery-address-management-ui/ # 收货地址管理UI
|
|
|
+│ ├── file-management-ui/ # 文件管理UI
|
|
|
+│ ├── goods-category-management-ui/ # 商品类别管理UI
|
|
|
+│ ├── goods-management-ui/ # 商品管理UI
|
|
|
+│ ├── merchant-management-ui/ # 商户管理UI
|
|
|
+│ ├── order-management-ui/ # 订单管理UI
|
|
|
+│ ├── supplier-management-ui/ # 供应商管理UI
|
|
|
+│ ├── user-management-ui/ # 用户管理UI
|
|
|
+│ # 多租户版本
|
|
|
+│ ├── advertisement-management-ui-mt/ # 广告管理UI(多租户)
|
|
|
+│ ├── advertisement-type-management-ui-mt/ # 广告类型管理UI(多租户)
|
|
|
+│ ├── area-management-ui-mt/ # 区域管理UI(多租户)
|
|
|
+│ ├── auth-management-ui-mt/ # 认证管理UI(多租户)
|
|
|
+│ ├── bank-name-management-ui-mt/ # 银行名称管理UI(多租户)
|
|
|
+│ ├── delivery-address-management-ui-mt/ # 收货地址管理UI(多租户)
|
|
|
+│ ├── file-management-ui-mt/ # 文件管理UI(多租户)
|
|
|
+│ ├── goods-category-management-ui-mt/ # 商品类别管理UI(多租户)
|
|
|
+│ ├── goods-management-ui-mt/ # 商品管理UI(多租户)
|
|
|
+│ ├── merchant-management-ui-mt/ # 商户管理UI(多租户)
|
|
|
+│ ├── order-management-ui-mt/ # 订单管理UI(多租户)
|
|
|
+│ ├── supplier-management-ui-mt/ # 供应商管理UI(多租户)
|
|
|
+│ └── user-management-ui-mt/ # 用户管理UI(多租户)
|
|
|
+│ # ==================== 业务模块包 ====================
|
|
|
+│ ├── advertisements-module/ # 广告模块
|
|
|
+│ ├── auth-module/ # 认证模块
|
|
|
│ │ ├── src/
|
|
|
-│ │ │ ├── utils/
|
|
|
-│ │ │ │ ├── jwt.util.ts # JWT工具
|
|
|
-│ │ │ │ ├── errorHandler.ts # 错误处理
|
|
|
-│ │ │ │ ├── parseWithAwait.ts # 异步解析
|
|
|
-│ │ │ │ ├── logger.ts # 日志工具
|
|
|
-│ │ │ │ └── redis.util.ts # Redis会话管理
|
|
|
-│ │ │ └── data-source.ts # 数据库连接
|
|
|
+│ │ │ ├── services/
|
|
|
+│ │ │ │ ├── auth.service.ts # 认证服务
|
|
|
+│ │ │ │ └── mini-auth.service.ts # 小程序认证服务
|
|
|
+│ │ │ ├── schemas/
|
|
|
+│ │ │ │ └── auth.schema.ts # 认证Schema
|
|
|
+│ │ │ ├── routes/
|
|
|
+│ │ │ │ ├── login.route.ts # 登录路由
|
|
|
+│ │ │ │ ├── register.route.ts # 注册路由
|
|
|
+│ │ │ │ ├── mini-login.route.ts # 小程序登录路由
|
|
|
+│ │ │ │ ├── phone-decrypt.route.ts # 手机号解密路由
|
|
|
+│ │ │ │ ├── me.route.ts # 获取用户信息路由
|
|
|
+│ │ │ │ ├── update-me.route.ts # 更新用户信息路由
|
|
|
+│ │ │ │ ├── logout.route.ts # 登出路由
|
|
|
+│ │ │ │ └── sso-verify.route.ts # SSO验证路由
|
|
|
+│ │ │ └── middleware/
|
|
|
+│ │ │ ├── auth.middleware.ts # 认证中间件
|
|
|
+│ │ │ └── index.ts # 中间件导出
|
|
|
│ │ ├── tests/
|
|
|
│ │ └── package.json
|
|
|
-│ ├── shared-crud/ # 通用CRUD基础设施 (@d8d/shared-crud)
|
|
|
+│ ├── bank-names-module/ # 银行名称模块
|
|
|
+│ ├── delivery-address-module/ # 收货地址模块
|
|
|
+│ ├── file-module/ # 文件管理模块
|
|
|
│ │ ├── src/
|
|
|
+│ │ │ ├── entities/
|
|
|
+│ │ │ │ └── file.entity.ts # 文件实体
|
|
|
│ │ │ ├── services/
|
|
|
-│ │ │ │ ├── generic-crud.service.ts # 通用CRUD服务
|
|
|
-│ │ │ │ └── concrete-crud.service.ts # 具体CRUD服务
|
|
|
+│ │ │ │ ├── file.service.ts # 文件服务
|
|
|
+│ │ │ │ └── minio.service.ts # MinIO服务
|
|
|
+│ │ │ ├── schemas/
|
|
|
+│ │ │ │ └── file.schema.ts # 文件Schema
|
|
|
│ │ │ └── routes/
|
|
|
-│ │ │ └── generic-crud.routes.ts # 通用CRUD路由
|
|
|
+│ │ │ ├── upload-policy/post.ts # 上传策略路由
|
|
|
+│ │ │ ├── multipart-policy/post.ts # 多部分上传策略路由
|
|
|
+│ │ │ ├── multipart-complete/post.ts # 完成多部分上传路由
|
|
|
+│ │ │ └── [id]/
|
|
|
+│ │ │ ├── get.ts # 获取文件详情路由
|
|
|
+│ │ │ ├── get-url.ts # 获取文件URL路由
|
|
|
+│ │ │ ├── download.ts # 文件下载路由
|
|
|
+│ │ │ └── delete.ts # 删除文件路由
|
|
|
│ │ ├── tests/
|
|
|
│ │ └── package.json
|
|
|
-│ ├── shared-test-util/ # 测试基础设施 (@d8d/shared-test-util)
|
|
|
+│ ├── geo-areas/ # 地理区域模块
|
|
|
│ │ ├── src/
|
|
|
-│ │ │ ├── integration-test-db.ts # 集成测试数据库工具
|
|
|
-│ │ │ ├── integration-test-utils.ts # 集成测试断言工具
|
|
|
+│ │ │ ├── modules/areas/
|
|
|
+│ │ │ │ ├── area.entity.ts # 地区实体
|
|
|
+│ │ │ │ ├── area.service.ts # 地区服务
|
|
|
+│ │ │ │ └── area.schema.ts # 地区Schema
|
|
|
+│ │ │ ├── api/
|
|
|
+│ │ │ │ ├── areas/index.ts # 公共地区API
|
|
|
+│ │ │ │ └── admin/areas/index.ts # 管理地区API
|
|
|
+│ │ │ └── index.ts # 包入口
|
|
|
│ │ ├── tests/
|
|
|
│ │ └── package.json
|
|
|
-│ ├── user-module/ # 用户管理模块 (@d8d/user-module)
|
|
|
+│ ├── goods-category-module/ # 商品类别模块
|
|
|
+│ ├── goods-module/ # 商品模块
|
|
|
+│ ├── merchant-module/ # 商户模块
|
|
|
+│ ├── orders-module/ # 订单模块
|
|
|
+│ ├── supplier-module/ # 供应商模块
|
|
|
+│ ├── tenant-module/ # 租户模块
|
|
|
+│ ├── user-module/ # 用户管理模块
|
|
|
│ │ ├── src/
|
|
|
│ │ │ ├── entities/
|
|
|
-│ │ │ │ ├── user.entity.ts # 用户实体
|
|
|
-│ │ │ │ └── role.entity.ts # 角色实体
|
|
|
+│ │ │ │ ├── user.entity.ts # 用户实体
|
|
|
+│ │ │ │ └── role.entity.ts # 角色实体
|
|
|
│ │ │ ├── services/
|
|
|
-│ │ │ │ ├── user.service.ts # 用户服务
|
|
|
-│ │ │ │ └── role.service.ts # 角色服务
|
|
|
+│ │ │ │ ├── user.service.ts # 用户服务
|
|
|
+│ │ │ │ └── role.service.ts # 角色服务
|
|
|
│ │ │ ├── schemas/
|
|
|
-│ │ │ │ ├── user.schema.ts # 用户Schema
|
|
|
-│ │ │ │ └── role.schema.ts # 角色Schema
|
|
|
+│ │ │ │ ├── user.schema.ts # 用户Schema
|
|
|
+│ │ │ │ └── role.schema.ts # 角色Schema
|
|
|
│ │ │ └── routes/
|
|
|
-│ │ │ ├── user.routes.ts # 用户路由
|
|
|
-│ │ │ ├── role.routes.ts # 角色路由
|
|
|
-│ │ │ └── custom.routes.ts # 自定义路由
|
|
|
+│ │ │ ├── user.routes.ts # 用户路由
|
|
|
+│ │ │ ├── role.routes.ts # 角色路由
|
|
|
+│ │ │ └── custom.routes.ts # 自定义路由
|
|
|
│ │ ├── tests/
|
|
|
│ │ └── package.json
|
|
|
-│ ├── auth-module/ # 认证管理模块 (@d8d/auth-module)
|
|
|
+│ # 多租户版本
|
|
|
+│ ├── advertisements-module-mt/ # 广告模块(多租户)
|
|
|
+│ ├── auth-module-mt/ # 认证模块(多租户)
|
|
|
+│ ├── bank-names-module-mt/ # 银行名称模块(多租户)
|
|
|
+│ ├── delivery-address-module-mt/ # 收货地址模块(多租户)
|
|
|
+│ ├── file-module-mt/ # 文件管理模块(多租户)
|
|
|
+│ ├── goods-category-module-mt/ # 商品类别模块(多租户)
|
|
|
+│ ├── goods-module-mt/ # 商品模块(多租户)
|
|
|
+│ ├── merchant-module-mt/ # 商户模块(多租户)
|
|
|
+│ ├── orders-module-mt/ # 订单模块(多租户)
|
|
|
+│ ├── supplier-module-mt/ # 供应商模块(多租户)
|
|
|
+│ ├── tenant-module-mt/ # 租户模块(多租户)
|
|
|
+│ └── user-module-mt/ # 用户管理模块(多租户)
|
|
|
+│ # ==================== 共享基础设施包 ====================
|
|
|
+│ ├── core-module/ # 核心模块
|
|
|
+│ ├── shared-crud/ # 通用CRUD基础设施
|
|
|
│ │ ├── src/
|
|
|
│ │ │ ├── services/
|
|
|
-│ │ │ │ ├── auth.service.ts # 认证服务
|
|
|
-│ │ │ │ └── mini-auth.service.ts # 小程序认证服务
|
|
|
-│ │ │ ├── schemas/
|
|
|
-│ │ │ │ └── auth.schema.ts # 认证Schema
|
|
|
-│ │ │ ├── routes/
|
|
|
-│ │ │ │ ├── login.route.ts # 登录路由
|
|
|
-│ │ │ │ ├── register.route.ts # 注册路由
|
|
|
-│ │ │ │ ├── mini-login.route.ts # 小程序登录路由
|
|
|
-│ │ │ │ ├── phone-decrypt.route.ts # 手机号解密路由
|
|
|
-│ │ │ │ ├── me.route.ts # 获取用户信息路由
|
|
|
-│ │ │ │ ├── update-me.route.ts # 更新用户信息路由
|
|
|
-│ │ │ │ ├── logout.route.ts # 登出路由
|
|
|
-│ │ │ │ └── sso-verify.route.ts # SSO验证路由
|
|
|
-│ │ │ └── middleware/
|
|
|
-│ │ │ ├── auth.middleware.ts # 认证中间件
|
|
|
-│ │ │ └── index.ts # 中间件导出
|
|
|
+│ │ │ │ ├── generic-crud.service.ts # 通用CRUD服务
|
|
|
+│ │ │ │ └── concrete-crud.service.ts # 具体CRUD服务
|
|
|
+│ │ │ └── routes/
|
|
|
+│ │ │ └── generic-crud.routes.ts # 通用CRUD路由
|
|
|
│ │ ├── tests/
|
|
|
│ │ └── package.json
|
|
|
-│ ├── file-module/ # 文件管理模块 (@d8d/file-module)
|
|
|
+│ ├── shared-test-util/ # 测试基础设施
|
|
|
│ │ ├── src/
|
|
|
-│ │ │ ├── entities/
|
|
|
-│ │ │ │ └── file.entity.ts # 文件实体
|
|
|
-│ │ │ ├── services/
|
|
|
-│ │ │ │ ├── file.service.ts # 文件服务
|
|
|
-│ │ │ │ └── minio.service.ts # MinIO服务
|
|
|
-│ │ │ ├── schemas/
|
|
|
-│ │ │ │ └── file.schema.ts # 文件Schema
|
|
|
-│ │ │ └── routes/
|
|
|
-│ │ │ ├── upload-policy/post.ts # 上传策略路由
|
|
|
-│ │ │ ├── multipart-policy/post.ts # 多部分上传策略路由
|
|
|
-│ │ │ ├── multipart-complete/post.ts # 完成多部分上传路由
|
|
|
-│ │ │ └── [id]/
|
|
|
-│ │ │ ├── get.ts # 获取文件详情路由
|
|
|
-│ │ │ ├── get-url.ts # 获取文件URL路由
|
|
|
-│ │ │ ├── download.ts # 文件下载路由
|
|
|
-│ │ │ └── delete.ts # 删除文件路由
|
|
|
+│ │ │ ├── integration-test-db.ts # 集成测试数据库工具
|
|
|
+│ │ │ └── integration-test-utils.ts # 集成测试断言工具
|
|
|
│ │ ├── tests/
|
|
|
│ │ └── package.json
|
|
|
-│ ├── mini-payment/ # 微信小程序支付模块 (@d8d/mini-payment)
|
|
|
+│ ├── shared-types/ # 共享类型定义
|
|
|
+│ │ ├── src/
|
|
|
+│ │ │ └── index.ts # 类型定义导出
|
|
|
+│ │ └── package.json
|
|
|
+│ ├── shared-ui-components/ # 共享UI组件
|
|
|
+│ ├── shared-utils/ # 共享工具函数
|
|
|
+│ │ ├── src/
|
|
|
+│ │ │ ├── utils/
|
|
|
+│ │ │ │ ├── jwt.util.ts # JWT工具
|
|
|
+│ │ │ │ ├── errorHandler.ts # 错误处理
|
|
|
+│ │ │ │ ├── parseWithAwait.ts # 异步解析
|
|
|
+│ │ │ │ ├── logger.ts # 日志工具
|
|
|
+│ │ │ │ └── redis.util.ts # Redis会话管理
|
|
|
+│ │ │ └── data-source.ts # 数据库连接
|
|
|
+│ │ ├── tests/
|
|
|
+│ │ └── package.json
|
|
|
+│ ├── mini-payment/ # 小程序支付模块
|
|
|
│ │ ├── src/
|
|
|
│ │ │ ├── entities/
|
|
|
-│ │ │ │ ├── payment.entity.ts # 支付实体
|
|
|
-│ │ │ │ └── payment.types.ts # 支付类型定义
|
|
|
+│ │ │ │ ├── payment.entity.ts # 支付实体
|
|
|
+│ │ │ │ └── payment.types.ts # 支付类型定义
|
|
|
│ │ │ ├── services/
|
|
|
-│ │ │ │ └── payment.service.ts # 支付服务
|
|
|
+│ │ │ │ └── payment.service.ts # 支付服务
|
|
|
│ │ │ ├── schemas/
|
|
|
-│ │ │ │ └── payment.schema.ts # 支付Schema
|
|
|
+│ │ │ │ └── payment.schema.ts # 支付Schema
|
|
|
│ │ │ └── routes/
|
|
|
│ │ │ └── payment/
|
|
|
-│ │ │ ├── create.ts # 支付创建路由
|
|
|
-│ │ │ ├── callback.ts # 支付回调路由
|
|
|
-│ │ │ └── status.ts # 支付状态查询路由
|
|
|
+│ │ │ ├── create.ts # 支付创建路由
|
|
|
+│ │ │ ├── callback.ts # 支付回调路由
|
|
|
+│ │ │ └── status.ts # 支付状态查询路由
|
|
|
│ │ ├── tests/
|
|
|
│ │ │ └── integration/
|
|
|
-│ │ │ ├── payment.integration.test.ts # 支付集成测试
|
|
|
+│ │ │ ├── payment.integration.test.ts # 支付集成测试
|
|
|
│ │ │ └── payment-callback.integration.test.ts # 支付回调集成测试
|
|
|
│ │ └── package.json
|
|
|
-│ └── geo-areas/ # 地区模块 (@d8d/geo-areas)
|
|
|
+│ # ==================== 服务器包 ====================
|
|
|
+│ └── server/ # API服务器包
|
|
|
│ ├── src/
|
|
|
-│ │ ├── modules/areas/
|
|
|
-│ │ │ ├── area.entity.ts # 地区实体
|
|
|
-│ │ │ ├── area.service.ts # 地区服务
|
|
|
-│ │ │ └── area.schema.ts # 地区Schema
|
|
|
-│ │ ├── api/
|
|
|
-│ │ │ ├── areas/index.ts # 公共地区API
|
|
|
-│ │ │ └── admin/areas/index.ts # 管理地区API
|
|
|
-│ │ └── index.ts # 包入口
|
|
|
+│ │ ├── api.ts # API路由导出
|
|
|
+│ │ └── index.ts # 服务器入口
|
|
|
│ ├── tests/
|
|
|
│ └── package.json
|
|
|
-├── web/ # Web应用 (Hono + React SSR)
|
|
|
+├── scripts/ # 脚本文件目录
|
|
|
+├── web/ # Web管理后台 (Hono + React SSR)
|
|
|
│ ├── src/
|
|
|
-│ │ ├── client/ # 客户端代码
|
|
|
-│ │ │ ├── admin/ # 管理后台
|
|
|
-│ │ │ │ ├── components/ # 管理后台组件
|
|
|
-│ │ │ │ │ ├── AvatarSelector.tsx # 头像选择器
|
|
|
-│ │ │ │ │ ├── DataTablePagination.tsx # 表格分页
|
|
|
-│ │ │ │ │ ├── ErrorPage.tsx # 错误页面
|
|
|
-│ │ │ │ │ ├── FileSelector.tsx # 文件选择器
|
|
|
-│ │ │ │ │ ├── MinioUploader.tsx # MinIO上传器
|
|
|
-│ │ │ │ │ ├── NotFoundPage.tsx # 404页面
|
|
|
-│ │ │ │ │ └── ProtectedRoute.tsx # 路由保护
|
|
|
+│ │ ├── client/ # 客户端代码
|
|
|
+│ │ │ ├── admin/ # 管理后台
|
|
|
+│ │ │ │ ├── components/ # 管理后台组件
|
|
|
+│ │ │ │ │ ├── AvatarSelector.tsx # 头像选择器
|
|
|
+│ │ │ │ │ ├── DataTablePagination.tsx # 表格分页
|
|
|
+│ │ │ │ │ ├── ErrorPage.tsx # 错误页面
|
|
|
+│ │ │ │ │ ├── FileSelector.tsx # 文件选择器
|
|
|
+│ │ │ │ │ ├── MinioUploader.tsx # MinIO上传器
|
|
|
+│ │ │ │ │ ├── NotFoundPage.tsx # 404页面
|
|
|
+│ │ │ │ │ └── ProtectedRoute.tsx # 路由保护
|
|
|
│ │ │ │ ├── hooks/
|
|
|
-│ │ │ │ │ └── AuthProvider.tsx # 认证状态管理
|
|
|
+│ │ │ │ │ └── AuthProvider.tsx # 认证状态管理
|
|
|
│ │ │ │ ├── layouts/
|
|
|
-│ │ │ │ │ └── MainLayout.tsx # 主布局
|
|
|
+│ │ │ │ │ └── MainLayout.tsx # 主布局
|
|
|
│ │ │ │ ├── pages/
|
|
|
-│ │ │ │ │ ├── Dashboard.tsx # 仪表板
|
|
|
-│ │ │ │ │ ├── Files.tsx # 文件管理
|
|
|
-│ │ │ │ │ ├── Login.tsx # 登录页面
|
|
|
-│ │ │ │ │ └── Users.tsx # 用户管理
|
|
|
-│ │ │ │ ├── menu.tsx # 菜单配置
|
|
|
-│ │ │ │ ├── routes.tsx # 路由配置
|
|
|
-│ │ │ │ └── index.tsx # 管理后台入口
|
|
|
+│ │ │ │ │ ├── Dashboard.tsx # 仪表板
|
|
|
+│ │ │ │ │ ├── Files.tsx # 文件管理
|
|
|
+│ │ │ │ │ ├── Login.tsx # 登录页面
|
|
|
+│ │ │ │ │ └── Users.tsx # 用户管理
|
|
|
+│ │ │ │ ├── menu.tsx # 菜单配置
|
|
|
+│ │ │ │ ├── routes.tsx # 路由配置
|
|
|
+│ │ │ │ └── index.tsx # 管理后台入口
|
|
|
│ │ │ ├── components/
|
|
|
-│ │ │ │ └── ui/ # shadcn/ui组件库
|
|
|
-│ │ │ │ ├── accordion.tsx # 手风琴组件
|
|
|
-│ │ │ │ ├── alert-dialog.tsx # 警告对话框
|
|
|
-│ │ │ │ ├── alert.tsx # 警告组件
|
|
|
-│ │ │ │ └── ... # 其他50+组件
|
|
|
-│ │ │ ├── api.ts # API客户端
|
|
|
-│ │ │ └── index.tsx # 前端入口
|
|
|
-│ │ ├── server/ # 服务器端代码 (SSR)
|
|
|
-│ │ │ ├── index.tsx # 服务器入口
|
|
|
-│ │ │ └── renderer.tsx # React渲染器
|
|
|
-│ │ └── share/ # 共享代码
|
|
|
+│ │ │ │ └── ui/ # shadcn/ui组件库
|
|
|
+│ │ │ │ ├── accordion.tsx # 手风琴组件
|
|
|
+│ │ │ │ ├── alert-dialog.tsx # 警告对话框
|
|
|
+│ │ │ │ ├── alert.tsx # 警告组件
|
|
|
+│ │ │ │ └── ... # 其他50+组件
|
|
|
+│ │ │ ├── api.ts # API客户端
|
|
|
+│ │ │ └── index.tsx # 前端入口
|
|
|
+│ │ ├── server/ # 服务器端代码 (SSR)
|
|
|
+│ │ │ ├── index.tsx # 服务器入口
|
|
|
+│ │ │ └── renderer.tsx # React渲染器
|
|
|
+│ │ └── share/ # 共享代码
|
|
|
│ ├── tests/
|
|
|
-│ │ ├── e2e/ # E2E测试 (Playwright)
|
|
|
-│ │ ├── integration/ # Web集成测试
|
|
|
-│ │ │ └── client/ # 客户端集成测试
|
|
|
-│ │ └── unit/ # 单元测试
|
|
|
-│ │ └── client/ # 客户端单元测试
|
|
|
-│ │ ├── pages/ # 页面组件测试
|
|
|
-│ │ │ └── Users.test.tsx # 用户页面测试
|
|
|
-│ │ └── debug.test.tsx # 调试测试
|
|
|
+│ │ ├── e2e/ # E2E测试 (Playwright)
|
|
|
+│ │ ├── integration/ # Web集成测试
|
|
|
+│ │ │ └── client/ # 客户端集成测试
|
|
|
+│ │ └── unit/ # 单元测试
|
|
|
+│ │ └── client/ # 客户端单元测试
|
|
|
+│ │ ├── pages/ # 页面组件测试
|
|
|
+│ │ │ └── Users.test.tsx # 用户页面测试
|
|
|
+│ │ └── debug.test.tsx # 调试测试
|
|
|
│ └── package.json
|
|
|
-├── docs/ # 项目文档
|
|
|
-│ └── architecture/ # 架构文档
|
|
|
-├── scripts/ # 脚本文件
|
|
|
-├── .bmad-core/ # BMAD核心配置
|
|
|
-├── .claude/ # Claude配置
|
|
|
-├── .git/ # Git仓库
|
|
|
-├── package.json # 根项目配置
|
|
|
-├── pnpm-workspace.yaml # pnpm workspace 配置
|
|
|
-└── pnpm-lock.yaml # 依赖锁定文件
|
|
|
+├── .gitignore # Git忽略文件
|
|
|
+├── .npmrc # NPM配置
|
|
|
+├── Dockerfile # Docker配置
|
|
|
+├── LICENSE # 许可证
|
|
|
+├── README.md # 项目说明
|
|
|
+├── package.json # 根项目配置
|
|
|
+├── pnpm-lock.yaml # 依赖锁定文件
|
|
|
+├── pnpm-workspace.yaml # pnpm workspace配置
|
|
|
+└── tsconfig.json # TypeScript配置
|
|
|
```
|
|
|
|
|
|
-## 集成指南
|
|
|
+## 项目结构概览
|
|
|
+
|
|
|
+### 主要目录分类
|
|
|
+
|
|
|
+| 目录 | 用途 | 技术栈 |
|
|
|
+|------|------|--------|
|
|
|
+| `mini/` | 商户小程序 | Taro + React |
|
|
|
+| `mini-talent/` | 人才小程序 | Taro + React |
|
|
|
+| `mini-ui-packages/` | 小程序UI组件包 | React + Taro |
|
|
|
+| `web/` | Web管理后台 | Hono + React SSR |
|
|
|
+| `packages/` | 核心共享包 | Node.js + TypeScript |
|
|
|
+| `allin-packages/` | AllIn业务包 | Node.js + TypeScript |
|
|
|
+| `docs/` | 项目文档 | Markdown |
|
|
|
+
|
|
|
+### 包架构层次
|
|
|
+
|
|
|
+```
|
|
|
+基础设施层:
|
|
|
+ └── shared-types → shared-utils → shared-crud → shared-test-util
|
|
|
+
|
|
|
+业务模块层:
|
|
|
+ └── user-module → auth-module → file-module → geo-areas
|
|
|
+ └── goods-module → orders-module → merchant-module
|
|
|
+ └── (多租户版本: *-mt)
|
|
|
+
|
|
|
+UI展示层:
|
|
|
+ └── user-management-ui → auth-management-ui → file-management-ui
|
|
|
+ └── (多租户版本: *-ui-mt)
|
|
|
+
|
|
|
+应用层:
|
|
|
+ └── server (API服务器)
|
|
|
+ └── web (Web管理后台)
|
|
|
+ └── mini/mini-talent (小程序)
|
|
|
+```
|
|
|
+
|
|
|
+### 集成指南
|
|
|
+
|
|
|
- **文件命名**: 保持现有kebab-case命名约定
|
|
|
-- **项目结构**: 采用monorepo模式,包含小程序(mini)、Web应用(web)和模块化包架构
|
|
|
-- **包管理**: 使用pnpm workspace管理多包依赖关系
|
|
|
+- **项目结构**: 采用monorepo模式,使用pnpm workspace管理多包依赖关系
|
|
|
+- **包管理**: 核心包在`packages/`,业务扩展包在`allin-packages/`,小程序UI组件在`mini-ui-packages/`
|
|
|
- **小程序架构**: 基于Taro框架,支持多平台(微信小程序、H5等)
|
|
|
- **Web应用架构**: 基于Hono + React SSR,使用shadcn/ui组件库
|
|
|
- **模块化架构**: 采用分层包结构,支持按需安装和独立开发
|
|
|
-- **API服务器**: 重构后的`@d8d/server`包,基于模块化架构,提供RESTful API
|
|
|
+- **多租户支持**: 核心模块和UI包都有对应的多租户版本(`-mt`后缀)
|
|
|
- **API设计**: 使用Hono框架,RESTful API设计,支持文件分片上传
|
|
|
- **数据库**: 使用PostgreSQL + TypeORM
|
|
|
- **存储**: 使用MinIO进行文件存储
|
|
|
-- **包架构层次**:
|
|
|
- - **基础设施层**: shared-types → shared-utils → shared-crud
|
|
|
- - **测试基础设施**: shared-test-util
|
|
|
- - **业务模块层**: user-module → auth-module → file-module → geo-areas
|
|
|
- - **应用层**: server (重构后)
|
|
|
- **测试结构**:
|
|
|
- **基础设施包**: 每个包独立的单元测试和集成测试
|
|
|
- **业务模块包**: 每个模块包含完整的测试套件
|
|
|
@@ -258,10 +410,14 @@ d8d-mini-starter/
|
|
|
- **web应用**: 组件测试、集成测试和E2E测试
|
|
|
- **开发环境**: 多八多云端开发容器,包含Node.js 20.19.2、PostgreSQL 17、Redis 7、MinIO
|
|
|
- **构建工具**: 使用Vite + pnpm,支持SSR构建
|
|
|
-- **架构优势**:
|
|
|
- - 清晰的模块边界和职责分离
|
|
|
- - 支持按需安装,减少包体积
|
|
|
- - 基础设施和业务逻辑分离
|
|
|
- - 统一的测试模式和工具
|
|
|
- - 更好的代码复用和维护性
|
|
|
- - 独立的包版本管理
|
|
|
+
|
|
|
+### 架构优势
|
|
|
+
|
|
|
+- 清晰的模块边界和职责分离
|
|
|
+- 支持按需安装,减少包体积
|
|
|
+- 基础设施和业务逻辑分离
|
|
|
+- 统一的测试模式和工具
|
|
|
+- 更好的代码复用和维护性
|
|
|
+- 独立的包版本管理
|
|
|
+- 支持多租户架构
|
|
|
+- 小程序UI组件复用(rencai/yongren系列)
|