You've already forked DataMate
修复从全新部署到运行的完整流程中的配置和路由问题。 ## P0 修复(功能失效) ### P0-1: GraphRAG KG 服务 URL 错误 - config.py - GRAPHRAG_KG_SERVICE_URL 从 http://datamate-kg:8080 改为 http://datamate-backend:8080(容器名修正) - kg_client.py - 修复 API 路径:/knowledge-graph/... → /api/knowledge-graph/... - kb_access.py - 同类问题修复:/knowledge-base/... → /api/knowledge-base/... - test_kb_access.py - 测试断言同步更新 根因:容器名 datamate-kg 不存在,且 httpx 绝对路径会丢弃 base_url 中的 /api 路径 ### P0-2: Vite 开发代理剥离 /api 前缀 - vite.config.ts - 删除 /api/knowledge-graph 专用代理规则(剥离 /api 导致 404),统一走 ^/api 规则 ## P1 修复(功能受损) ### P1-1: Gateway 缺少 KG Python 端点路由 - ApiGatewayApplication.java - 添加 /api/kg/** 路由(指向 kg-extraction Python 服务) - ApiGatewayApplication.java - 添加 /api/graphrag/** 路由(指向 GraphRAG 服务) ### P1-2: DATA_MANAGEMENT_URL 默认值缺 /api - KnowledgeGraphProperties.java - dataManagementUrl 默认值 http://localhost:8080 → http://localhost:8080/api - KnowledgeGraphProperties.java - annotationServiceUrl 默认值 http://localhost:8081 → http://localhost:8080/api(同 JVM) - application-knowledgegraph.yml - YAML 默认值同步更新 ### P1-3: Neo4j k8s 安装链路失败 - Makefile - VALID_K8S_TARGETS 添加 neo4j - Makefile - %-k8s-install 添加 neo4j case(显式 skip,提示使用 Docker 或外部实例) - Makefile - %-k8s-uninstall 添加 neo4j case(显式 skip) 根因:install 目标无条件调用 neo4j-$(INSTALLER)-install,但 k8s 模式下 neo4j 不在 VALID_K8S_TARGETS 中,导致 "Unknown k8s target 'neo4j'" 错误 ## P2 修复(次要) ### P2-1: Neo4j 加入 Docker install 流程 - Makefile - install target 增加 neo4j-$(INSTALLER)-install,在 datamate 之前启动 - Makefile - VALID_SERVICE_TARGETS 增加 neo4j - Makefile - %-docker-install / %-docker-uninstall 增加 neo4j case ## 验证结果 - mvn test: 311 tests, 0 failures ✅ - eslint: 0 errors ✅ - tsc --noEmit: 通过 ✅ - vite build: 成功 (17.71s) ✅ - Python tests: 46 passed ✅ - make -n install INSTALLER=k8s: 不再报 unknown target ✅ - make -n neo4j-k8s-install: 正确显示 skip 消息 ✅
🚀 快速开始
npm install # 安装依赖
npm run dev # 启动项目
npm run mock # 启动后台Mock服务(可选)
📁 项目结构
frontend/
├── public/ # 📖 文档中心
│ └── xxx/ # 标注工作台(可分离部署)
│
├── src/ # 🎨 前端应用
│ ├── apps/ # 多前端应用
│ │ ├── console/ # 数据工作台&运营控制台
│ │ │ ├── next.config.js
│ │ │ ├── package.json
│ │ │ └── src/
│ │ └── annotation-studio/ # 标注工作台(可分离部署)
│ │
│ ├── assets/ # 共享UI组件/SDK
│ │ ├── xxx/ # 数据工作台&运营控制台
│ │ │ ├── next.config.js
│ │ │ └── src/
│ │ │
│ │ │
│ │ └── xxx/ # 数据工作台&运营控制台
│ │ ├── package.json
│ │ └── src/
│ │
│ ├── components/ # 构建与环境配置
│ │ ├── CardView.tsx # 数据工作台&运营控制台
│ │ ├── DetailHeader.tsx # 数据工作台&运营控制台
│ │ ├── RadioCard.tsx # 数据工作台&运营控制台
│ │ ├── SearchControls # 数据工作台&运营控制台
│ │ ├── TagList # 标注工作台(可分离部署)
│ │ └── TaskPopover # 标注工作台(可分离部署)
│ │
│ ├── hooks/ # 构建与环境配置
│ │ ├── console/ # 数据工作台&运营控制台
│ │ ├── next.config.js
│ │ ├── next.config.js
│ │ ├── next.config.js
│ │ ├── next.config.js
│ │ ├── next.config.js
│ │ └── annotation-studio/ # 标注工作台(可分离部署)
│ │
│ ├── mock/ # 构建与环境配置
│ │ ├── console/ # 数据工作台&运营控制台
│ │ ├── next.config.js
│ │ ├── next.config.js
│ │ ├── next.config.js
│ │ ├── next.config.js
│ │ └── annotation-studio/ # 标注工作台(可分离部署)
│ │
│ ├── pages/ # 构建与环境配置
│ │ ├── console/ # 数据工作台&运营控制台
│ │ │ ├── next.config.js
│ │ │ ├── package.json
│ │ │ └── src/
│ │ └── annotation-studio/ # 标注工作台(可分离部署)
│ │
│ ├── providers/ # 构建与环境配置
│ │ ├── console/ # 数据工作台&运营控制台
│ │ │ ├── next.config.js
│ │ │ ├── package.json
│ │ │ └── src/
│ │ └── annotation-studio/ # 标注工作台(可分离部署)
│ │
│ ├── routes/ # 构建与环境配置
│ │ └── next.config.js
│ │
│ ├── types/ # 构建与环境配置
│ │ ├── next.config.js
│ │ ├── next.config.js
│ │ ├── next.config.js
│ │ ├── next.config.js
│ │ └── next.config.js
│ │
│ └── utils/ # 构建与环境配置
│ ├── next.config.js
│ ├── next.config.js
│ └── next.config.js
│
├── eslint.config.js/ # 🔧 后端服务架构
├── index.html/ # 🔧 后端服务架构
├── package.json/ # 🔧 后端服务架构
├── README.md # 项目说明
├── tailwind.config.ts # 更新日志
├── vite.config.ts # 开源协议
└── pom.xml # Maven根配置