Files
DP/README.md

135 lines
3.0 KiB
Markdown
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.
# DesignerCEP 项目文档(当前仓库版)
本仓库是一个包含前端、后端、管理工具和 PLT 处理服务的多模块项目。
## 1. 模块说明
| 模块 | 路径 | 技术栈 | 用途 |
|---|---|---|---|
| Designer | `Designer/` | Vue3 + Vite + TS | 主前端/CEP 面板 |
| AdminPanel | `AdminPanel/` | Vue3 + Vite + TS | 管理面板前端 |
| Server | `Server/` | FastAPI + SQLAlchemy | 主后端 API |
| AdminTool | `AdminTool/` | PyQt5 + Paramiko | 管理/部署 GUI 工具 |
| PltService | `PltService/` | FastAPI + OpenCV + Shapely | 独立 PLT 裁片处理服务 |
## 2. 推荐环境
- Node.js 18+
- Python 3.12(与 `Server/Dockerfile` 保持一致)
- Docker + Docker Compose用于后端容器部署
## 3. 快速本地启动
### 3.1 启动后端Server
```bash
cd Server
pip install -r requirements.txt
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
```
健康检查:
```bash
curl http://localhost:8000/health
```
### 3.2 启动主前端Designer
```bash
cd Designer
npm install
npm run dev
```
默认开发地址:`http://localhost:5173`
### 3.3 启动管理前端AdminPanel
```bash
cd AdminPanel
npm install
npm run dev
```
默认开发地址:`http://localhost:5180`
### 3.4 启动管理工具AdminTool可选
```bash
cd AdminTool
pip install -r requirements.txt
python admin_gui.py
```
仅进入部署页:
```bash
python deploy_tool.py
```
### 3.5 启动 PLT 微服务(可选)
```bash
cd PltService
pip install -r requirements.txt
python main.py
```
默认端口:`8080`
## 4. 构建说明
### Designer
```bash
cd Designer
npm run build
```
产物目录:`Designer/dist_core/`
### AdminPanel
```bash
cd AdminPanel
npm run build
```
产物目录:`AdminPanel/dist/`
## 5. 后端 Docker 部署Server
```bash
cd Server
docker-compose up -d --build
docker-compose ps
```
## 6. 配置与安全说明
- 运行配置请优先参考 `Server/.env.example`,再在本地复制为 `Server/.env`
- `Server/.env` 中包含核心配置数据库、密钥、邮件、AI 服务等)。
- 当前仓库中的 `.env` 若包含真实密钥,不适合继续共享。建议立即轮换所有密钥,并改为仅保留 `.env.example` 模板。
- 生产环境请务必修改:
- `SECRET_KEY`
- `ADMIN_TOKEN`
- 数据库账号密码
- AI/云存储密钥
## 7. 数据库迁移
- 正式环境推荐使用 Alembic`cd Server && .venv\Scripts\python -m alembic upgrade head`
- 本地 SQLite 仍保留轻量补列兜底逻辑,但它只适合开发调试
- 迁移细节见 `Server/migrations/README.md`
## 8. 备注
- 旧文档里提到的 `auto_deploy_core.py``npm run build:core` 与当前代码不一致,已以本文件和各子模块 README 为准。
## 9. 最近前端更新2026-03-09
- `Designer` 登录页已支持“记住账号 / 记住密码”。
- `Designer` 个人中心已做风格统一,移除顶部统计卡片,减少视觉干扰。
- `Designer` AI 助手已开始拆分为头部 / 消息流 / 输入区组件,工具状态改为按会话隔离。