nex_design_system/docs/10-project-stack-defaults.md

44 lines
1.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 10. Project Stack Defaults
## 1. 原则
新项目需要明确的默认技术选型,Agent 不应自行猜测。已有项目则必须保留真实技术栈,不得为了符合默认值而迁移。
## 2. 新项目默认全栈方案
| 层次 | 默认技术 |
|---|---|
| 前端框架 | React |
| 前端语言 | TypeScript |
| 构建工具 | Vite |
| 包管理器 | npm |
| UI 组件库 | Ant Design |
| 样式 | Tailwind CSS v4 + CSS Variables |
| 状态管理 | Zustand |
| 路由 | React Router |
| HTTP | Axios |
| 后端语言 | Python |
| 后端框架 | FastAPI |
| 校验 | Pydantic |
| ORM | SQLAlchemy |
| 数据库迁移 | Alembic |
| 开发数据库 | SQLite |
| 生产数据库 | PostgreSQL |
| API | REST + OpenAPI |
| 本地静态资源 | `./data` |
具体依赖版本按初始化时的兼容稳定版本选择,并保持 lockfile。此处定义的是新项目起点,不是所有项目的强制技术栈。
## 3. 项目类型与生命周期
- `project.type: fullstack`:前后端均适用;
- `frontend-only`:仅初始化前端;
- `backend-only`:仅初始化后端;
- `project.lifecycle: auto`:空项目按 new,已有应用代码按 existing;
- `new`:默认 stack 是初始化目标;
- `existing`:以代码、依赖和锁文件为准。
## 4. 覆盖
只修改与项目意图不同的字段。不要要求用户重复填写整套技术栈。若明确需求与默认值冲突,说明冲突并提出最小调整,不得静默替换技术。