# 任务清单 (2-task) > 粒度:每个任务 2-5 分钟 > 状态标记:[ ] 待办 / [~] 进行中 / [x] 完成 / [!] 阻塞 --- ## Phase 0:项目骨架 ### T0.1 项目目录结构 - [x] 创建 `frontend/` `backend/` `docs/daily/` `docs/decisions/` 目录 - [x] 创建 `.gitignore`(Python + Node + IDE + .env) - [x] 创建 `.env.example` - 验证:目录结构正确 ### T0.2 后端项目初始化 - [x] `backend/pyproject.toml`(FastAPI + SQLAlchemy + Alembic + Pydantic + pytest) - [x] `backend/app/__init__.py` - [x] `backend/app/main.py`(FastAPI app 实例 + 健康检查 `/health`) - [x] `backend/app/core/config.py`(环境变量配置) - [x] `backend/app/core/database.py`(SQLAlchemy engine + session) - [x] `backend/tests/__init__.py` - [x] `backend/tests/test_health.py`(4 个测试全部 GREEN) - 验证:`pytest tests/test_health.py -v` → 4 passed ### T0.3 前端项目初始化 - [x] `npx create-next-app@latest frontend`(TypeScript + TailwindCSS 4 + App Router) - [x] 安装 lucide-react + recharts + sonner + radix-ui + cva + clsx + tailwind-merge - [x] 配置 `globals.css`(oklch 色彩、系统字体、`--radius: 0.625rem`、打印样式) - [x] 创建三端布局:`(investor)` 路由组 + `founder/` + `admin/` 目录 - [x] 创建共享组件:`LoadingSpinner` / `EmptyState` / `HealthScoreBadge` - [x] 创建 `lib/utils.ts`(cn 函数)+ `lib/api.ts`(API 客户端) - 验证:`pnpm build` → 8 路由全部构建成功 ### T0.4 Docker Compose 开发环境 - [x] `docker-compose.yml`(PostgreSQL 16 + Redis 7 + Ollama) - [x] `backend/Dockerfile` - [x] `frontend/Dockerfile` - [ ] `docker-compose.dev.yml`(开发覆盖:挂载源码 + hot reload) - 验证:`docker compose up -d` 全部 healthy ### T0.5 数据库迁移基座 - [x] `backend/alembic.ini` - [x] `backend/alembic/` 初始化 - [x] 首个 migration:创建 7 张核心表(tenants/users/companies/monthly_reports/health_scores/risk_events/audit_logs) - 验证:`alembic upgrade head` 成功,`\dt` 显示 8 张表 --- ## Phase 1:MVP 核心功能 ### T1.1 认证与权限 - [x] `backend/app/models/user.py`(User + Role + Tenant) - [x] `backend/app/routers/auth.py`(登录 / 注册 / refresh token) - [x] `backend/app/core/security.py`(JWT + 密码哈希) - [ ] `backend/app/core/permissions.py`(角色级 + 字段级权限中间件) - [x] `backend/tests/test_auth.py`(11 tests GREEN) - [x] `frontend/src/app/login/page.tsx`(登录表单 + AuthProvider) - [x] `frontend/src/lib/auth-context.tsx`(token 管理 + 自动恢复) - 验证:登录 → 获取 token → 访问受保护 API ✅ ### T1.2 企业档案管理 - [x] `backend/app/models/company.py`(CompanyProfile) - [x] `backend/app/routers/companies.py`(CRUD + 筛选 + 分页) - [x] `backend/app/schemas/company.py`(Pydantic schema) - [x] `backend/tests/test_companies.py`(11 tests GREEN) - [x] `frontend/src/app/(investor)/companies/page.tsx`(列表 + 搜索 + 分页) - [x] `frontend/src/app/(investor)/companies/[id]/page.tsx`(详情页) - [ ] `frontend/src/components/company/CompanyCard.tsx`(独立组件抽取) - 验证:创建企业 → 列表显示 → 详情页可访问 ✅ ### T1.3 月报管理 + AI 解析 - [x] `backend/app/models/report.py`(MonthlyReport) - [x] `backend/app/routers/reports.py`(CRUD + 提交) - [ ] `backend/app/services/ai_parser.py`(月报 AI 解析服务) - [x] `backend/app/schemas/report.py` - [x] `backend/tests/test_reports.py`(7 tests GREEN) - [ ] `frontend/src/app/(founder)/reports/submit/page.tsx`(创始人提交月报) - [x] `frontend/src/app/(investor)/reports/page.tsx`(投资人查看月报) - 验证:CRUD + 提交 ✅ / AI 解析待实现 ### T1.4 健康度评分 - [x] `backend/app/models/health_score.py`(HealthScore) - [ ] `backend/app/services/health_calculator.py`(财务 + 经营 + AI+ 专项) - [x] `backend/app/routers/dashboard.py`(聚合查询 + 评分列表) - [x] `backend/tests/test_dashboard.py`(4 tests GREEN) - [ ] `frontend/src/components/health/HealthGauge.tsx`(仪表盘组件) - [ ] `frontend/src/components/health/HealthRadar.tsx`(雷达图组件) - [ ] `frontend/src/components/health/HealthTrend.tsx`(趋势 sparkline) - 验证:仪表盘 API ✅ / 自动算分 + 图表待实现 ### T1.5 投资机构驾驶舱 - [x] `backend/app/routers/dashboard.py`(聚合数据接口) - [x] `backend/tests/test_dashboard.py`(4 tests GREEN) - [x] `frontend/src/app/(investor)/dashboard/page.tsx`(驾驶舱首页 KPI + 概览) - [ ] `frontend/src/components/dashboard/HealthDistribution.tsx` - [ ] `frontend/src/components/dashboard/RiskSummary.tsx` - [ ] `frontend/src/components/dashboard/AIWeeklyBrief.tsx` - 验证:驾驶舱基础版 ✅ / 高级组件待实现 ### T1.6 风险预警 - [x] `backend/app/models/risk.py`(RiskEvent) - [ ] `backend/app/services/risk_engine.py`(指标越界检测引擎) - [x] `backend/app/routers/risks.py`(列表 / 更新 / 删除) - [x] `backend/tests/test_risks.py`(6 tests GREEN) - [x] `frontend/src/app/(investor)/risks/page.tsx`(风险工作台) - [ ] `frontend/src/components/risk/RiskCard.tsx` + `RiskTimeline.tsx` - 验证:CRUD + 状态流转 ✅ / 自动检测引擎待实现 ### T1.7 投后报告 - [ ] `backend/app/services/report_generator.py`(AI 报告生成) - [ ] `backend/app/routers/reports_export.py`(PDF 导出) - [ ] `backend/tests/test_report_export.py`(RED) - [ ] `frontend/src/app/(investor)/reports/view/[id]/page.tsx` - 验证:选择企业 → 生成报告 → 导出 PDF ### T1.8 移动端适配 - [ ] 投资人端响应式:< md Sidebar 折叠为抽屉 - [ ] 创始人端移动布局:卡片流 + 底部导航 - [ ] AI Copilot 浮动对话窗口(底部抽屉式) - [ ] 风险预警 toast 推送 - 验证:Chrome DevTools 移动端模拟,三端布局正常 --- ## 依赖关系 ``` T0.1 → T0.2 → T0.5 → T1.1 → T1.2 → T1.3 → T1.4 → T1.5 ↓ T1.6 → T1.7 T0.3 → T1.2(前端依赖) T0.4 → T0.5(DB 依赖 Docker) T1.8 依赖 T1.1-T1.7 全部完成 ``` ## 里程碑 | 里程碑 | 任务 | 预期 | |---|---|---| | M0:骨架可运行 | T0.1-T0.5 | 1 周 | | M1:认证 + 企业档案 | T1.1-T1.2 | 1 周 | | M2:月报 + 健康度 | T1.3-T1.4 | 2 周 | | M3:驾驶舱 + 风险 | T1.5-T1.6 | 1 周 | | M4:报告 + 移动端 | T1.7-T1.8 | 1 周 |