0.4.0 convex及界面修改
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"mcp__chrome-devtools__list_pages",
|
||||
"mcp__chrome-devtools__navigate_page",
|
||||
"mcp__chrome-devtools__take_snapshot",
|
||||
"mcp__chrome-devtools__list_console_messages",
|
||||
"mcp__chrome-devtools__handle_dialog",
|
||||
"mcp__chrome-devtools__get_console_message",
|
||||
"mcp__chrome-devtools__click",
|
||||
"mcp__chrome-devtools__fill",
|
||||
"Bash(powershell -Command \"Get-Process vmmemwsl -ErrorAction SilentlyContinue | Select-Object Id, ProcessName, CPU, WorkingSet64, WorkingSetPrivate | Format-Table -AutoSize\")",
|
||||
"Bash(powershell:*)",
|
||||
"Bash(tasklist:*)",
|
||||
"Bash(findstr:*)",
|
||||
"Bash(powershell.exe -Command \"Get-Process node, python, code -ErrorAction SilentlyContinue | Format-Table ProcessName, Id, CPU, WorkingSet64 -AutoSize\")",
|
||||
"Bash(powershell.exe -Command:*)"
|
||||
]
|
||||
},
|
||||
"enableAllProjectMcpServers": true,
|
||||
"enabledMcpjsonServers": [
|
||||
"supabase_local",
|
||||
"chrome-devtools",
|
||||
"context7"
|
||||
]
|
||||
}
|
||||
@@ -15,6 +15,7 @@ yarn-error.log*
|
||||
.DS_Store
|
||||
.env
|
||||
.env.*
|
||||
env-archive/
|
||||
.vscode/
|
||||
*.local
|
||||
tmp/
|
||||
@@ -45,3 +46,6 @@ pw-tests/**
|
||||
pw-tests/
|
||||
wolai-frontend/public/documents/
|
||||
wolai-frontend/public/documents/**
|
||||
artifacts/
|
||||
artifacts/**
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ supabase/ # 历史遗留(不要当作现行架构)
|
||||
|
||||
## 环境变量与配置
|
||||
|
||||
### 前端(wolai-frontend/.env.local)
|
||||
### 前端(使用仓库根目录 .env.all)
|
||||
至少需要:
|
||||
```bash
|
||||
NEXT_PUBLIC_CONVEX_URL=... # 浏览器侧 Convex URL(云端或自托管)
|
||||
@@ -111,7 +111,7 @@ CONVEX_SELF_HOSTED_ADMIN_KEY=...
|
||||
- `CODE_INDEX.md`:代码索引(中文)。
|
||||
|
||||
## 其他注意事项
|
||||
- 不要提交密钥/Token/账号;本地配置优先放在 `.env.local`、`wolai-frontend/.env.local`、`wolai-backend/.env`。
|
||||
- 不要提交密钥/Token/账号;本地/生产配置统一放在仓库根目录的 `.env.all`(UTF-8,且要求 key 唯一)。
|
||||
- 路由目录含 `()` 和 `[]`(如 `(app)`、`[id]`),PowerShell 中操作建议用 `-LiteralPath` 避免通配符误匹配。
|
||||
|
||||
## AI Agent 工具开发
|
||||
|
||||
Submodule Coder-Codex-Gemini deleted from 732de60740
@@ -8,14 +8,16 @@ services:
|
||||
tags:
|
||||
- ghcr.io/hkuds/lightrag:latest
|
||||
ports:
|
||||
- "${PORT:-9621}:9621"
|
||||
- "7777:7777"
|
||||
volumes:
|
||||
- ./data/rag_storage:/app/data/rag_storage
|
||||
- ./data/inputs:/app/data/inputs
|
||||
- ./config.ini:/app/config.ini
|
||||
- ./.env:/app/.env
|
||||
- ../.env.all:/app/.env:ro
|
||||
env_file:
|
||||
- .env
|
||||
- ../.env.all
|
||||
environment:
|
||||
- POSTGRES_HOST=host.docker.internal
|
||||
restart: unless-stopped
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "bunx --bun vite",
|
||||
"build": "bunx --bun vite build",
|
||||
"dev": "bunx --bun vite --mode all",
|
||||
"build": "bunx --bun vite build --mode all",
|
||||
"lint": "eslint .",
|
||||
"preview": "bunx --bun vite preview",
|
||||
"preview": "bunx --bun vite preview --mode all",
|
||||
"test": "bun test",
|
||||
"test:watch": "bun test --watch",
|
||||
"test:coverage": "bun test --coverage",
|
||||
"dev-no-bun": "vite",
|
||||
"build-no-bun": "vite build --emptyOutDir",
|
||||
"preview-no-bun": "vite preview"
|
||||
"dev-no-bun": "vite --mode all",
|
||||
"build-no-bun": "vite build --mode all --emptyOutDir",
|
||||
"preview-no-bun": "vite preview --mode all"
|
||||
},
|
||||
"dependencies": {
|
||||
"@faker-js/faker": "^9.9.0",
|
||||
|
||||
@@ -6,6 +6,8 @@ import tailwindcss from '@tailwindcss/vite'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
// 约定:全局仅使用仓库根目录的 .env.all(通过 `--mode all` 读取)。
|
||||
envDir: path.resolve(__dirname, '../..'),
|
||||
plugins: [react(), tailwindcss()],
|
||||
resolve: {
|
||||
alias: {
|
||||
|
||||
+172
@@ -0,0 +1,172 @@
|
||||
# MNOTE 项目介绍(PPT 大纲草稿)
|
||||
|
||||
> 使用建议:每个 `---` 作为一页 PPT;标题为页面标题;要点为页面内容。
|
||||
> 说明:当前项目数据主链路以 **Convex** 为准;仓库中出现的 **Supabase** 相关内容按“历史遗留/兼容残留”处理。
|
||||
|
||||
---
|
||||
|
||||
## 0. 标题页
|
||||
|
||||
- 项目:MNOTE(知识管理系统)
|
||||
- 形态:Web + 桌面端(Electron)
|
||||
- 关键词:块编辑器 / 思维导图 / AI 工具型 Agent / Convex 数据层
|
||||
|
||||
---
|
||||
|
||||
## 1. 目录
|
||||
|
||||
1. 架构
|
||||
2. 已实现功能
|
||||
3. 优点/特点
|
||||
4. 缺点
|
||||
|
||||
---
|
||||
|
||||
## 2. 架构总览(分层)
|
||||
|
||||
- UI/交互层:Next.js(App Router)+ React(前端)
|
||||
- 业务与数据层:Convex(数据读写、鉴权与权限、文件存储)
|
||||
- 辅助能力层:FastAPI + Celery(OCR / OnlyOffice / 其他集成)
|
||||
- 桌面封装层:Electron(内嵌 Next.js standalone)
|
||||
- 测试与运维:Playwright E2E、Convex 自托管(Docker Compose)
|
||||
|
||||
---
|
||||
|
||||
## 3. 架构图(逻辑关系)
|
||||
|
||||
```text
|
||||
┌──────────────────────────┐
|
||||
│ Desktop / Web │
|
||||
│ Electron(可选) + Next.js │
|
||||
└─────────────┬────────────┘
|
||||
│ 页面渲染 / 交互
|
||||
v
|
||||
┌──────────────────────────┐
|
||||
│ Next.js App Router UI │
|
||||
│ - 页面:/documents /mindmap│
|
||||
│ - BFF:/api/* route handler│
|
||||
└───────┬───────────┬───────┘
|
||||
│ │
|
||||
│ 读写/权限 │ 集成/重计算(按需)
|
||||
v v
|
||||
┌─────────────────┐ ┌──────────────────────┐
|
||||
│ Convex Backend │ │ FastAPI + Celery │
|
||||
│ - 数据/鉴权/权限 │ │ - OCR / OnlyOffice 等 │
|
||||
│ - Files 存储 │ │ - 可对接 MinerU/RAG │
|
||||
└─────────────────┘ └──────────────────────┘
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 4. 核心目录与职责(落地到仓库)
|
||||
|
||||
- `wolai-frontend/`:主前端(Next.js),源码在 `wolai-frontend/src/`
|
||||
- `wolai-frontend/convex/`:Convex functions(schema / query / mutation / action)
|
||||
- `infra/convex/`:Convex 自托管(Docker Compose + Dashboard)
|
||||
- `wolai-backend/`:FastAPI + Celery(辅助能力与集成服务)
|
||||
- `desktop-electron/`:Electron 桌面端包装
|
||||
- `services/`:配套服务/集成点(如 `services/mineru`、LightRAG 等)
|
||||
- `pw-tests/`:端到端测试(Playwright)
|
||||
|
||||
---
|
||||
|
||||
## 5. 数据流(典型请求)
|
||||
|
||||
- 登录/鉴权:前端挂载 Convex Auth Provider;由 Convex 负责身份与权限主线
|
||||
- 数据读写:页面/组件通过 Convex 或 Next.js `/api/*`(BFF)访问业务数据
|
||||
- 文件与附件:通过 Convex Files(或 BFF 代理)管理上传/下载与元信息
|
||||
- 重计算/集成:需要 OCR、OnlyOffice、RAG 时走 FastAPI(可异步由 Celery 承载)
|
||||
|
||||
---
|
||||
|
||||
## 6. 已实现功能(概览)
|
||||
|
||||
- 文档系统:文档页、块编辑器外壳、基础读写链路
|
||||
- 思维导图:导图页面/全屏、导图数据模型与读写、导图相关 API
|
||||
- 协作与权限:工作区、群组/成员、分享(Share/Invite/Star/Recent 等数据模型)
|
||||
- 媒体与引用:媒体资源、引用(references)、图片/附件 OCR 文本读取入口
|
||||
- AI 能力:工具型 Agent 框架 + 内置工具集(含读/写工具与确认机制)
|
||||
- OnlyOffice:前端页面与 BFF 代理接口(用于嵌入/代理访问)
|
||||
- 桌面端:Electron 运行、热启动脚本、Windows 打包配置
|
||||
- 运维/开发:Convex 自托管方案、开发脚本、E2E 测试脚本
|
||||
|
||||
---
|
||||
|
||||
## 7. 已实现功能(按模块细化:前端)
|
||||
|
||||
- 路由页面(示例)
|
||||
- 登录/鉴权:`/(auth)/login`、`/(auth)/auth`
|
||||
- 文档:`/(app)/documents/[id]`
|
||||
- 思维导图:`/mindmap/[docId]/[mindmapId]`
|
||||
- OnlyOffice:`/onlyoffice/*`,以及 `onlyoffice-server` 相关代理路由
|
||||
- 本地模式入口:`/local/*`
|
||||
- 表格:`/tables/[tableId]`
|
||||
- 调试:`/dev/*`(AI Agent / Mindmap)
|
||||
- BFF API(示例)
|
||||
- 文档:`/api/documents/*`
|
||||
- 思维导图:`/api/mindmap/**`、`/api/mindmap-ai/*`
|
||||
- 媒体:`/api/media/*`
|
||||
- AI Agent:`/api/ai-agent/run`
|
||||
- OnlyOffice:`/api/onlyoffice/proxy`
|
||||
|
||||
---
|
||||
|
||||
## 8. 已实现功能(按模块细化:Convex)
|
||||
|
||||
- 业务数据与能力(按 functions 文件归类)
|
||||
- 文档:`documents.ts`、`comments.ts`、`recents.ts`、`documentStars.ts`
|
||||
- 分享与权限:`documentShares.ts`、`documentGroupShares.ts`、`groups.ts`、`groupMembers.ts`、`groupInvitations.ts`
|
||||
- 思维导图:`mindmaps.ts`
|
||||
- 媒体与附件:`mediaAssets.ts`
|
||||
- 引用:`references.ts`
|
||||
- 表格:`tables.ts`
|
||||
- 工作区与用户:`workspaces.ts`、`users.ts`
|
||||
- 异步任务骨架:`jobs.ts`
|
||||
|
||||
---
|
||||
|
||||
## 9. 已实现功能(按模块细化:后端/服务)
|
||||
|
||||
- FastAPI(阶段 0 骨架)
|
||||
- 健康检查:`/health`
|
||||
- 任务占位:`/api/v1/tasks/ocr`、`/api/v1/tasks/{id}`
|
||||
- SSE 占位:`/api/v1/chat`
|
||||
- 其他:`luckysheet_ws` WebSocket 路由(表格/协作相关)
|
||||
- 预留集成点
|
||||
- MinerU:OCR 服务(位于 `services/mineru`)
|
||||
- LightRAG:RAG 检索/生成(仓库内有集成点与相关依赖)
|
||||
|
||||
---
|
||||
|
||||
## 10. 优点/特点(产品与体验)
|
||||
|
||||
- “文档 + 思维导图”一体化:导图是一等公民,可与文档块/附件/引用形成闭环
|
||||
- 兼容 Web 与桌面端:同一套前端代码在不同运行环境复用
|
||||
- AI 以“工具系统”落地:读写工具分级、写入前确认,便于可控扩展
|
||||
- 具备本地/内网部署可能:Convex 支持自托管,适合内网或私有化场景
|
||||
|
||||
---
|
||||
|
||||
## 11. 优点/特点(工程与架构)
|
||||
|
||||
- 主链路清晰:Convex 统一承担数据 + 鉴权/权限 + 文件存储
|
||||
- BFF 模式:Next.js Route Handlers 统一对外 API 形态,便于前端联调与权限收口
|
||||
- 多能力可插拔:OCR / OnlyOffice / RAG 等通过后端服务或工具接口渐进接入
|
||||
- 自动化基础较全:热启动脚本 + E2E(Playwright)脚本为联调与回归提供支撑
|
||||
|
||||
---
|
||||
|
||||
## 12. 缺点(架构复杂度与运维)
|
||||
|
||||
- 组件较多:Next.js + Convex + FastAPI/Celery + Electron(学习与排障成本高)
|
||||
- 部署面更广:Convex 自托管 + 后端服务 +(可选)OCR/RAG 服务,运维链路更长
|
||||
- 桌面端成本:Electron 体积与打包/升级链路带来额外维护负担
|
||||
|
||||
---
|
||||
|
||||
## 13. 缺点(技术债与一致性风险)
|
||||
|
||||
- Supabase 相关依赖/目录仍在仓库中,容易造成新同学误用或逻辑分叉(需要持续收敛)
|
||||
- 后端多项能力仍为“阶段 0 占位”,与前端能力深度集成仍需补齐(OCR/RAG/SSE 等)
|
||||
- 多运行模式(Web/桌面/本地)对配置与数据一致性提出更高要求(需要清晰的环境与开关策略)
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
# 无标题
|
||||
@@ -1 +0,0 @@
|
||||
# 无标题
|
||||
@@ -1 +0,0 @@
|
||||
# 无标题
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"data": {
|
||||
"text": "<p>中心主题</p>",
|
||||
"expand": true,
|
||||
"uid": "75a74c5a-4014-415b-bfe6-62043be0f629",
|
||||
"richText": true,
|
||||
"isActive": false,
|
||||
"imgMap": {}
|
||||
},
|
||||
"children": [],
|
||||
"smmVersion": "0.14.0-fix.1"
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 64 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user