docs: update architecture docs for Vue 3 + FastAPI separation, add one-click start.bat

- CLAUDE.md: remove duplicate architecture section, fix MAX_RETRY 5→3
- README.md: update architecture diagram to 3-tier, add start.bat instructions
- ROADMAP.md: add 阶段六 layered generation v5 (items 16-20)
- start.bat: one-click startup with auto port-kill and path-with-spaces fix
- package-lock.json: updated from npm install
This commit is contained in:
2026-05-21 22:10:22 +08:00
parent 74f3f03d2c
commit 7c1aa7d934
5 changed files with 101 additions and 62 deletions
+35 -23
View File
@@ -18,18 +18,20 @@
## 架构
```
Streamlit 界面 (app.py)
|
LangGraph 代理 (agent/)
|-- retrieve (Chroma/embeddings)
|-- generate / generate_skeleton → refine_layout → map_fields (分层生成)
|-- validate (FastAPI service)
|-- explain + correct (auto-fix loop)
|-- modify (multi-turn edits)
|
前端 (Vue 3 + Vite, 端口 5173)
│ 聊天界面 + SSE 流式显示 + 文件上传/粘贴/拖拽
▼ HTTP + SSE
后端 API (FastAPI, 端口 8000)
│ REST 接口 + SSE 流式推送
│ 包装 LangGraph Agent ──► agent/
├─ retrieve (Chroma/embeddings)
├─ generate / generate_skeleton → refine_layout → map_fields (分层生成)
│ ├─ validate (FastAPI service)
│ ├─ explain + correct (auto-fix loop)
│ └─ modify (multi-turn edits)
FastAPI 验证服务 (:8001)
|-- Structural checks (field references, SQL, page dimensions)
|-- XSD schema validation (if jasperreport.xsd available)
└─ Structural checks + XSD schema validation
```
## 前置要求
@@ -60,21 +62,24 @@ cp .env.example .env
python scripts/init_kb.py
```
### 4. 启动验证服务
### 4. 启动服务
**一键启动(推荐)**:双击 `start.bat`,自动启动验证服务、后端 API、前端开发服务器。停止用 `stop.bat`
**手动启动**(需要三个终端):
在一个终端中运行:
```bash
python -m uvicorn validation_service.main:app --port 8001
# 终端 1 — 验证服务(必须先启动)
python -m uvicorn validation_service.main:app --port 8001 --host 0.0.0.0
# 终端 2 — 后端 APISSE + REST
python -m uvicorn api_server:app --port 8000 --host 0.0.0.0
# 终端 3 — 前端开发服务器
cd frontend && npm install && npm run dev
```
### 5. 启动 Streamlit 界面
在另一个终端中运行:
```bash
streamlit run app.py
```
在浏览器中打开 http://localhost:8501。
在浏览器中打开 http://localhost:5173。
## 使用示例
@@ -110,7 +115,14 @@ pytest tests/ -v
```
jrxml-agent/
app.py Streamlit 聊天界面(多模态输入
api_server.py FastAPI SSE 后端(REST + 流式推送
start.bat 一键启动脚本
stop.bat 一键停止脚本
frontend/ Vue 3 + Vite 前端(聊天 UI
src/
api/client.ts SSE 客户端 + fetch 封装
stores/ Pinia 状态管理(chat + session
components/ 聊天界面组件(6 个)
agent/
state.py AgentState 定义(28 字段)
nodes.py 图节点(generate, generate_skeleton, refine_layout 等,18 节点)