选择左侧文档开始阅读
+或点击「+ 根目录文档」创建新文档
+From ecfeca40e246b0945376d6a28b38a748c7a90be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B0=E6=9C=94?= <565183519@qq.com> Date: Sat, 8 Aug 2026 07:09:54 +0800 Subject: [PATCH] =?UTF-8?q?feat(product-source):=20=E5=85=89=E6=B9=96?= =?UTF-8?q?=E7=9F=A5=E8=AF=86=E5=BA=93=E6=A8=A1=E5=9D=97=20v0.1.0=20?= =?UTF-8?q?=E2=80=94=20Git=20=E9=A9=B1=E5=8A=A8=E7=9A=84=E5=AE=8C=E6=95=B4?= =?UTF-8?q?=E7=9F=A5=E8=AF=86=E5=BA=93=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 铸渊 2026-08-08 开发,冰朔架构决策: - Git 是底层引擎,不依赖任何数据库(PostgreSQL/Redis/ORM) - Agent 直达底层,中间不隔第三方服务 - 拆解 Outline v0.80.2 为参考样本,光湖自己实现全部能力 技术栈: - 后端:Express v5 + simple-git + gray-matter(Git 操作层) - 前端:Vite + React 19 + TypeScript + marked - 存储:Markdown 文件 + Git 仓库(commit=版本历史,diff=对比) 功能清单(全部可用): - 文档 CRUD(创建/读取/更新/删除/移动) - 文档树导航(文件夹层级) - Markdown 编辑器(编辑/预览双栏) - 全文搜索(防抖 + 下拉结果) - 版本历史(git log) - 版本 diff 对比(选择两个 commit 对比) API 端点(Agent 和 UI 共用): - GET/POST/PUT/DELETE /api/docs/{*path} - GET /api/tree - GET /api/history/{*path} - GET /api/version/:hash/{*path} - GET /api/diff/{*path}?from=&to= - GET /api/search?q= - POST /api/move - GET /api/health --- .../guanghu-knowledge-base/.gitignore | 7 + .../guanghu-knowledge-base/index.html | 13 + .../guanghu-knowledge-base/package-lock.json | 3812 +++++++++++++++++ .../guanghu-knowledge-base/package.json | 37 + .../server/git-engine.ts | 367 ++ .../guanghu-knowledge-base/server/index.ts | 195 + .../guanghu-knowledge-base/src/App.tsx | 174 + .../guanghu-knowledge-base/src/api.ts | 116 + .../src/components/DocTree.tsx | 87 + .../src/components/Editor.tsx | 105 + .../src/components/SearchBar.tsx | 99 + .../src/components/VersionHistory.tsx | 154 + .../guanghu-knowledge-base/src/main.tsx | 10 + .../guanghu-knowledge-base/src/styles/app.css | 746 ++++ .../guanghu-knowledge-base/tsconfig.json | 23 + .../guanghu-knowledge-base/vite.config.ts | 25 + 16 files changed, 5970 insertions(+) create mode 100644 product-source/guanghu-knowledge-base/.gitignore create mode 100644 product-source/guanghu-knowledge-base/index.html create mode 100644 product-source/guanghu-knowledge-base/package-lock.json create mode 100644 product-source/guanghu-knowledge-base/package.json create mode 100644 product-source/guanghu-knowledge-base/server/git-engine.ts create mode 100644 product-source/guanghu-knowledge-base/server/index.ts create mode 100644 product-source/guanghu-knowledge-base/src/App.tsx create mode 100644 product-source/guanghu-knowledge-base/src/api.ts create mode 100644 product-source/guanghu-knowledge-base/src/components/DocTree.tsx create mode 100644 product-source/guanghu-knowledge-base/src/components/Editor.tsx create mode 100644 product-source/guanghu-knowledge-base/src/components/SearchBar.tsx create mode 100644 product-source/guanghu-knowledge-base/src/components/VersionHistory.tsx create mode 100644 product-source/guanghu-knowledge-base/src/main.tsx create mode 100644 product-source/guanghu-knowledge-base/src/styles/app.css create mode 100644 product-source/guanghu-knowledge-base/tsconfig.json create mode 100644 product-source/guanghu-knowledge-base/vite.config.ts diff --git a/product-source/guanghu-knowledge-base/.gitignore b/product-source/guanghu-knowledge-base/.gitignore new file mode 100644 index 0000000..544e647 --- /dev/null +++ b/product-source/guanghu-knowledge-base/.gitignore @@ -0,0 +1,7 @@ +node_modules/ +dist/ +dist-server/ +kb-data/ +*.tsbuildinfo +.DS_Store +._* diff --git a/product-source/guanghu-knowledge-base/index.html b/product-source/guanghu-knowledge-base/index.html new file mode 100644 index 0000000..3ba2e39 --- /dev/null +++ b/product-source/guanghu-knowledge-base/index.html @@ -0,0 +1,13 @@ + + +
+ + +选择左侧文档开始阅读
+或点击「+ 根目录文档」创建新文档
+渲染失败
'; + } + }, [body]); + + const handleSave = () => { + onSave(title, body); + setEditing(false); + }; + + const handleCancel = () => { + setTitle(doc.meta.title); + setBody(doc.body); + setEditing(false); + }; + + return ( ++ 点击一个版本查看内容,点击两个版本对比差异 +
+ +{versionContent}
+