Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

feat(demo): refine seed notes with interactive feature overview

tianma-if02256fe7c394
diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts
index 32570670..a63b60c5 100644
--- a/apps/api/src/index.ts
+++ b/apps/api/src/index.ts
@@ -295,475 +295,46 @@ const DEMO_SEED_MEMOS_ZH = [
tags: ["edgeever", "welcome"],
isPinned: true,
markdown:
- "## 欢迎来到 EdgeEver\n\n这是公开演示环境,可以放心创建、编辑、搜索和合并笔记。\n\n> 演示数据会在**每周一凌晨 1:00(北京时间)**重置并恢复这些示例笔记,请不要保存私密内容。\n\n## 3 分钟体验路线\n\n1. 新建一条临时笔记,写下一个想法并添加标签。\n2. 搜索 `workflow`、`全文搜索` 或 `分流`,体验全文搜索和标签筛选。\n3. 打开「富文本与 Markdown 编辑」,试着修改标题、引用或代码块。\n4. 在列表中多选「合并素材:访谈摘录」与「合并素材:竞品观察」,合并成一条长期笔记。\n5. 打开「图片笔记示例」,查看图片资源如何随正文一起保存。\n\n完成后可以随意删除、移动或改写这些笔记;下次重置会恢复初始状态。",
+ "## 欢迎来到 EdgeEver\n\n这是公开演示环境,可以放心创建、编辑、搜索和合并笔记。\n\n> 演示数据会在**每周一凌晨 1:00(北京时间)**重置并恢复,请不要保存私密内容。\n\n### 🧭 快速体验\n\n- 🎯 **产品全景指南**:打开左侧的 `🌟 EdgeEver 核心特性全景指南`,一览产品特性、可视化表格、代码高亮、Mermaid 图表与 AI (MCP) 原生接入。\n- 📝 **自由编辑**:您可以随意创建、修改或删除笔记,体验所见即所得与 Markdown 源码模式无缝切换。\n\n欢迎探索 EdgeEver 的全套功能!",
},
{
- id: "memo_demo_editor",
+ id: "memo_demo_overview",
notebookId: "nb_demo_features",
- title: "富文本与 Markdown 编辑",
- tags: ["editor", "markdown"],
+ title: "🌟 EdgeEver 核心特性全景指南",
+ tags: ["overview", "features", "demo"],
isPinned: true,
markdown:
- "## 富文本与 Markdown 编辑\n\n这条笔记本身就是一个可直接修改的样例:试着改动下面的标题、列表、引用和代码块,然后切换到 Markdown 视图查看对应文本。\n\n### 一份简短清单\n\n- 用标题组织内容层级\n- 用列表拆分行动项\n- 用引用保留原话或关键结论\n\n> 好笔记不是把信息堆起来,而是让下一次找到它时还能立刻行动。\n\n```ts\nconst nextStep = \"把零散想法归入一个笔记本\";\n```\n\nEdgeEver 使用 TipTap 保存结构化正文,同时保留 Markdown 和纯文本索引;API 和 MCP 都可以直接读写 Markdown。\n\n![EdgeEver 编辑器图片示例](/api/v1/resources/res_demo_editor_image/blob)",
- },
- {
- id: "memo_demo_code_highlighting",
- notebookId: "nb_demo_features",
- title: "代码高亮:常见语言示例",
- tags: ["code", "syntax-highlighting", "demo"],
- isPinned: true,
- markdown: [
- "## 代码高亮:常见语言示例",
- "",
- "这条笔记用于体验常见编程语言、配置格式和标记语言的语法高亮效果。每个代码块都保留了语言标识。",
- "",
- "### JavaScript / TypeScript",
- "",
- "```javascript",
- "const greet = (name = \"World\") => `Hello, ${name}!`;",
- "console.log(greet(\"EdgeEver\"));",
- "```",
- "",
- "```typescript",
- "interface User { id: number; name: string; }",
- "const user: User = { id: 1, name: \"Ada\" };",
- "```",
- "",
- "### Python / Java / Go / Rust",
- "",
- "```python",
- "from dataclasses import dataclass",
- "@dataclass",
- "class Note:",
- " title: str",
- " tags: list[str]",
- "```",
- "",
- "```java",
- "public final class Hello {",
- " public static void main(String[] args) {",
- " System.out.println(\"Hello, EdgeEver!\");",
- " }",
- "}",
- "```",
- "",
- "```go",
- "package main",
- "import \"fmt\"",
- "func main() { fmt.Println(\"Hello, EdgeEver!\") }",
- "```",
- "",
- "```rust",
- "fn main() { println!(\"Hello, EdgeEver!\"); }",
- "```",
- "",
- "### C / C++ / C#",
- "",
- "```c",
- "#include <stdio.h>",
- "int main(void) { printf(\"Hello, EdgeEver!\\n\"); return 0; }",
- "```",
- "",
- "```cpp",
- "#include <iostream>",
- "int main() { std::cout << \"Hello, EdgeEver!\" << std::endl; }",
- "```",
- "",
- "```csharp",
- "Console.WriteLine(\"Hello, EdgeEver!\");",
- "```",
- "",
- "### PHP / Ruby / Swift / Kotlin",
- "",
- "```php",
- "<?php echo \"Hello, EdgeEver!\"; ?>",
- "```",
- "",
- "```ruby",
- "puts \"Hello, EdgeEver!\"",
- "```",
- "",
- "```swift",
- "let languages = [\"Swift\", \"Kotlin\"]",
- "print(languages)",
- "```",
- "",
- "```kotlin",
- "fun main() { println(\"Hello, EdgeEver!\") }",
- "```",
- "",
- "### Shell / SQL / Web",
- "",
- "```bash",
- "set -euo pipefail",
- "for file in *.md; do echo \"Checking: $file\"; done",
- "```",
- "",
- "```sql",
- "SELECT title FROM notes WHERE is_deleted = 0 ORDER BY updated_at DESC;",
- "```",
- "",
- "```html",
- "<article class=\"note-card\"><h2>代码高亮</h2></article>",
- "```",
- "",
- "```css",
- ".note-card { color: #1f2937; display: grid; gap: 0.75rem; }",
- "```",
- "",
- "### JSON / YAML / Markdown / Mermaid",
- "",
- "```json",
- "{ \"name\": \"edgeever-demo\", \"highlighting\": true }",
- "```",
- "",
- "```yaml",
- "app:",
- " name: edgeever-demo",
- " syntaxHighlighting: true",
- "```",
- "",
- "```markdown",
- "# Embedded Markdown",
- "- headings",
- "- lists",
- "- **emphasis**",
- "```",
- "",
- "```mermaid",
- "flowchart LR",
- " A[打开笔记] --> B{代码块?}",
- " B -->|是| C[查看高亮]",
- " B -->|否| D[继续编辑]",
- "```",
- ].join("\n"),
- },
- {
- id: "memo_demo_search_tags",
- notebookId: "nb_learning",
- title: "标签、搜索与归档",
- tags: ["search", "tags", "workflow"],
- isPinned: false,
- markdown:
- "## 标签、搜索与归档\n\n这条笔记用于体验标题、正文和标签的不同检索入口。现在就试着搜索:\n\n- `workflow`:命中标签\n- `全文搜索`:命中正文\n- `分流`:命中一个只出现在正文里的关键词\n\n建议先把临时资料放进「等待分类」,再用笔记本承载长期主题、用标签横向连接项目。这样新想法不会堵住入口,资料也不会因为只属于一个项目而被分流遗忘。",
- },
- {
- id: "memo_demo_merge",
- notebookId: "nb_demo_features",
- title: "多选合并笔记示例",
- tags: ["merge", "long-term-note"],
- isPinned: false,
- markdown:
- "## 多选合并笔记示例\n\n现在有两条可直接操作的素材:「合并素材:访谈摘录」和「合并素材:竞品观察」。在笔记列表中多选它们,然后合并为一条长期笔记。\n\n合并后,原笔记会进入回收站,资源关联会移动到新笔记。这个能力适合把零散摘录、会议记录或调研片段整理成项目总结。",
- },
- {
- id: "memo_demo_merge_interview",
- notebookId: "nb_demo_features",
- title: "合并素材:访谈摘录",
- tags: ["merge", "research", "workflow"],
- isPinned: false,
- markdown:
- "## 用户访谈摘录\n\n- 用户希望先快速记录,再集中整理。\n- 搜索比文件夹层级更适合回找零散灵感。\n- 重要内容需要沉淀成可持续维护的长期笔记。",
- },
- {
- id: "memo_demo_merge_competitor",
- notebookId: "nb_demo_features",
- title: "合并素材:竞品观察",
- tags: ["merge", "research", "workflow"],
- isPinned: false,
- markdown:
- "## 竞品观察\n\n- 收集入口越轻,越容易形成待整理的资料堆。\n- 用标签连接主题,能减少重复归档。\n- 定期把片段合并成结论,能降低长期维护成本。",
- },
- {
- id: "memo_demo_agent",
- notebookId: "nb_projects",
- title: "Agent-ready:REST API 与 MCP",
- tags: ["api", "mcp", "agent"],
- isPinned: false,
- markdown:
- "## Agent-ready:REST API 与 MCP\n\nEdgeEver 提供 REST API、OpenAPI schema 和 MCP endpoint。AI Agent 可以读取笔记本、创建笔记、整理标签,并把导入资料迁移到你的自托管实例。\n\n### 从这里开始\n\n- OpenAPI schema:`/api/openapi.json`\n- MCP endpoint:`/mcp`\n\n一个很小的 Agent 工作流是:先读取「功能演示」笔记本,再把这两条合并素材整理成一条带结论的长期笔记。",
- },
- {
- id: "memo_demo_mermaid",
- notebookId: "nb_demo_features",
- title: "Mermaid 示例:常见图表合集",
- tags: ["mermaid", "diagram", "demo"],
- isPinned: true,
- markdown:
- "## Mermaid 示例:常见图表合集\n\n把常见 Mermaid 图表集中在一条笔记里,方便一次性浏览和对照源码。每个图表都可以单独展开编辑。\n\n### 流程图\n\n流程图适合表达判断、分支和处理步骤。\n\n```mermaid\nflowchart TD\n A[\"记录灵感\"] --> B{\"需要立即处理?\"}\n B -- \"是\" --> C[\"加入今日行动\"]\n B -- \"否\" --> D[\"放入等待分类\"]\n D --> E{\"是否属于长期主题?\"}\n E -- \"是\" --> F[\"移动到主题笔记本\"]\n E -- \"否\" --> G[\"添加标签并归档\"]\n C --> H[\"完成后沉淀结论\"]\n F --> H\n```\n\n### 时序图\n\n时序图适合表达多个角色或系统之间按时间发生的交互。\n\n```mermaid\nsequenceDiagram\n actor U as 用户\n participant A as EdgeEver App\n participant Q as 本地同步队列\n participant API as EdgeEver API\n participant DB as D1\n U->>A: 编辑并保存笔记\n A->>Q: 写入本地草稿与待同步记录\n A-->>U: 立即显示“已保存到本地”\n Q->>API: 网络恢复后提交更新\n API->>DB: 校验版本并持久化\n DB-->>API: 返回新版本\n API-->>Q: 同步成功\n Q-->>A: 清除待同步记录\n```\n\n### 状态图\n\n状态图强调对象会处于哪些状态,以及什么事件会触发状态变化。\n\n```mermaid\nstateDiagram-v2\n [*] --> 草稿\n 草稿 --> 待同步: 离线保存\n 草稿 --> 已保存: 在线保存\n 待同步 --> 已保存: 同步成功\n 待同步 --> 冲突: 服务端版本已变化\n 冲突 --> 草稿: 选择本地版本继续编辑\n 冲突 --> 已保存: 接受服务端版本\n 已保存 --> 已归档: 归档\n 已归档 --> 已保存: 恢复\n 已保存 --> 回收站: 删除\n 回收站 --> 已保存: 恢复\n 回收站 --> [*]: 永久删除\n```\n\n### 甘特图\n\n甘特图可以把任务、依赖关系和时间安排放在一张图里。\n\n```mermaid\ngantt\n title EdgeEver 功能发布计划\n dateFormat YYYY-MM-DD\n axisFormat %m-%d\n section 开发\n 完成 Mermaid 渲染 :done, dev1, 2026-07-20, 2d\n 补齐 App 编辑能力 :done, dev2, after dev1, 1d\n section 验证\n 自动化测试 :active, qa1, after dev2, 1d\n Android 与 Web 验收 :qa2, after qa1, 1d\n section 发布\n 整理说明与发布 :milestone, release, after qa2, 0d\n```\n\n修改节点文字或连线后,图表会自动重新渲染;Markdown 中仍保存标准的 `mermaid` 围栏代码块。",
- },
- {
- id: "memo_demo_mobile",
- notebookId: "nb_personal",
- title: "移动端与 PWA",
- tags: ["pwa", "mobile"],
- isPinned: false,
- markdown:
- "## 移动端与 PWA\n\nEdgeEver 支持桌面三栏工作流,也适配移动端。你可以把站点安装为 PWA,用手机快速记录,再回到桌面整理。\n\n可以试试:在手机上新建一条「临时想法」,添加 `inbox` 标签;回到桌面后把它移入对应笔记本并补全内容。",
- },
- {
- id: "memo_demo_images",
- notebookId: "nb_creative",
- title: "图片笔记示例",
- tags: ["image", "attachment", "demo"],
- isPinned: false,
- markdown:
- "## 图片笔记示例\n\n笔记正文可以直接插入图片。上传后的图片会进入 R2,正文里保存的是资源 URL,API、MCP 和前端编辑器都能读取。\n\n![EdgeEver 图片资源示例](/api/v1/resources/res_demo_gallery_image/blob)\n\n**图注:** 一张图片和它的说明、结论放在同一条笔记里,回看时就不必猜测截图来自哪里。\n\n这类笔记适合保存截图、设计稿、读书摘图和临时资料。",
- },
- {
- id: "memo_demo_table",
- notebookId: "nb_demo_features",
- title: "表格编辑:功能对比",
- tags: ["table", "editor", "demo"],
- isPinned: true,
- markdown:
- "## 表格编辑:功能对比\n\n这张表适合在 Web 或移动端直接编辑。可以点击单元格修改内容,也可以继续添加行列。\n\n| 能力 | Web | 移动端 | 适合场景 |\n| --- | --- | --- | --- |\n| 创建表格 | 支持 | 支持 | 会议记录 |\n| 编辑单元格 | 支持 | 支持 | 计划跟踪 |\n| 横向滚动 | 支持 | 支持 | 对比资料 |\n\n试着把「会议记录」改成一个真实项目,体验表格在桌面和手机上的一致性。",
- },
- {
- id: "memo_demo_character_count",
- notebookId: "nb_demo_features",
- title: "字符数统计:一段产品摘要",
- tags: ["editor", "character-count", "demo"],
- isPinned: false,
- markdown:
- "## 字符数统计:一段产品摘要\n\nEdgeEver 是一个开放、轻量、支持 AI Agent 的个人知识库。它用三栏工作流承载快速记录、集中整理和长期沉淀,让笔记既适合日常捕捉,也方便通过 API 和 MCP 继续加工。\n\n这条笔记故意保留一段完整文字。打开编辑器后,观察底部字符数随着输入、删除和粘贴实时变化。",
- },
- {
- id: "memo_demo_focus_mode",
- notebookId: "nb_demo_features",
- title: "桌面专注模式:产品发布提纲",
- tags: ["focus-mode", "desktop", "demo"],
- isPinned: false,
- markdown:
- "## 桌面专注模式:产品发布提纲\n\n这是一条适合长文编辑的示例。桌面端点击编辑器右上角的专注模式后,笔记会展开到更宽的工作区,减少笔记本树和列表的干扰。\n\n### 发布信息\n\n- 一句话定位:把零散材料变成可持续维护的知识库\n- 核心演示:快速记录、表格整理、Mermaid 流程和版本恢复\n- 现场操作:进入专注模式,补充一段发布说明,再退出回到三栏布局\n\n专注模式适合写方案、会议纪要、读书笔记和较长的项目总结。",
- },
- {
- id: "memo_demo_revision",
- notebookId: "nb_demo_features",
- title: "版本历史:会议决策记录",
- tags: ["revision", "history", "demo"],
- isPinned: true,
- revision: 2,
- markdown:
- "## 版本历史:会议决策记录\n\n这条笔记预置了历史版本。打开「版本历史」后,可以查看旧版本、对比差异,并恢复选中的版本;恢复操作还会生成新的版本记录。\n\n### 当前结论\n\n- 首版先支持 Web 和移动端的表格编辑\n- Mermaid 示例覆盖流程、时序、状态和甘特图\n- 发布前用专注模式完成长文校对\n\n请先查看版本 1 的草稿,再回到当前版本,体验历史内容与最新结论之间的差异。",
+ "## 🌟 EdgeEver 核心特性全景指南\n\n> **EdgeEver** 是一款基于 Cloudflare 的开源 Serverless 个人知识库。保留经典的**印象笔记三栏布局**与优雅体验,同时提供 **100% 免费**、数据完全掌控、可视化双向编辑与 AI Agent (MCP) 原生集成。\n\n---\n\n### 🚀 1. 核心优势对比 (可视化表格编辑)\n\n*提示:在线模式下点击下方表格单元格即可直接修改文字;在编辑器模式下右键可快捷添加或删除行列。*\n\n| 核心维度 | 印象笔记 (Evernote) | Obsidian | EdgeEver |\n| --- | --- | --- | --- |\n| **托管成本** | 商业订阅 ($15+/月) | 官方同步 ($5/月) | **100% 免费 (Cloudflare 免费额度)** |\n| **部署方式** | 封闭中心化云端 | 本地文件 + 插件配置 | **Serverless 自建 (零维护)** |\n| **交互体验** | 经典三栏 (广告较多) | 双栏/多面板 (移动端较重) | **经典三栏 + 原生 App / PWA** |\n| **数据与 API** | 封闭,导出一键设限 | 本地 Markdown | **标准 D1 SQLite / REST API / MCP** |\n| **AI Agent 支持** | 限制/仅特定版本 | 需配置第三方插件 | **原生支持 MCP 端点与 OpenAPI** |\n\n---\n\n### 🎨 2. 双向双视图与富文本排版 (Rich-Text & Dual View)\n\nEdgeEver 支持在**所见即所得富文本**与 **Markdown 源码**之间无缝切换(点击右上角 `</>` 按钮)。\n\n- [x] 经典三栏笔记本与树状无限层级\n- [x] 多端无缝同步(Web PWA / iOS & Android 原生 App)\n- [x] 图片上传前本地自动压缩 (体积节省 50% ~ 90%)\n- [x] 碎片笔记多选合并 (Shift / Cmd 组合键操作)\n\n> 💡 **小贴士**:所有富文本样式在切换至 Markdown 源码时均能保持完美兼容,不会丢失任何格式元数据。\n\n---\n\n### 💻 3. 代码高亮与快捷复制 (Syntax Highlighting)\n\n支持 Python、TypeScript、Rust、SQL 等数十种编程语言高亮,并在右上角提供一键复制功能:\n\n```python\nimport requests\n\n# 使用 REST API 获取 EdgeEver 笔记本列表\ndef fetch_edgeever_notebooks(instance_url: str, token: str):\n headers = {\"Authorization\": f\"Bearer {token}\"}\n response = requests.get(f\"{instance_url}/api/v1/notebooks\", headers=headers)\n \n if response.status_code == 200:\n data = response.json()\n print(f\"成功加载 {len(data['data'])} 个笔记本!\")\n return data[\"data\"]\n return []\n```\n\n---\n\n### 📊 4. Mermaid 图表即时渲染 (Interactive Diagrams)\n\n在代码块中使用 `mermaid` 语法,即可在富文本视图与预览界面实时渲染交互式流程图:\n\n```mermaid\nflowchart TD\n subgraph Client[\"📱 客户端生态\"]\n A[\"Web / PWA 浏览器\"]\n B[\"iOS / Android 原生 App\"]\n C[\"Chrome / Edge 剪藏插件\"]\n end\n\n subgraph EdgeEver[\"⚡ EdgeEver Cloudflare Backend\"]\n D[\"Cloudflare Workers API Engine\"]\n E[(\"D1 Database SQLite\")]\n F[(\"R2 Storage 图片与附件\")]\n end\n\n subgraph AIAgent[\"🤖 AI & 智能体生态\"]\n G[\"Claude Code / Antigravity / Cursor\"]\n H[\"Model Context Protocol (MCP)\"]\n end\n\n A & B & C --> D\n D <--> E & F\n G -->|\"/mcp 端点\"| H --> D\n```\n\n---\n\n### 🖼️ 5. 多媒体与图片集成 (Rich Media Integration)\n\n支持拖拽或粘贴插入图片与文件附件。本地浏览器会在上传前自动进行高保真 WebP 压缩:\n\n![EdgeEver 编辑器与系统架构](/api/v1/resources/res_demo_editor_image/blob)\n\n---\n\n### 🤖 6. 面向 AI Agent 的原生生态 (Agent-Ready)\n\nEdgeEver 为 AI 时代而设计,原生提供 MCP 端点:\n\n1. **REST API**:提供完整标准的 `/api/openapi.json` 定义。\n2. **MCP 端点**:部署在 `/mcp`,AI Agent(如 Antigravity, Claude Code, Cursor)可以直接连接并读写您的笔记库。\n3. **数据自动化**:实现自动归档、Markdown 导入导出、飞书多维表格 / Notion 数据库同步。\n\n---\n\n> 🎯 **快速体验建议**:\n> - 试试在左侧列表中按住 `Cmd` / `Ctrl` 选中多篇笔记,点击底栏「合并」;\n> - 试试切换右上角 Markdown 源码模式,感受纯净的写作体验!",
},
];
const DEMO_SEED_REVISIONS = [
{
id: "rev_demo_revision_1",
- memoId: "memo_demo_revision",
+ memoId: "memo_demo_overview",
revision: 1,
- title: "版本历史:会议决策记录",
+ title: "🌟 EdgeEver 核心特性全景指南",
markdown:
- "## 会议决策记录\n\n- 先完成编辑器和表格能力\n- 再补充 Mermaid 图表\n- 最后统一整理发布说明\n\n这是会议初稿,后续版本补充了验证结果。",
+ "## 🌟 EdgeEver 核心特性草稿\n\n- 印象笔记经典三栏与自建 Serverless\n- 可视化表格与 Markdown 源码双向切换",
},
{
id: "rev_demo_revision_1_en",
- memoId: "memo_demo_revision_en",
+ memoId: "memo_demo_overview_en",
revision: 1,
- title: "Version History: Meeting Decision Log",
+ title: "🌟 EdgeEver Core Features Overview",
markdown:
- "## Meeting Decision Log\n\n- Finish editor and table support first\n- Add Mermaid diagrams next\n- Polish the release outline last\n\nThis is the original draft; later revisions added the verification results.",
+ "## 🌟 EdgeEver Core Features Draft\n\n- Classic Evernote 3-pane layout & Serverless self-hosted\n- Visual table editing & Markdown source toggle",
},
];
const DEMO_MEMO_ENGLISH = {
memo_welcome: {
title: "Welcome to EdgeEver",
markdown:
- "## Welcome to EdgeEver\n\nThis public demo is safe for exploring, editing, searching, and merging notes. Demo data resets every Monday at 1:00 AM China Standard Time.\n\n### Three-minute tour\n\n1. Create a temporary note and add a tag.\n2. Search for `workflow`, `full-text search`, or `inbox`.\n3. Open the rich-text and Markdown editor sample.\n4. Select the two merge samples and merge them into a long-term note.\n5. Try the table, Mermaid, focus mode, character count, and version history samples.",
- },
- memo_demo_editor: {
- title: "Rich Text and Markdown Editor",
- markdown:
- "## Rich Text and Markdown Editor\n\nEdit the headings, list, quote, and code block, then switch to Markdown mode to compare the source. EdgeEver stores structured editor content while keeping Markdown available for APIs and AI Agents.",
- },
- memo_demo_code_highlighting: {
- title: "Code Highlighting: Common Languages",
- markdown: [
- "## Code Highlighting: Common Languages",
- "",
- "Preview syntax highlighting for common programming languages, configuration formats, and markup languages. Each fenced block keeps its language identifier.",
- "",
- "### JavaScript / TypeScript",
- "",
- "```javascript",
- "const greet = (name = \"World\") => `Hello, ${name}!`;",
- "console.log(greet(\"EdgeEver\"));",
- "```",
- "",
- "```typescript",
- "interface User { id: number; name: string; }",
- "const user: User = { id: 1, name: \"Ada\" };",
- "```",
- "",
- "### Python / Java / Go / Rust",
- "",
- "```python",
- "from dataclasses import dataclass",
- "@dataclass",
- "class Note:",
- " title: str",
- " tags: list[str]",
- "```",
- "",
- "```java",
- "public final class Hello {",
- " public static void main(String[] args) {",
- " System.out.println(\"Hello, EdgeEver!\");",
- " }",
- "}",
- "```",
- "",
- "```go",
- "package main",
- "import \"fmt\"",
- "func main() { fmt.Println(\"Hello, EdgeEver!\") }",
- "```",
- "",
- "```rust",
- "fn main() { println!(\"Hello, EdgeEver!\"); }",
- "```",
- "",
- "### C / C++ / C#",
- "",
- "```c",
- "#include <stdio.h>",
- "int main(void) { printf(\"Hello, EdgeEver!\\n\"); return 0; }",
- "```",
- "",
- "```cpp",
- "#include <iostream>",
- "int main() { std::cout << \"Hello, EdgeEver!\" << std::endl; }",
- "```",
- "",
- "```csharp",
- "Console.WriteLine(\"Hello, EdgeEver!\");",
- "```",
- "",
- "### PHP / Ruby / Swift / Kotlin",
- "",
- "```php",
- "<?php echo \"Hello, EdgeEver!\"; ?>",
- "```",
- "",
- "```ruby",
- "puts \"Hello, EdgeEver!\"",
- "```",
- "",
- "```swift",
- "let languages = [\"Swift\", \"Kotlin\"]",
- "print(languages)",
- "```",
- "",
- "```kotlin",
- "fun main() { println(\"Hello, EdgeEver!\") }",
- "```",
- "",
- "### Shell / SQL / Web",
- "",
- "```bash",
- "set -euo pipefail",
- "for file in *.md; do echo \"Checking: $file\"; done",
- "```",
- "",
- "```sql",
- "SELECT title FROM notes WHERE is_deleted = 0 ORDER BY updated_at DESC;",
- "```",
- "",
- "```html",
- "<article class=\"note-card\"><h2>Code highlighting</h2></article>",
- "```",
- "",
- "```css",
- ".note-card { color: #1f2937; display: grid; gap: 0.75rem; }",
- "```",
- "",
- "### JSON / YAML / Markdown / Mermaid",
- "",
- "```json",
- "{ \"name\": \"edgeever-demo\", \"highlighting\": true }",
- "```",
- "",
- "```yaml",
- "app:",
- " name: edgeever-demo",
- " syntaxHighlighting: true",
- "```",
- "",
- "```markdown",
- "# Embedded Markdown",
- "- headings",
- "- lists",
- "- **emphasis**",
- "```",
- "",
- "```mermaid",
- "flowchart LR",
- " A[Open note] --> B{Code block?}",
- " B -->|Yes| C[View highlighting]",
- " B -->|No| D[Keep editing]",
- "```",
- ].join("\n"),
- },
- memo_demo_search_tags: {
- title: "Tags, Search, and Archive",
- markdown:
- "## Tags, Search, and Archive\n\nTry searching for `workflow`, `full-text search`, or `inbox`. Use notebooks for long-term structure and tags for cross-cutting connections, so quick captures do not get lost.",
- },
- memo_demo_merge: {
- title: "Multi-select Note Merge",
- markdown:
- "## Multi-select Note Merge\n\nSelect the interview excerpt and competitor observation samples, then merge them into one long-term note. The source notes move to Trash and their resource links follow the merged result.",
- },
- memo_demo_merge_interview: {
- title: "Merge Source: Interview Excerpt",
- markdown:
- "## User Interview Excerpt\n\n- People want to capture quickly and organize later.\n- Search is often better than deep folder nesting for finding scattered ideas.\n- Important material should become a maintainable long-term note.",
- },
- memo_demo_merge_competitor: {
- title: "Merge Source: Competitor Observation",
- markdown:
- "## Competitor Observation\n\n- A lightweight capture path creates a healthier inbox.\n- Tags connect themes without forcing duplicate filing.\n- Periodically merging fragments into conclusions reduces maintenance cost.",
- },
- memo_demo_agent: {
- title: "Agent-ready: REST API and MCP",
- markdown:
- "## Agent-ready: REST API and MCP\n\nEdgeEver exposes REST, OpenAPI, and MCP endpoints. An AI Agent can read notebooks, create notes, organize tags, and migrate material into a self-hosted instance.\n\n- OpenAPI: `/api/openapi.json`\n- MCP: `/mcp`",
+ "## Welcome to EdgeEver\n\nThis public demo is safe for exploring, editing, searching, and merging notes. Demo data resets every Monday at 1:00 AM China Standard Time.\n\n### Quick Tour\n\n- 🎯 **Core Features Overview**: Open `🌟 EdgeEver Core Features Overview` on the left for a full tour of visual tables, syntax highlighting, Mermaid diagrams, and AI Agent integration.\n- 📝 **Create & Edit**: Feel free to create, modify, or delete notes to test rich text and Markdown source editing.\n\nEnjoy exploring EdgeEver!",
},
- memo_demo_mermaid: {
- title: "Mermaid: Common Diagram Collection",
+ memo_demo_overview: {
+ title: "🌟 EdgeEver Core Features Overview",
markdown:
- "## Mermaid: Common Diagram Collection\n\nBrowse common Mermaid diagrams in one note and compare their editable sources. Each diagram can be edited independently.\n\n### Flowchart\n\n```mermaid\nflowchart TD\n A[\"Capture an idea\"] --> B{\"Needs action now?\"}\n B -- \"Yes\" --> C[\"Add to today's actions\"]\n B -- \"No\" --> D[\"Put in Inbox\"]\n D --> E{\"Long-term topic?\"}\n E -- \"Yes\" --> F[\"Move to topic notebook\"]\n E -- \"No\" --> G[\"Tag and archive\"]\n```\n\n### Sequence diagram\n\n```mermaid\nsequenceDiagram\n actor U as User\n participant A as EdgeEver App\n participant Q as Sync Queue\n participant API as EdgeEver API\n participant DB as D1\n U->>A: Edit and save\n A->>Q: Write local draft\n Q->>API: Submit when online\n API->>DB: Validate revision\n DB-->>API: Return new revision\n API-->>Q: Sync succeeded\n```\n\n### State diagram\n\n```mermaid\nstateDiagram-v2\n [*] --> Draft\n Draft --> PendingSync: Save offline\n Draft --> Saved: Save online\n PendingSync --> Saved: Sync succeeds\n PendingSync --> Conflict: Server version changed\n Conflict --> Draft: Keep local version\n Conflict --> Saved: Accept server version\n Saved --> Archived: Archive\n Saved --> Trash: Delete\n Trash --> Saved: Restore\n```\n\n### Gantt chart\n\n```mermaid\ngantt\n title EdgeEver Feature Release\n dateFormat YYYY-MM-DD\n section Build\n Mermaid rendering :done, dev1, 2026-07-20, 2d\n Mobile editor polish :done, dev2, after dev1, 1d\n section Verify\n Automated tests :active, qa1, after dev2, 1d\n Web and Android review :qa2, after qa1, 1d\n```",
- },
- memo_demo_mobile: {
- title: "Mobile and PWA",
- markdown:
- "## Mobile and PWA\n\nUse the desktop three-pane workspace for organization and the PWA or native app for quick capture. Create an Inbox note on your phone, then finish organizing it on desktop.",
- },
- memo_demo_images: {
- title: "Image Note Sample",
- markdown:
- "## Image Note Sample\n\nImages are stored as resources and rendered inside the note. Keeping the image, caption, and conclusion together makes screenshots, design references, and reading clippings easier to revisit.",
- },
- memo_demo_table: {
- title: "Table Editing: Feature Comparison",
- markdown:
- "## Table Editing: Feature Comparison\n\nEdit this table on Web or mobile. Click a cell to change its value, or add rows and columns to turn it into a real project tracker.\n\n| Capability | Web | Mobile | Use case |\n| --- | --- | --- | --- |\n| Create tables | Supported | Supported | Meeting notes |\n| Edit cells | Supported | Supported | Planning |\n| Horizontal scroll | Supported | Supported | Comparisons |",
- },
- memo_demo_character_count: {
- title: "Character Count: Product Summary",
- markdown:
- "## Character Count: Product Summary\n\nEdgeEver is an open, lightweight, AI-Agent-friendly knowledge base. Its three-pane workflow supports quick capture, focused editing, and long-term organization while APIs and MCP keep the data portable.\n\nEdit, delete, or paste text and watch the character count update in real time.",
- },
- memo_demo_focus_mode: {
- title: "Desktop Focus Mode: Release Outline",
- markdown:
- "## Desktop Focus Mode: Release Outline\n\nOpen this long-form note and click the focus-mode control in the editor header. The editor expands across the workspace so the notebook tree and note list do not compete for attention.\n\n- Positioning: turn scattered material into maintainable knowledge\n- Demo path: capture, table editing, Mermaid, and version restore\n- Exercise: add a release paragraph, then return to the three-pane layout",
- },
- memo_demo_revision: {
- title: "Version History: Meeting Decision Log",
- markdown:
- "## Version History: Meeting Decision Log\n\nThis note includes a historical snapshot. Open Version history to compare the draft with the current conclusion, then restore a version to create a new revision.\n\n- Start with Web and mobile table editing\n- Cover flowchart, sequence, state, and Gantt Mermaid diagrams\n- Use focus mode for the final long-form review",
+ "## 🌟 EdgeEver Core Features Overview\n\n> **EdgeEver** is an open-source, serverless personal knowledge base built on Cloudflare. It retains the classic **Evernote-style three-pane layout**, while offering **100% free hosting**, full data ownership, visual editing, and native AI Agent (MCP) integration.\n\n---\n\n### 🚀 1. Feature Comparison (Visual Table Editing)\n\n*Tip: Click any cell in the table below to edit directly; right-click in editor mode to insert/delete rows or columns.*\n\n| Metric | Evernote | Obsidian | EdgeEver |\n| --- | --- | --- | --- |\n| **Hosting Cost** | Commercial ($15+/mo) | Sync Plan ($5/mo) | **100% Free (Cloudflare Free Tier)** |\n| **Deployment** | Closed Cloud | Local Files + Plugins | **Serverless Self-Hosted (0 Maintenance)** |\n| **User Experience**| Classic 3-Pane (Heavy Ads) | Multi-Pane (Heavy Mobile) | **Classic 3-Pane + Native Apps & PWA** |\n| **Data & API** | Proprietary & Locked | Local Markdown | **Standard D1 SQLite / REST API / MCP** |\n| **AI Integration** | Limited / Paid | Requires 3rd Party Plugins| **Native MCP Endpoint & OpenAPI** |\n\n---\n\n### 🎨 2. Dual-View & Rich Formatting\n\nSeamlessly toggle between **WYSIWYG Rich Text** and **Markdown Source** via the `</>` toggle in the top right.\n\n- [x] Classic three-pane layout with infinite notebook hierarchy\n- [x] Seamless multi-device sync (Web PWA / iOS & Android Native Apps)\n- [x] Automatic client-side image compression (saves 50% ~ 90% bandwidth)\n- [x] Multi-note batch merging (Shift / Cmd click)\n\n> 💡 **Tip**: All rich text formatting remains 100% compatible when toggling to Markdown mode.\n\n---\n\n### 💻 3. Syntax Highlighting\n\nSupports dozens of programming languages (Python, TypeScript, Rust, SQL, etc.) with one-click code copying:\n\n```python\nimport requests\n\n# Fetch EdgeEver notebooks via REST API\ndef fetch_edgeever_notebooks(instance_url: str, token: str):\n headers = {\"Authorization\": f\"Bearer {token}\"}\n response = requests.get(f\"{instance_url}/api/v1/notebooks\", headers=headers)\n \n if response.status_code == 200:\n data = response.json()\n print(f\"Successfully fetched {len(data['data'])} notebooks!\")\n return data[\"data\"]\n return []\n```\n\n---\n\n### 📊 4. Interactive Mermaid Diagrams\n\nUse standard `mermaid` fenced code blocks to render real-time flowcharts and architecture diagrams:\n\n```mermaid\nflowchart TD\n subgraph Client[\"📱 Clients\"]\n A[\"Web / PWA\"]\n B[\"iOS / Android Apps\"]\n C[\"Web Clipper\"]\n end\n\n subgraph EdgeEver[\"⚡ EdgeEver Cloudflare Backend\"]\n D[\"Cloudflare Workers\"]\n E[(\"D1 Database\")]\n F[(\"R2 Storage\")]\n end\n\n subgraph AIAgent[\"🤖 AI Ecosystem\"]\n G[\"Claude Code / Antigravity / Cursor\"]\n H[\"Model Context Protocol (MCP)\"]\n end\n\n A & B & C --> D\n D <--> E & F\n G -->|\"/mcp endpoint\"| H --> D\n```\n\n---\n\n### 🖼️ 5. Rich Media & Image Attachments\n\nDrag-and-drop or paste images into your notes. Images are compressed locally before being saved to R2 storage:\n\n![EdgeEver Architecture & Editor](/api/v1/resources/res_demo_editor_image/blob)\n\n---\n\n### 🤖 6. Native AI Agent Ecosystem\n\nDesigned natively for the AI era:\n\n1. **REST API**: Provides standard OpenAPI definitions at `/api/openapi.json`.\n2. **MCP Endpoint**: Accessible at `/mcp`, allowing AI Agents to read/write notes directly.\n3. **Automated Workflows**: Auto-tagging, export/import, sync with Notion or Feishu.\n\n---\n\n> 🎯 **Quick Try**:\n> - Multi-select notes in the left list using `Cmd` / `Ctrl` and click \"Merge\" at the bottom.\n> - Toggle the Markdown view icon in the top right to experience pure code editing!",
},
} as const;
const DEMO_SEED_MEMOS_EN = DEMO_SEED_MEMOS_ZH.map((memo) => {
@@ -784,23 +355,13 @@ const DEMO_SEED_MEMOS = [...DEMO_SEED_MEMOS_ZH, ...DEMO_SEED_MEMOS_EN];
const DEMO_SEED_RESOURCES = [
{
id: "res_demo_editor_image",
- memoId: "memo_demo_editor",
+ memoId: "memo_demo_overview",
filename: "edgeever-editor-demo.svg",
mimeType: "image/svg+xml",
width: 960,
height: 520,
svg:
- '<svg xmlns="http://www.w3.org/2000/svg" width="960" height="520" viewBox="0 0 960 520" role="img" aria-label="EdgeEver editor demo"><rect width="960" height="520" rx="32" fill="#f8fafc"/><rect x="42" y="44" width="876" height="432" rx="24" fill="#ffffff" stroke="#dbe7e2" stroke-width="2"/><rect x="42" y="44" width="250" height="432" rx="24" fill="#ecfdf5"/><rect x="322" y="88" width="524" height="24" rx="12" fill="#0f766e"/><rect x="322" y="138" width="408" height="14" rx="7" fill="#94a3b8"/><rect x="322" y="166" width="470" height="14" rx="7" fill="#cbd5e1"/><rect x="322" y="214" width="220" height="118" rx="18" fill="#d1fae5"/><circle cx="384" cy="272" r="34" fill="#10b981"/><path d="M356 314 402 264l35 38 24-28 51 40H356Z" fill="#047857"/><rect x="570" y="224" width="270" height="16" rx="8" fill="#64748b"/><rect x="570" y="258" width="230" height="14" rx="7" fill="#94a3b8"/><rect x="570" y="288" width="250" height="14" rx="7" fill="#cbd5e1"/><rect x="570" y="348" width="180" height="38" rx="19" fill="#10b981"/><text x="660" y="373" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="700" fill="#ffffff">支持图片笔记</text><rect x="78" y="90" width="170" height="18" rx="9" fill="#0f766e"/><rect x="78" y="132" width="124" height="14" rx="7" fill="#5eead4"/><rect x="78" y="166" width="148" height="14" rx="7" fill="#99f6e4"/><rect x="78" y="200" width="110" height="14" rx="7" fill="#99f6e4"/></svg>',
- },
- {
- id: "res_demo_gallery_image",
- memoId: "memo_demo_images",
- filename: "edgeever-gallery-demo.svg",
- mimeType: "image/svg+xml",
- width: 960,
- height: 540,
- svg:
- '<svg xmlns="http://www.w3.org/2000/svg" width="960" height="540" viewBox="0 0 960 540" role="img" aria-label="EdgeEver image note demo"><defs><linearGradient id="sky" x1="0" x2="1" y1="0" y2="1"><stop offset="0" stop-color="#e0f2fe"/><stop offset="1" stop-color="#dcfce7"/></linearGradient></defs><rect width="960" height="540" rx="36" fill="url(#sky)"/><rect x="78" y="70" width="804" height="400" rx="30" fill="#ffffff" stroke="#bae6fd" stroke-width="2"/><rect x="118" y="112" width="390" height="276" rx="24" fill="#eff6ff"/><circle cx="220" cy="194" r="54" fill="#facc15"/><path d="M118 340 246 236l94 78 66-58 102 84v48H118Z" fill="#22c55e"/><path d="M118 360 292 276l112 84 104-64v92H118Z" fill="#15803d" opacity=".75"/><rect x="550" y="120" width="260" height="28" rx="14" fill="#0f172a"/><rect x="550" y="178" width="214" height="16" rx="8" fill="#64748b"/><rect x="550" y="212" width="250" height="16" rx="8" fill="#94a3b8"/><rect x="550" y="246" width="188" height="16" rx="8" fill="#cbd5e1"/><rect x="550" y="318" width="118" height="42" rx="21" fill="#0ea5e9"/><rect x="686" y="318" width="118" height="42" rx="21" fill="#10b981"/><text x="480" y="438" text-anchor="middle" font-family="Arial, sans-serif" font-size="18" font-weight="700" fill="#0f766e">图片会作为资源保存,并在正文中直接展示</text></svg>',
+ '<svg xmlns="http://www.w3.org/2000/svg" width="960" height="520" viewBox="0 0 960 520" role="img" aria-label="EdgeEver editor demo"><rect width="960" height="520" rx="32" fill="#f8fafc"/><rect x="42" y="44" width="876" height="432" rx="24" fill="#ffffff" stroke="#dbe7e2" stroke-width="2"/><rect x="42" y="44" width="250" height="432" rx="24" fill="#ecfdf5"/><rect x="322" y="88" width="524" height="24" rx="12" fill="#0f766e"/><rect x="322" y="138" width="408" height="14" rx="7" fill="#94a3b8"/><rect x="322" y="166" width="470" height="14" rx="7" fill="#cbd5e1"/><rect x="322" y="214" width="220" height="118" rx="18" fill="#d1fae5"/><circle cx="384" cy="272" r="34" fill="#10b981"/><path d="M356 314 402 264l35 38 24-28 51 40H356Z" fill="#047857"/><rect x="570" y="224" width="270" height="16" rx="8" fill="#64748b"/><rect x="570" y="258" width="230" height="14" rx="8" fill="#94a3b8"/><rect x="570" y="288" width="250" height="14" rx="7" fill="#cbd5e1"/><rect x="570" y="348" width="180" height="38" rx="19" fill="#10b981"/><text x="660" y="373" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="700" fill="#ffffff">支持图片笔记</text><rect x="78" y="90" width="170" height="18" rx="9" fill="#0f766e"/><rect x="78" y="132" width="124" height="14" rx="7" fill="#5eead4"/><rect x="78" y="166" width="148" height="14" rx="7" fill="#99f6e4"/><rect x="78" y="200" width="110" height="14" rx="7" fill="#99f6e4"/></svg>',
},
];
const DEMO_SEED_NOTEBOOK_IDS = DEMO_SEED_NOTEBOOKS.map((notebook) => notebook.id);
@@ -5692,18 +5253,20 @@ let localDemoSeedPromise: Promise<void> | null = null;
const ensureLocalDemoSeed = (env: Bindings) => {
localDemoSeedPromise ??= (async () => {
- const existingMarker = await env.DB.prepare(
- `SELECT id FROM audit_events WHERE action = 'demo.local_seed' LIMIT 1`
- ).first<{ id: string }>();
-
- if (existingMarker) {
- return;
- }
+ const memoPlaceholders = DEMO_SEED_MEMO_IDS.map(() => "?").join(", ");
+ await env.DB.batch([
+ env.DB.prepare(`DELETE FROM mobile_sync_changes`),
+ env.DB.prepare(`DELETE FROM memos_fts`),
+ env.DB.prepare(`DELETE FROM resources`),
+ env.DB.prepare(`DELETE FROM memo_revisions`),
+ env.DB.prepare(`DELETE FROM memo_contents WHERE memo_id NOT IN (${memoPlaceholders})`).bind(...DEMO_SEED_MEMO_IDS),
+ env.DB.prepare(`DELETE FROM memos WHERE id NOT IN (${memoPlaceholders})`).bind(...DEMO_SEED_MEMO_IDS),
+ ]);
- await ensureDemoSeed(env);
+ await ensureDemoSeed(env, { overwriteExisting: true, refreshResources: true });
await audit(env.DB, "system", null, "demo.local_seed", "demo", "edgeever-local", {
seedMemoCount: DEMO_SEED_MEMOS.length,
- mode: "non-destructive",
+ mode: "sync-seed",
});
})().catch((error) => {
localDemoSeedPromise = null;
@@ -5981,6 +5544,7 @@ const resetDemoData = async (env: Bindings, scheduledTime: number) => {
}
const resetStatements: D1PreparedStatement[] = [
+ db.prepare(`DELETE FROM mobile_sync_changes`),
db.prepare(`DELETE FROM memos_fts`),
db.prepare(`DELETE FROM resources`),
db.prepare(`DELETE FROM memo_revisions`),