Files
model-platform/REFACTOR_NOTES.md
T

57 lines
1.8 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.
# 本次重构说明
## 已完成
### 前端
- 将原 `frontend/src` 页面迁入 React Router SPA 结构;
- 主入口改为 `app/routes/platform.tsx`
- 拆分为 `components / features / routes / services / styles`
- 保留脚本管理、目录管理、Jupyter 编辑、版本发布、调度画布、运行记录和系统管理功能;
- 将原 Hash 页面切换改为 React Router 路径:`/``/scripts``/schedules``/system`
- Nginx 使用 SPA fallback,刷新子路径不会 404。
### 后端
- 合并 Platform API 和 Storage API 到同一个 `backend` 进程;
- 删除 Redis 容器、依赖、Streams 消费和锁实现;
- 文件锁改为 MySQL `edit_sessions` 租约;
- Jupyter 短期票据由单 Runtime 进程内存保存;
- Schedule Executor 内置 APScheduler,并使用 MySQL `apscheduler_jobs`
- Backend 创建运行和 Outbox 后,通过内部 HTTP 尝试立即推送;
- Schedule Executor 轮询 MySQL Outbox 作为失败兜底;
- 增加迁移 `20260730_0004`,兼容旧数据库的 `redis_lock_key -> lock_key`
### Docker
最终容器:
```text
mysql
rustfs
jupyter
migrate(一次性)
backend
runtime
schedule
gateway
```
## 已执行检查
- Python 全项目 `compileall` 通过;
- SQLAlchemy 模型导入通过,共加载 26 张表;
- Alembic `upgrade head --sql` 离线生成通过;
- `docker-compose.yml` YAML 解析通过;
- 前端 feature、route 和 root 文件 TypeScript 静态检查通过。
## 未在当前沙箱执行
当前执行环境没有 Docker 命令,并且无法连接 npm/PyPI,因此没有在沙箱内完成:
- `docker compose up --build`
- 正式 `pnpm install && pnpm build`
- Python 依赖在线安装后的集成测试。
请在安装了 Docker Desktop且网络可访问依赖仓库的 Windows 电脑上执行根目录 README 中的启动命令。