Files
gangyan/.harness/CLAUDE.md
liuguancen 6337af9481 feat: 新增4个工具(imgcompress/LamaCleaner/webp2jpg/Overleaf/LaTeX公式编辑器) + 应用广场布局优化
新增工具部署:
- imgcompress (端口18087) - 图片压缩、格式转换、AI抠图
- Lama Cleaner (端口18088) - AI图像擦除/去水印
- webp2jpg-online (端口18089) - 图片格式批量互转
- Overleaf (端口18090) - 在线LaTeX论文编辑器(docker-compose + MongoDB 8.0)
- LaTeX公式编辑器 (端口18091) - 纯前端KaTeX公式编辑

应用广场优化:
- 去掉tab切换,所有分类平铺展示
- CSS Grid自适应布局,一行可排3-4个卡片
- 重新分为4个分类:文档处理、图片处理、创作绘图、科研写作

其他:
- 更新 CLAUDE.md 项目配置文档
- PPTist AI后端优化prompt和流式输出格式

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 20:23:06 +08:00

124 lines
5.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 钢研院智能问答平台(战知)
面向科研单位的 LLM 智能问答系统,提供智能对话、文档撰写、知识库管理、文献研读、实用工具广场等功能。
## 项目结构
| 模块 | 路径 | 技术栈 | 端口 |
|------|------|--------|------|
| 前端 | `chat_web_front/` | Vue 3 + TypeScript + Element Plus + Vite | :3000 (上下文 `/metalinfo`) |
| Java 后端 | `chat_web_backend/` | Spring Boot 2.3.7 + MyBatis-Plus + JDK 11 | :8099 (上下文 `/chat_web_backend`) |
| Python RAG | `langchain-chat/` | Python 3.11 + FastAPI + LangChain + Milvus | :7861 |
## 基础设施
| 服务 | 端口 | 说明 |
|------|------|------|
| MySQL 8.4.4 | 33306 | 数据库 `chat_gpt_yj`root/1234567890 |
| Redis | 6379 | 无密码database 0 |
| Milvus 2.6.4 | 19530 | 向量数据库 |
| MinIO | 9002(console)/9003(API) | 对象存储Milvus 依赖) |
| Embedding API | 10.102.24.75:3000 | bge-m3 向量模型 + LLM 网关 |
## LLM 配置
- 网关: `http://10.102.24.75:3000/v1/chat/completions`
- API Key: `sk-BlQIGRrotbVDWE5mXCPBFjVWIvJ83hldzz67xInNwzVo7pPb`
- 主力模型: `deepseek-v3`所有场景统一使用r1 已弃用)
- Embedding: `bge-m3`
- 上下文限制: 32K tokens
## 服务器访问
- SSH 直连: `ssh target-203-8`(已配公钥,自动通过 jump-203-17 跳转)
- 跳板机: `huawei@192.168.203.17`
- 目标机: `hawei@192.168.203.8`
- 项目路径: `/opt/download/oss_files/gangyan-deploy/gangyan/`
- Python: `/opt/software/miniconda3/envs/langchain-chat/bin/python`
- 网络代理: `http://219.234.197.247:53128`
- Docker 镜像源: `docker.1ms.run`Docker Hub 直连不通,必须用镜像源)
## 工具广场 - 已部署工具
### 文档处理
| 工具 | 端口 | 容器名 | 镜像 |
|------|------|--------|------|
| Stirling PDF | 18080 | stirling-pdf | `docker.1ms.run/frooodle/s-pdf` |
| TrWebOCR (中文OCR) | 18083 | trwebocr | `docker.1ms.run/mmmz/trwebocr` |
| LibreTranslate (翻译) | 18084 | libretranslate | `docker.1ms.run/libretranslate/libretranslate` |
LibreTranslate 配置: `LT_LOAD_ONLY=en,zh``LT_HIDE_API=true`,需设 HTTP_PROXY 代理下载语言包。
### 图片处理
| 工具 | 端口 | 容器名 | 镜像 |
|------|------|--------|------|
| imgcompress (压缩/转换/抠图) | 18087 | imgcompress | `imgcompress-nofooter:latest`commit 版,隐藏了 footer |
| Lama Cleaner (AI擦除) | 18088 | lama-cleaner | `docker.1ms.run/cwq1913/lama-cleaner:cpu-0.33.0` |
| webp2jpg-online (格式转换) | 18089 | webp2jpg | `docker.1ms.run/wbsu2003/webp2jpg-online:v1` |
Lama Cleaner 启动命令: `lama-cleaner --model=lama --device=cpu --host=0.0.0.0 --port=8080`需代理下载模型约196MB模型缓存在 volume `lama-models`
### 创作绘图
| 工具 | 端口 | 容器名 | 镜像 |
|------|------|--------|------|
| Excalidraw (白板) | 18081 | excalidraw | `docker.1ms.run/excalidraw/excalidraw` |
| PPTist (AI PPT) | 18085 | pptist | `pptist:latest`(自建镜像) |
PPTist 自建镜像: Dockerfile 在 `scripts/pptist-deploy/`,构建时需代理 + npm 淘宝镜像源。容器内 nginx 反代 `/pptapi/` 到宿主机 18086 端口的 AI 后端。
### 科研写作
| 工具 | 端口 | 容器名 | 镜像 |
|------|------|--------|------|
| Overleaf (LaTeX论文) | 18090 | overleaf | `docker.1ms.run/sharelatex/sharelatex` |
| LaTeX 公式编辑器 | 18091 | latex-editor | `docker.1ms.run/nginx:alpine`(纯前端) |
Overleaf 配置:
- docker-compose 在 `scripts/overleaf-deploy/docker-compose.yml`
- 依赖 MongoDB 8.0(需 replica set+ Redis
- 管理员: `admin@company.com` / `qwerQWER1234`
- 注册: 管理员在 `/admin/register` 手动添加,不支持自助注册
- 没有邮件服务,新用户通过管理员生成的链接设置密码
## AI 代理服务
以 screen 会话运行,重启服务器后需手动恢复。
| 服务 | 端口 | screen 名 | 文件 | 功能 |
|------|------|-----------|------|------|
| Excalidraw AI | 18082 | aiproxy | `scripts/excalidraw-ai-proxy.py` | text-to-diagramMermaid、wireframe-to-code |
| PPTist AI | 18086 | pptist-ai | `scripts/pptist-ai-backend.py` | 大纲生成、PPT 生成JSONL流式、AI 写作 |
启动方式:
```bash
PYTHON=/opt/software/miniconda3/envs/langchain-chat/bin/python
screen -dmS aiproxy $PYTHON scripts/excalidraw-ai-proxy.py
screen -dmS pptist-ai $PYTHON scripts/pptist-ai-backend.py
```
## 前端应用广场
- 文件: `chat_web_front/src/views/applications/index.vue`
- 布局: 所有分类平铺展示CSS Grid 自适应 `repeat(auto-fill, minmax(280px, 1fr))`
- 工具配置是前端静态数据,不走后端数据库
- 点击工具卡片 `window.open` 新标签打开 `${protocol}//${hostname}:${port}`
## 品牌
- 名称: 战知(原"知冶"
- 标语: 聚尖端之力,创多维平台
- 副标语: 聚合科技动能,扩展创新疆界,引领行业跃迁升级
## 项目位置
- Git 仓库: `http://123.57.146.97:3000/liuguancen/gangyan.git`
- 分支: `main`
## 开发注意事项
- 功能未完全验证通过前不要 commit避免无用提交
- 前端用 Vite dev server 跑scp 文件到服务器后自动热更新
- Docker Hub 不通,拉镜像必须加 `docker.1ms.run/` 前缀
- 容器内需要网络时(下载模型/语言包)必须设 `HTTP_PROXY``HTTPS_PROXY` 环境变量
- 跳板机 SSH 经常断连,保持命令简短,避免长时间占用连接
- screen 会话管理 AI 代理服务,`screen -ls` 查看,`screen -r 名称` 进入