37f7aa332938b33aec27106ee21fdd179b5e0e57
CI/CD Pipeline / Check if frontend-only change (push) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 1s
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (push) Has been skipped
CI/CD Pipeline / PR Build Web Image (push) Has been skipped
CI/CD Pipeline / PR Build Worker Image (push) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 3s
CI/CD Pipeline / Frontend Lint (push) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 3s
CI/CD Pipeline / Validate - Style (pull_request) Has been skipped
CI/CD Pipeline / Validate - Security (pull_request) Has been skipped
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Has been skipped
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Check push changed paths (push) Successful in 21s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 35s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 52s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 54s
CI/CD Pipeline / Build Staging API Image (push) Successful in 1m22s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (push) Successful in 3m0s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m28s
CI/CD Pipeline / Validate - Python (mypy + alembic) (push) Successful in 3m31s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been skipped
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 3m47s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 3m0s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 3m51s
CI/CD Pipeline / CI Gate (pull_request) Successful in 3s
CI/CD Pipeline / Validate - Style (push) Successful in 4m18s
CI/CD Pipeline / Frontend Unit Tests (push) Failing after 5m12s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 5m11s
AI Code Review / AI Code Review (pull_request) Successful in 6m13s
CI/CD Pipeline / Unit Tests (push) Successful in 10m58s
CI/CD Pipeline / Validate - Security (push) Successful in 17m26s
CI/CD Pipeline / Build Production API Image (push) Has been skipped
CI/CD Pipeline / Build Production Web Image (push) Has been skipped
CI/CD Pipeline / Build Production Worker Image (push) Has been skipped
CI/CD Pipeline / CI Gate (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 47m30s
CI/CD Pipeline / Retag skipped Staging API Image (push) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (push) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 2m26s
CI/CD Pipeline / Staging E2E Tests (push) Has been cancelled
CI/CD Pipeline / Staging API Integration Tests (push) Has been cancelled
CI/CD Pipeline / ACR Image Cleanup (push) Has been cancelled
CI/CD Pipeline / Canary Release to Production (push) Has been cancelled
三栏暗色科技风布局 + 完整 v1.2/v1.3 创作流程:
【布局】
- 左栏:历史记录(30条最近任务,点击恢复,状态色标)+ 新建按钮
- 中栏:素材上传 + 文案融合 + 参数表单 + 参考视频(v1.3)
- 右栏:预览窗口 + 11阶段进度条 + 成片下载/重试
- 整体暗色渐变背景 (#0b0f1a→#0f172a),紫色品牌色 (#6366f1/#8b5cf6),
磨砂玻璃卡片 + 紫色光晕装饰线;响应式≤1024px自动竖向堆叠
【v1.2 核心功能】
- 图片上传:1-9 张产品图,支持点击/拖拽上传、预览、删除、HTML5 拖拽排序
- 文案融合:三档分段按钮(AI全写 / 我打草稿AI润色 / 按我的话来),textarea 自适应提示
- 参数表单:行业/目标客户/爆款结构/营销目的/BGM偏好/时长(15-90s)6 字段网格
- 提交后 11 阶段进度条(图片分析→视频风格→意图理解→文案→分镜→审核→
配音→BGM→渲染→数字人→上传),shimmer 动画 + 阶段节点脉冲
- AI 意图摘要卡片(wait_user_confirm 状态):展示目标人群/核心卖点/营销钩子,
用户可直接修改 AI 润色文案后点击「确认并继续生成」调用 confirm-intent
- 失败重试、成片下载、新任务重置
【v1.3 参考视频扩展】
- 参考视频上传(复用 /assets/upload 接口),内嵌 <video controls> 预览,可移除重传
- 风格强度三档(轻度参考 / 中度模仿 / 像素级复刻)
- 风格模板库(GET /style-templates),卡片网格展示缩略图/名称/描述,
选中态紫色描边,默认「不使用模板」
- 风格分析在后端 video_analysis 阶段自动触发(_emit_progress 已实现),
前端轮询会自动拿到 style_guide 更新
【技术】
- 新增 services 层 src/api/viral-video/(types.ts + index.ts),
与后端 Pydantic schema 严格对齐
- useViralVideoPolling hook:HTTP 轮询(1.5s 间隔,指数退避容错),
解析 status/stage 插值为 0-100 总进度;支持 onComplete/onWaitConfirm/onFailed 回调
- 路由:/app/viral-video,加入 Sidebar「创作工具」分组 + Header 导航 + 面包屑
- 新增 FireOutlined 图标入口
- 轮询兜底:后端 WS endpoint 尚未暴露,先 HTTP 轮询;
待 /ws/viral-video/{id} 上线后切 WS(hook 已预留切换点)
【验证】
- tsc --noEmit ✅
- eslint ✅(0 error 0 warning)
- prettier --write ✅
- vite build ✅(独立 chunk ViralVideoPage-BMawaWN9.js 20KB gz 7KB)
小虾 SaaS - 自动化视频剪辑平台
自动化视频剪辑 SaaS 平台,支持素材上传、AI 分类、智能剪辑计划生成、自动化视频合成与成片管理。
✨ 核心功能
🎬 视频剪辑主链路
- 素材上传(直传 OSS + 分片上传大文件,最大 2GB)
- AI 智能分类与质量评分
- 4 种剪辑模式:one_take / pip(画中画)/ voice_over(口播+B-roll)/ voice_pip
- 剪辑计划模板 + 智能生成
- 自动化视频合成任务(Celery 异步)
- 成片下载与审核管理
- 资产诊断(素材就绪度评估、缺口分析)
🔐 认证系统
- JWT Bearer Token 认证
- 邮箱注册 + 邮箱验证
- 密码重置(邮箱找回)
- bcrypt 密码加密
📋 项目管理
- 项目 CRUD + 共享
- 任务管理(创建/更新/状态流转/进度追踪)
- 里程碑管理
- 任务问题追踪
📊 素材库管理
- 素材库创建与管理
- 素材上传、审核状态流转(pending_review → approved/rejected)
- 素材诊断(就绪度评分、缺口分析、智能视图)
🚀 快速开始
方式 1: Docker Compose(推荐)
# 1. 克隆仓库
git clone https://git.xiaoxiajianji.com/xiaoxia/xiaoxia-saas.git
cd xiaoxia-saas
# 2. 配置环境变量
cp .env.example .env
# 编辑 .env 填写数据库、Redis、OSS 等配置
# 3. 启动所有服务
docker-compose up -d
# 4. 访问 API 文档
open http://localhost:8000/docs
方式 2: 本地开发
# 1. 克隆仓库
git clone https://git.xiaoxiajianji.com/xiaoxia/xiaoxia-saas.git
cd xiaoxia-saas
# 2. 创建虚拟环境
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# 3. 安装依赖
pip install -r requirements.txt
# 4. 配置环境变量
cp .env.example .env
# 5. 启动 API 服务
uvicorn apps.api.main:app --reload
# 6. 访问 API 文档
open http://localhost:8000/docs
📚 API 文档
交互式文档
- Swagger UI: https://saas-api.xiaoxiajianji.com/docs
- OpenAPI Schema: https://saas-api.xiaoxiajianji.com/openapi.json
核心 API 路径
认证 (/api/v1/auth)
| 方法 | 路径 | 说明 |
|---|---|---|
| POST | /register |
用户注册 |
| POST | /login |
用户登录 |
| GET | /me |
获取当前用户信息 |
| POST | /password/forgot |
忘记密码 |
| POST | /password/reset |
重置密码 |
视频剪辑主链路
上传素材 → POST /api/v1/upload(直传)或 /api/v1/upload/chunk/init(分片)
↓
创建素材 → POST /api/v1/assets
↓
AI 分类 → POST /api/v1/classification-jobs
↓
生成剪辑计划 → POST /api/v1/projects/{id}/edit-plans/auto-generate
↓
创建生成任务 → POST /api/v1/generation/tasks/
↓
查询结果 → GET /api/v1/generation/tasks/{task_id}/results/
↓
获取成片 → GET /api/v1/generated-videos/{video_id}/download-url
项目管理 (/api/v1/project-management)
| 方法 | 路径 | 说明 |
|---|---|---|
| GET/POST | /tasks |
任务列表/创建 |
| PATCH | /tasks/{id} |
更新任务信息 |
| PATCH | /tasks/{id}/status |
更新任务状态 |
| PATCH | /tasks/{id}/progress |
更新任务进度 |
| GET/POST | /milestones |
里程碑列表/创建 |
| GET/POST | /issues |
问题列表/创建 |
| PATCH | /issues/{id}/resolve |
解决问题 |
素材与上传
| 方法 | 路径 | 说明 |
|---|---|---|
| POST | /api/v1/upload |
直传素材(multipart/form-data) |
| POST | /api/v1/upload/direct/prepare |
准备 OSS 直传签名 |
| POST | /api/v1/upload/direct/complete |
确认直传完成 |
| POST | /api/v1/upload/chunk/init |
初始化分片上传 |
| POST | /api/v1/upload/chunk/{id}/{index} |
上传分片 |
| POST | /api/v1/upload/chunk/{id}/complete |
完成分片上传 |
| GET | /api/v1/assets |
素材列表 |
| PATCH | /api/v1/assets/{id}/review |
更新素材审核状态 |
| GET | /api/v1/projects/{id}/asset-diagnosis |
资产诊断 |
成片管理 (/api/v1/generated-videos)
| 方法 | 路径 | 说明 |
|---|---|---|
| GET | / |
成片列表 |
| GET | /{video_id} |
成片详情 |
| GET | /{video_id}/download-url |
下载链接 |
| PATCH | /{video_id}/review |
审核状态 |
完整 API 列表请查看 API 主线清单
🏗️ 架构
小虾 SaaS
├── packages/ # 核心业务逻辑(Clean Architecture)
│ ├── domain/ # 领域模型(dataclass)
│ ├── application/ # 用例(Use Cases)
│ ├── ports/ # 接口定义(抽象端口)
│ └── adapters/ # 适配器实现(SQLAlchemy、Redis、SMTP 等)
├── apps/ # 应用层
│ ├── api/ # FastAPI 应用 + 路由 + Pydantic schemas
│ ├── web/ # React + Vite 前端
│ └── worker/ # Celery 异步任务(视频处理、分类等)
├── migrations/ # Alembic 数据库迁移
├── tests/ # 测试
│ ├── unit/ # 单元测试
│ ├── integration/ # 集成测试
│ └── e2e/ # 端到端测试
└── docs/ # 文档
设计模式:
- Clean Architecture(依赖方向:外层 → 内层)
- 依赖注入(FastAPI Depends)
- Repository 模式(通过 ports 抽象)
- Domain-Driven Design
🛠️ 技术栈
后端:
- Python 3.12 + FastAPI 0.115.0
- PostgreSQL 16(生产)
- Redis 7(缓存 + Celery Broker)
- Celery(异步任务:视频处理、素材导入、分类)
- 阿里云 OSS(文件存储)
前端:
- React 18 + TypeScript
- Vite(构建工具)
- Ant Design(UI 组件)
部署:
- Docker + Docker Compose
- Gitea + Gitea Actions(CI/CD)
- Nginx(反向代理)
🧪 测试
# 运行所有测试
pytest tests/ -v
# 运行单元测试
pytest tests/unit -v
# 运行集成测试
pytest tests/integration -v
# 生成覆盖率报告
pytest --cov=packages --cov-report=html
📊 当前状态
| 模块 | 状态 |
|---|---|
| 视频剪辑主链路(Phase 7) | ✅ 已完成 |
| 分片上传(最大 2GB) | ✅ 已完成 |
| 4 种剪辑模式 | ✅ 已完成 |
| 项目管理 + 任务追踪 | ✅ 已完成 |
| 资产诊断 | ✅ 已完成 |
| 认证系统(JWT) | ✅ 已完成 |
| CI/CD 流水线 | ✅ 运行中 |
| 前端界面(Vite) | ✅ 已完成 |
📄 更多文档
🤝 贡献
欢迎贡献!请查看 贡献指南
仓库地址: https://git.xiaoxiajianji.com/xiaoxia/xiaoxia-saas
License: MIT
Releases
7
v2.1.0-test.9
Latest
Languages
Python
78.5%
TypeScript
15.8%
CSS
2.8%
Shell
2.7%
Dockerfile
0.1%
Other
0.1%