Files
ai_soc_sw/.ai/phases/phase-01-foundation/architecture.md
T

46 lines
1.6 KiB
Markdown
Raw Normal View History

# Phase 1: 基础搭建 — 架构概览
## 技术栈
| 层 | 技术 | 说明 |
|----|------|------|
| 前端 (P01) | Taro 4 + React 18 + TypeScript + Tailwind CSS | 跨端小程序 |
| 后端 (P01) | NestJS 10 + TypeScript | REST API |
| 数据库 | PostgreSQLSchema 本阶段确定) | 关系型存储 |
| 包管理 | pnpm | monorepo |
| 测试 | Jest | 单元 + 集成 + E2E |
| AI 训练 (P02) | Python + PyTorch | 延期至 Phase 2 |
| Web 后台 (P03) | Next.js | 延期至 Phase 2 |
## 当前架构快照
```
P01_errlens_app/
src/ # Taro 小程序源码(已有骨架)
pages/index/ # 首页(通用模板,待替换为错题本首页)
components/ui/ # shadcn/ui Taro 组件库(~50个组件)
lib/ # 工具函数(cn, platform, measure, hooks
presets/ # H5 适配(navbar, error boundary, styles
server/ # NestJS 后端
src/
main.ts # 启动入口
app.module.ts # 根模块
app.controller.ts # GET /hello, GET /health
tests/ # Jest 测试(已有 utils 测试骨架)
P02_errlens_training/ # 空壳,Phase 2 启动
P03_errlens_web/ # 空壳,Phase 2 启动
```
## 关键约束
- 所有业务代码在 projects/*/src/(权限边界)
- 跨平台目标:微信小程序优先,抖音/H5 为次
- AI 代码必须遵循 `.ai/prompts/coding/code-style.md`
## 待定问题
- 数据库 Schema 设计(PRD 先行)
- P01 页面架构(几个页面、导航结构)
- 后端 API 版本策略