WeKnora deployment source with the reviewed wiki identity, summary and recovery fixes
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-weknora) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-weknora) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-weknora) / End-to-end inside dsh (latest, advisory) (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Build & Publish (dsh-weknora) / Publish to npm (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s

This commit is contained in:
yawan
2026-09-22 16:19:06 +08:00
commit f7fc992f57
3929 changed files with 1006607 additions and 0 deletions
+93
View File
@@ -0,0 +1,93 @@
---
title: 开发指南
tags: [开发部署, 开发, 本地开发, 环境搭建]
aliases: [开发环境, DevGuide, 开发指南]
source: 开发指南.md
---
# 开发指南
## 快速开发模式(推荐)
如果需要频繁修改 `app` 或 `frontend` 代码,不需要每次都重新构建 Docker 镜像,可以使用本地开发模式。
> 详细的开发模式说明参见 [快速开发模式](../开发部署/快速开发模式.md)
### 方式一:使用 Make 命令(推荐)
```bash
# 终端 1:启动基础设施
make dev-start
# 终端 2:启动后端
make dev-app
# 终端 3:启动前端
make dev-frontend
```
### 方式二:使用脚本命令
```bash
./scripts/dev.sh start # 启动基础设施
./scripts/dev.sh app # 启动后端
./scripts/dev.sh frontend # 启动前端
```
## 访问地址
| 服务 | 地址 |
|------|------|
| 前端开发服务器 | http://localhost:5173 |
| 后端 API | http://localhost:8080 |
| PostgreSQL | localhost:5432 |
| Redis | localhost:6379 |
| MinIO Console | http://localhost:9001 |
| Neo4j Browser | http://localhost:7474 |
> Neo4j 的使用参见 [知识图谱](../核心功能/知识图谱.md) 和 [开启知识图谱功能](../核心功能/开启知识图谱功能.md)
## 使用 Air 实现后端热重载
```bash
go install github.com/air-verse/air@latest
make dev-app # 检测到 Air 时自动启用热重载
```
## 前端独立开发
```bash
cd frontend
npm run dev # 连接到 http://localhost:8080 的后端 API
```
## 生产环境部署
```bash
sh scripts/build_images.sh # 构建所有镜像
sh scripts/start_all.sh # 启动生产环境
```
## 常见问题
- **启动 dev-app 时报错连接不到数据库**:确保先运行了 `make dev-start`
- **前端 CORS 错误**:检查 `vite.config.ts` 中的代理配置
- **DocReader 需要重新构建**:`sh scripts/build_images.sh -d`
> 更多排查建议参见 [常见问题](../运维排障/常见问题.md)
## 相关主题
- [快速开发模式](../开发部署/快速开发模式.md) — 开发模式的架构说明
- [知识图谱](../核心功能/知识图谱.md) — 开发环境中的 Neo4j 配置
- [Agent技能系统](../核心功能/Agent技能系统.md) — 沙箱镜像的构建
---
## 反向链接
- [Home](../Home.md) — Wiki 首页导航
- [快速开发模式](../开发部署/快速开发模式.md) — 开发模式的架构对比说明
- [知识图谱](../核心功能/知识图谱.md) — 开发环境中的 Neo4j 启动
- [开启知识图谱功能](../核心功能/开启知识图谱功能.md) — 开发环境中启用图谱功能
- [常见问题](../运维排障/常见问题.md) — 开发相关故障排查
@@ -0,0 +1,84 @@
---
title: 快速开发模式
tags: [开发部署, 开发, 热更新, Air]
aliases: [快速开发, QuickDev, dev模式]
source: 快速开发模式说明.md
---
# 快速开发模式
解决开发流程中,每次修改 `app`(后端)或 `frontend`(前端)代码后,都需要打包 Docker 镜像的问题,实现这两个模块的热更新。
> 本页是 [开发指南](../开发部署/开发指南.md) 的补充,提供更详细的架构说明
## 使用方法
### 方式 1:Make 命令(推荐)
```bash
make dev-start # 终端 1:启动基础设施
make dev-app # 终端 2:启动后端
make dev-frontend # 终端 3:启动前端
```
### 方式 2:开发脚本
```bash
./scripts/dev.sh start # 终端 1
./scripts/dev.sh app # 终端 2
./scripts/dev.sh frontend # 终端 3
```
### 方式 3:一键启动
```bash
./scripts/quick-dev.sh
```
### 使用 Air 实现后端热重载
```bash
go install github.com/air-verse/air@latest
make dev-app # 自动检测 Air 并使用
```
## 架构对比
### 开发模式
```
本地后端 App (:8080) ← 本地前端 UI (:5173) → Docker 基础设施容器
(PostgreSQL/Redis/MinIO/Neo4j/DocReader)
```
- 后端/前端在本地直接运行,修改后秒级生效
- 基础设施仍使用 Docker 容器
### 生产模式
```
容器后端 App (:8080) ← 容器前端 UI (:80) → 基础设施容器
```
- 所有服务均运行在 Docker 容器中
- 每次修改需要重新构建镜像
## 效率对比
| 方式 | 每次修改耗时 |
|------|------------|
| 旧方式(重建镜像) | 2-5 分钟 |
| 新方式(本地开发) | 后端 5-10 秒,前端实时热重载 |
## 相关主题
- [开发指南](../开发部署/开发指南.md) — 完整的开发环境搭建指南
- [常见问题](../运维排障/常见问题.md) — 开发模式相关问题排查
---
## 反向链接
- [Home](../Home.md) — Wiki 首页导航
- [开发指南](../开发部署/开发指南.md) — 完整开发指南(本页的补充说明)
- [常见问题](../运维排障/常见问题.md) — 开发模式相关故障排查