Files
16gagent/cases/teamflow-v2/arch.json
T
2026-06-06 10:40:48 +08:00

1 line
12 KiB
JSON
Raw 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.
{"projectName":"TeamFlow","domain":"note","techStack":{"frontend":"React Native 0.76 + Expo / Flutter 3.x","backend":"NestJS + Prisma","database":"PostgreSQL 15 + Redis 7 + MinIO(文件存储)","deployment":"Docker Compose + Nginx / K8s(规模化)","considerations":[]},"architectureDiagram":"┌─────────────────────────────────────────────────────────┐\n│ TeamFlow — System Architecture │\n├─────────────────────────────────────────────────────────┤\n│ │\n│ ┌──────────────────────┐ ┌──────────────────────┐ │\n│ │ Client Layer │ │ Admin / Web │ │\n│ │ React Native 0.76 + Expo / Flutter 3.x │ │ React + Vite (Web) │ │\n│ └──────────┬───────────┘ └──────────┬───────────┘ │\n│ │ │ │\n│ └──────────┬────────────────┘ │\n│ │ │\n│ ┌─────────▼──────────┐ │\n│ │ API Gateway │ │\n│ │ Nginx / Kong │ │\n│ └─────────┬──────────┘ │\n│ │ │\n│ ┌─────────▼──────────┐ │\n│ │ Backend Services │ │\n│ │ NestJS + Prisma │ │\n│ └─────────┬──────────┘ │\n│ │ │\n│ ┌───────────────┼───────────────┐ │\n│ │ │ │ │\n│ ┌─────▼─────┐ ┌──────▼──────┐ ┌────▼─────┐ │\n│ │ PostgreSQL 15│ │ Redis Cache │ │ MinIO │ │\n│ │ Primary │ │ Session │ │ Files │ │\n│ └───────────┘ └─────────────┘ └──────────┘ │\n│ │\n├─────────────────────────────────────────────────────────┤\n│ Modules: │\n│ 1 看板视图 │\n│ 2 任务管理 │\n│ 3 团队成员 │\n│ 4 筛选和搜索 │\n│ 5 活动日志 │\n│ 6 Analytics │\n│ │\n└─────────────────────────────────────────────────────────┘","dataFlows":[{"page":"任务管理","route":"/任务管理","description":"每个任务卡片支持标题","dataFlow":["GET /api/任务管理 → 获取任务管理列表","POST /api/任务管理 → 创建任务管理"],"direction":"Client → API Gateway → Backend → Database → Response → Client"},{"page":"筛选和搜索","route":"/筛选和搜索","description":"按标签","dataFlow":["GET /api/筛选和搜索 → 获取筛选和搜索列表","POST /api/筛选和搜索 → 创建筛选和搜索"],"direction":"Client → API Gateway → Backend → Database → Response → Client"},{"page":"看板视图","route":"/看板视图","description":"支持创建多个看板,每个看板有多个列(待办/进行中/已完成等","dataFlow":["GET /api/看板视图 → 获取看板视图列表","POST /api/看板视图 → 创建看板视图"],"direction":"Client → API Gateway → Backend → Database → Response → Client"}],"modules":[{"name":"看板视图","label":"看板视图","features":["看板视图"],"responsibilities":["提供 看板视图 相关功能"]},{"name":"任务管理","label":"任务管理","features":["任务管理"],"responsibilities":["提供 任务管理 相关功能"]},{"name":"团队成员","label":"团队成员","features":["团队成员"],"responsibilities":["提供 团队成员 相关功能"]},{"name":"筛选和搜索","label":"筛选和搜索","features":["筛选和搜索"],"responsibilities":["提供 筛选和搜索 相关功能"]},{"name":"活动日志","label":"活动日志","features":["活动日志"],"responsibilities":["提供 活动日志 相关功能"]},{"name":"analytics","label":"Analytics","features":["数据统计"],"responsibilities":["提供 数据统计 相关功能"]},{"name":"editor","label":"编辑器","features":["笔记编辑"],"responsibilities":["提供 笔记编辑 相关功能"]},{"name":"search","label":"搜索引擎","features":["全文搜索"],"responsibilities":["提供 全文搜索 相关功能"]}],"databaseSchema":[{"table":"users","description":"用户表","fields":[{"name":"id","type":"UUID","constraints":"PK, DEFAULT gen_random_uuid()"},{"name":"phone","type":"VARCHAR(20)","constraints":"UNIQUE"},{"name":"nickname","type":"VARCHAR(64)"},{"name":"avatar_url","type":"TEXT"},{"name":"created_at","type":"TIMESTAMPTZ","constraints":"DEFAULT NOW()"},{"name":"updated_at","type":"TIMESTAMPTZ","constraints":"DEFAULT NOW()"}],"indexes":["idx_users_phone ON users(phone)"]},{"table":"notes","description":"笔记表","fields":[{"name":"id","type":"UUID","constraints":"PK"},{"name":"user_id","type":"UUID","constraints":"FK → users.id"},{"name":"title","type":"VARCHAR(256)"},{"name":"content","type":"TEXT"},{"name":"is_markdown","type":"BOOLEAN","constraints":"DEFAULT false"},{"name":"folder_id","type":"UUID","constraints":"FK → folders.id"},{"name":"created_at","type":"TIMESTAMPTZ","constraints":"DEFAULT NOW()"},{"name":"updated_at","type":"TIMESTAMPTZ","constraints":"DEFAULT NOW()"}],"indexes":["idx_notes_user ON notes(user_id)","idx_notes_folder ON notes(folder_id)","idx_notes_fts ON notes USING GIN (to_tsvector('simple', title || ' ' || content))"]},{"table":"tags","description":"标签表","fields":[{"name":"id","type":"UUID","constraints":"PK"},{"name":"name","type":"VARCHAR(64)","constraints":"NOT NULL, UNIQUE"},{"name":"color","type":"VARCHAR(7)"}]},{"table":"note_tags","description":"笔记-标签关联表","fields":[{"name":"note_id","type":"UUID","constraints":"FK → notes.id"},{"name":"tag_id","type":"UUID","constraints":"FK → tags.id"},{"name":"PRIMARY KEY (note_id, tag_id)"}]}],"apiDesign":[{"resource":"auth","basePath":"/api/auth","endpoints":[{"method":"POST","path":"/api/auth/login","description":"用户登录"},{"method":"GET","path":"/api/auth/me","description":"获取当前用户"}]},{"resource":"任务管理","basePath":"/api/任务管理","endpoints":[{"method":"GET","path":"/api/任务管理","description":"获取任务管理列表"},{"method":"POST","path":"/api/任务管理","description":"创建任务管理"}]},{"resource":"团队成员","basePath":"/api/团队成员","endpoints":[{"method":"GET","path":"/api/团队成员","description":"获取团队成员列表"},{"method":"POST","path":"/api/团队成员","description":"创建团队成员"}]},{"resource":"看板视图","basePath":"/api/看板视图","endpoints":[{"method":"GET","path":"/api/看板视图","description":"获取看板视图列表"},{"method":"POST","path":"/api/看板视图","description":"创建看板视图"}]},{"resource":"筛选和搜索","basePath":"/api/筛选和搜索","endpoints":[{"method":"GET","path":"/api/筛选和搜索","description":"获取筛选和搜索列表"},{"method":"POST","path":"/api/筛选和搜索","description":"创建筛选和搜索"}]}],"directoryStructure":["teamflow/","├── apps/","│ ├── mobile/ # React Native / Flutter 移动端","│ │ ├── src/","│ │ │ ├── screens/ # 页面组件","│ │ │ │ ├── 看板视图/","│ │ │ │ ├── 任务管理/","│ │ │ │ ├── 团队成员/","│ │ │ │ ├── 筛选和搜索/","│ │ │ ├── components/ # 通用组件","│ │ │ ├── hooks/ # 自定义 Hooks","│ │ │ ├── services/ # API 调用层","│ │ │ ├── store/ # 状态管理","│ │ │ └── utils/ # 工具函数","│ │ ├── app.json","│ │ └── package.json","│ └── web/ # Web 管理后台","│ ├── src/","│ │ ├── pages/","│ │ ├── components/","│ │ └── layouts/","│ └── package.json","├── packages/","│ └── shared/ # 共享类型/常量","├── server/ # NestJS 后端服务","│ ├── src/","│ │ ├── modules/ # 业务模块","│ │ │ ├── 看板视图/","│ │ │ │ ├── 看板视图.controller.ts","│ │ │ │ ├── 看板视图.service.ts","│ │ │ │ ├── 看板视图.module.ts","│ │ │ │ └── dto/","│ │ │ ├── 任务管理/","│ │ │ │ ├── 任务管理.controller.ts","│ │ │ │ ├── 任务管理.service.ts","│ │ │ │ ├── 任务管理.module.ts","│ │ │ │ └── dto/","│ │ │ ├── 团队成员/","│ │ │ │ ├── 团队成员.controller.ts","│ │ │ │ ├── 团队成员.service.ts","│ │ │ │ ├── 团队成员.module.ts","│ │ │ │ └── dto/","│ │ │ ├── 筛选和搜索/","│ │ │ │ ├── 筛选和搜索.controller.ts","│ │ │ │ ├── 筛选和搜索.service.ts","│ │ │ │ ├── 筛选和搜索.module.ts","│ │ │ │ └── dto/","│ │ │ ├── 活动日志/","│ │ │ │ ├── 活动日志.controller.ts","│ │ │ │ ├── 活动日志.service.ts","│ │ │ │ ├── 活动日志.module.ts","│ │ │ │ └── dto/","│ │ ├── common/ # 通用(guards, filters, interceptors","│ │ ├── prisma/ # Prisma ORM","│ │ │ └── schema.prisma","│ │ ├── config/ # 环境配置","│ │ └── main.ts","│ ├── test/","│ ├── Dockerfile","│ └── package.json","├── docker-compose.yml","├── .github/workflows/ # CI/CD","│ └── ci.yml","├── .env.example","├── README.md","└── turbo.json # Monorepo 配置"],"deployment":{"environments":["development","staging","production"],"strategy":"Docker Compose + Nginx / K8s(规模化)","services":["API Server (NestJS)","PostgreSQL 15","Redis 7"],"ci":"GitHub Actions → Build → Test → Deploy"},"meta":{"generatedAt":"2026-06-05T10:19:15.144Z","sourceDomain":"note","moduleCount":8,"tableCount":4,"apiEndpointCount":10}}