跳到主要内容

系统架构

整体架构​

┌─────────────────────────────────────────────────────────────┐
│ 用户浏览器 │
└───────────┬─────────────────────────────┬───────────────────┘
│ │
▼ ▼
┌───────────────────┐ ┌───────────────────┐
│ Frontend (5173) │ │ Admin (8080) │
│ React + Vite │ │ React + Vite │
│ React Flow │ │ shadcn/ui │
│ ECharts │ │ Recharts │
└─────────┬─────────┘ └─────────┬─────────┘
│ │
└──────────┬──────────────────┘
▼
┌───────────────────┐
│ Backend (8000) │
│ FastAPI │
│ SQLAlchemy 2.0 │
│ Celery Client │
└────────┬──────────┘
│
┌──────────┼──────────┐
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│PostgreSQL│ │ Redis │ │ MinIO │
│ (5432) │ │ (6379) │ │ (9000) │
└──────────┘ └──────────┘ └──────────┘
│
▼
┌───────────────────┐
│ Celery Workers │
│ ┌─────┬─────┬────┐│
│ │ GPU │ CPU │Files││
│ └─────┴─────┴────┘│
└───────────────────┘

技术栈详情​

前端 (apps/frontend)​

技术版本用途
React18UI 框架
TypeScript5.x类型安全
Vite5.x构建工具
React Flow11.x工作流编辑器
ECharts5.x数据可视化
Zustand4.x状态管理
React Router7.x路由
Tailwind CSS4.x样式
i18next—国际化

管理后台 (apps/admin)​

技术版本用途
React18UI 框架
Vite5.x构建工具
shadcn/ui—UI 组件库
Recharts—图表
CodeMirror—代码编辑器

后端 (apps/backend)​

技术版本用途
FastAPI0.111.0Web 框架
SQLAlchemy2.0ORM (async, asyncpg)
Celery5.4.0任务队列
Alembic—数据库迁移
python-jose—JWT 认证
passlib—密码哈希

AI 引擎 (packages/ai-engine)​

技术版本用途
PyTorch2.x深度学习框架
MONAI—医学影像深度学习
nnU-Netv2自适应分割框架
PyRadiomics—影像组学特征提取

数据流​

用户上传 DICOM
│
▼
Backend 接收文件 → 存储到 MinIO
│
▼
创建 Celery Task (files worker)
│
▼
Files Worker: DICOM 解析 → 数据预处理
│
▼
更新数据库状态 → 通知前端
│
▼
用户配置工作流 → 提交训练任务
│
▼
GPU/CPU Worker: 执行训练
│
▼
训练完成 → 回调 Backend → 更新状态
│
▼
前端展示结果 → 导出图表

项目结构​

radstudio/
├── apps/
│ ├── frontend/ # 用户前端
│ ├── admin/ # 管理后台
│ ├── backend/ # FastAPI 后端
│ └── docs/ # 文档站(Docusaurus)
├── packages/
│ └── ai-engine/ # AI 引擎(共享 ML 代码)
├── workers/
│ ├── gpu/ # GPU 训练 Worker
│ ├── cpu/ # CPU 训练 Worker
│ ├── files/ # 文件处理 Worker
│ ├── agent/ # 节点管理 Agent
│ └── celery/ # 默认开发 Worker
├── deploy/ # 部署配置
├── scripts/ # CLI 工具
└── docs/ # 开发文档(非站点)