docs: add README.md and update AGENTS.md
This commit is contained in:
@@ -1,11 +1,71 @@
|
||||
# 所有回答请使用中文
|
||||
|
||||
# 当前开发环境
|
||||
系统:windows
|
||||
shell:PowerShell
|
||||
# 项目信息
|
||||
|
||||
- **项目名称**: 食谱翻译工具
|
||||
- **类型**: Next.js 16 Web 应用
|
||||
- **系统**: Windows / Linux / macOS
|
||||
- **Shell**: PowerShell / Bash
|
||||
|
||||
# 技术栈
|
||||
|
||||
- Next.js 16 (App Router)
|
||||
- TypeScript
|
||||
- Tailwind CSS + shadcn/ui
|
||||
- MySQL 8.0
|
||||
- AI (OpenAI / GLM)
|
||||
|
||||
# 开发规范
|
||||
|
||||
## 代码规范
|
||||
|
||||
- 使用 TypeScript,严格类型检查
|
||||
- 组件使用 "use client" 指令
|
||||
- 样式优先使用 Tailwind CSS
|
||||
- 配置文件存储在 `config.json`
|
||||
|
||||
## Git 提交规范
|
||||
|
||||
```
|
||||
feat: 新功能
|
||||
fix: 修复bug
|
||||
docs: 文档更新
|
||||
refactor: 重构
|
||||
chore: 构建/工具
|
||||
```
|
||||
|
||||
## 配置管理
|
||||
|
||||
- **config.json**: 应用配置(数据库、AI、导出设置)
|
||||
- **环境变量**: 仅首次启动时初始化 config.json
|
||||
- **API**: `/api/config` 用于前端读写配置
|
||||
|
||||
## 目录结构
|
||||
|
||||
```
|
||||
app/
|
||||
├── api/ # API 路由(后端逻辑)
|
||||
├── settings/ # 设置页面
|
||||
└── page.tsx # 首页
|
||||
|
||||
lib/
|
||||
├── config.ts # 配置读写
|
||||
├── database.ts # MySQL 连接
|
||||
└── ai-translate.ts # AI 翻译
|
||||
|
||||
config/ # 配置文件
|
||||
data/ # 上传文件
|
||||
```
|
||||
|
||||
## 关键约束
|
||||
|
||||
1. **配置分离**: 数据库配置、AI配置、导出设置分离存储
|
||||
2. **API 优先**: 导出时先调用 API 获取最新配置
|
||||
3. **防抖**: 搜索等高频操作需添加防抖
|
||||
4. **Docker**: 应用容器化,数据库使用外部服务
|
||||
|
||||
<!-- BEGIN:nextjs-agent-rules -->
|
||||
# This is NOT the Next.js you know
|
||||
# Next.js 16 注意事项
|
||||
|
||||
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` before writing any code. Heed deprecation notices.
|
||||
本项目使用 Next.js 16,部分 API 可能有破坏性变更。编写代码前查阅 `node_modules/next/dist/docs/` 中的文档。
|
||||
<!-- END:nextjs-agent-rules -->
|
||||
|
||||
Reference in New Issue
Block a user