2026-07-08 20:02:29 +08:00
2026-07-08 20:02:29 +08:00
2026-07-08 20:02:29 +08:00
2026-07-08 20:02:29 +08:00
2026-07-08 20:02:29 +08:00
2026-07-08 20:02:29 +08:00
2026-07-08 20:02:29 +08:00
2026-07-08 20:02:29 +08:00
2026-07-08 20:02:29 +08:00

AI 智能文档生成系统 (Doc Forge Reborn)

项目简介

Doc Forge Reborn 是一款外部 Web 工具,支持上传 Word 模板、在线编辑与预览,通过可视化方式标注文档中需要 AI 生成内容的区域,并可配置不同的 AI 模型进行内容生成。系统提供模型管理、模板管理、生成点管理、异步任务执行等完整功能,最终导出的文档保持原样式。

核心功能

  • 📤 上传 Word 模板,在线编辑并预览
  • 🎯 框选标注生成点,配置提示词、参考文件和指定 AI 模型
  • 🤖 AI 模型管理(多供应商:OpenAI、Azure、自定义)
  • ⚙️ 异步任务生成,状态追踪,结果下载

技术栈

  • 前端React 18 + TypeScript + Ant Design + TinyMCE
  • 后端Python 3.12 + FastAPI + SQLAlchemy
  • 异步任务Celery + Redis
  • 数据库PostgreSQL 16
  • 文档处理Mammoth + python-docx + reportlab
  • 部署Docker + Docker Compose + Nginx

快速开始

环境要求

  • Docker & Docker Compose
  • Python 3.12+ (本地开发)
  • Node.js 22+ (本地开发)

生产部署(一键启动)

cp .env.example .env           # 编辑 SECRET_KEY
./deploy.sh                    # 构建镜像 + 启动 + 数据库迁移

访问 http://localhost:3000

本地开发

# 1. 启动依赖服务
docker compose up -d postgres redis

# 2. 后端
cd backend
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
alembic upgrade head
uvicorn app.main:app --reload

# 3. Celery Worker(新终端)
cd backend && source venv/bin/activate
celery -A app.tasks.celery_app worker --loglevel=info

# 4. 前端(新终端)
cd web && npm install && npm run dev

项目目录结构

.
├── backend/                    # Python 后端
│   ├── app/
│   │   ├── api/                # API 路由
│   │   ├── core/               # 配置、安全、数据库
│   │   ├── models/             # ORM 模型
│   │   ├── schemas/            # Pydantic 模式
│   │   ├── services/           # 业务逻辑
│   │   ├── tasks/              # Celery 任务
│   │   └── main.py
│   ├── migrations/             # Alembic 迁移
│   ├── requirements.txt
│   └── Dockerfile
├── web/                        # React 前端
│   ├── src/
│   │   ├── api/                # API 调用封装
│   │   ├── components/         # 可复用 UI
│   │   ├── pages/              # 页面
│   │   ├── hooks/              # 自定义 Hooks
│   │   └── store/              # 状态管理
│   ├── package.json
│   └── Dockerfile
├── docker-compose.yml
└── docs/                       # 项目文档

文档索引

S
Description
对比 doc-forge 富文本编辑组件,文本标注ai块
Readme 248 KiB
Languages
Python 60.6%
TypeScript 37.5%
Dockerfile 0.8%
Shell 0.4%
Mako 0.4%
Other 0.3%