自托管私有知识库,对标群晖 Note Station。
A self-hosted private knowledge base, inspired by Synology Note Station.
nowen-note 是一款自托管的私有化知识管理应用,采用现代前后端分离架构,支持 Docker 一键部署、Electron 桌面客户端、Android 移动端(Capacitor)。集成 Tiptap 富文本编辑器、AI 智能写作助手(支持 6 大 AI 服务商 + 本地 Ollama)、思维导图、任务管理中心、FTS5 全文搜索、多平台数据导入(小米/OPPO/iCloud)、数据导出等功能,打造一体化知识管理平台。
| 层级 | 技术 |
|---|---|
| 前端框架 | React 18 + TypeScript + Vite 5 |
| 编辑器 | Tiptap 3(代码高亮、图片、任务列表、下划线、文本高亮等) |
| UI 组件 | Radix UI + shadcn/ui 风格组件 + Lucide Icons |
| 样式 | Tailwind CSS 3.4 + Framer Motion |
| 国际化 | i18next(中英文切换) |
| 后端框架 | Hono 4 + @hono/node-server |
| 数据库 | SQLite(better-sqlite3)+ FTS5 全文搜索 |
| 认证 | JWT(jsonwebtoken)+ bcryptjs 密码哈希 |
| 数据校验 | Zod |
| AI 引擎 | 通义千问 / OpenAI / Google Gemini / DeepSeek / 豆包 / Ollama |
| 数据处理 | JSZip(压缩打包)、Turndown(HTML→Markdown)、FileSaver |
| Markdown | react-markdown + remark-gfm(AI 聊天渲染) |
| 桌面端 | Electron 33(NSIS / DMG / AppImage 打包) |
| 移动端 | Capacitor 8(Android 原生壳) |
nowen-note/
├── frontend/ # 前端 React 应用
│ ├── src/
│ │ ├── components/ # 组件
│ │ │ ├── Sidebar.tsx # 侧边栏(笔记本树 + 导航 + 标签)
│ │ │ ├── NoteList.tsx # 笔记列表(多视图 + 右键菜单)
│ │ │ ├── EditorPane.tsx # 编辑器面板(AI 标题/标签 + 大纲 + 锁定)
│ │ │ ├── TiptapEditor.tsx # Tiptap 富文本编辑器
│ │ │ ├── AIChatPanel.tsx # AI 知识库问答面板(RAG + Markdown 渲染)
│ │ │ ├── AIWritingAssistant.tsx # AI 写作助手(10 种文本操作)
│ │ │ ├── AISettingsPanel.tsx # AI 服务配置(6 大 Provider 卡片)
│ │ │ ├── TaskCenter.tsx # 任务管理中心
│ │ │ ├── MindMapEditor.tsx # 思维导图编辑器
│ │ │ ├── DiaryCenter.tsx # 说说/动态(微博风格时间线)
│ │ │ ├── LoginPage.tsx # 登录页
│ │ │ ├── ServerConnect.tsx # 服务器连接配置(客户端模式)
│ │ │ ├── ContextMenu.tsx # 通用右键菜单组件
│ │ │ ├── SettingsModal.tsx # 设置中心(外观/AI/安全/数据)
│ │ │ ├── SecuritySettings.tsx # 账号安全设置
│ │ │ ├── DataManager.tsx # 数据管理(导入导出 + 恢复出厂)
│ │ │ ├── MiCloudImport.tsx # 小米云笔记导入
│ │ │ ├── OppoCloudImport.tsx # OPPO 云便签导入
│ │ │ ├── iCloudImport.tsx # iPhone/iCloud 备忘录导入
│ │ │ ├── TagInput.tsx # 标签输入组件
│ │ │ ├── ThemeProvider.tsx # 主题 Provider
│ │ │ └── ThemeToggle.tsx # 主题切换
│ │ ├── hooks/ # 自定义 Hooks
│ │ │ ├── useContextMenu.ts # 右键菜单状态管理 + 边缘碰撞检测
│ │ │ ├── useCapacitor.ts # Capacitor 移动端能力(返回键/状态栏/触觉反馈)
│ │ │ └── useSiteSettings.tsx # 站点设置 Context(标题/图标/字体)
│ │ ├── store/ # 状态管理(useReducer + Context)
│ │ ├── lib/ # 工具函数 & API 封装
│ │ │ ├── api.ts # API 客户端(含 AI 流式接口)
│ │ │ ├── exportService.ts # 导出服务
│ │ │ ├── importService.ts # 导入服务
│ │ │ └── miNoteService.ts # 小米云笔记服务封装
│ │ ├── i18n/ # 国际化配置 & 语言包(中/英)
│ │ └── types/ # 类型定义
│ ├── capacitor.config.ts # Capacitor 移动端配置
│ └── android/ # Android 原生壳
├── backend/ # 后端 Hono 应用
│ └── src/
│ ├── db/ # 数据库 Schema & 迁移(9 张表 + FTS5)
│ ├── routes/ # API 路由(15 个模块)
│ │ ├── auth.ts # 认证(登录/改密/恢复出厂)
│ │ ├── notebooks.ts # 笔记本 CRUD(无限层级)
│ │ ├── notes.ts # 笔记 CRUD(锁定/置顶/收藏)
│ │ ├── tags.ts # 标签管理
│ │ ├── tasks.ts # 待办任务(子任务/优先级/截止日期)
│ │ ├── mindmaps.ts # 思维导图 CRUD
│ │ ├── diary.ts # 说说/动态(时间线 + 发布/删除/统计)
│ │ ├── ai.ts # AI 聊天 + 写作助手 + RAG 知识问答
│ │ ├── search.ts # FTS5 全文搜索
│ │ ├── export.ts # 数据导入导出
│ │ ├── settings.ts # 站点配置(标题/图标/字体)
│ │ ├── fonts.ts # 自定义字体管理(上传/下载/删除)
│ │ ├── micloud.ts # 小米云笔记导入 API
│ │ ├── oppocloud.ts # OPPO 云便签导入 API
│ │ └── icloud.ts # iPhone/iCloud 备忘录导入 API
│ └── index.ts # 入口文件(JWT 中间件 + 路由注册 + 静态文件托管)
├── electron/ # Electron 桌面端
│ ├── main.js # 主进程(fork 后端 + 创建窗口)
│ ├── builder.config.js # electron-builder 打包配置
│ └── icon.png # 应用图标
├── Dockerfile # 多阶段构建(3 阶段)
├── docker-compose.yml # 容器编排(单服务 + 持久化卷)
└── package.json # 根级脚本
默认管理员账号:
admin/admin123首次登录后请立即在「设置 → 账号安全」中修改密码。
环境要求: Node.js 20+、Git
# 1. 克隆项目
git clone https://github.com/cropflre/nowen-note.git
cd nowen-note
# 2. 安装所有依赖
npm run install:all
# 3. 启动后端(端口 3001)
npm run dev:backend
# 4. 新开一个终端,启动前端(端口 5173,自动代理 /api → 3001)
npm run dev:frontend浏览器访问 http://localhost:5173 即可使用。
数据库文件位于 backend/data/nowen-note.db,备份此文件即可迁移数据。
适用于任何安装了 Docker 的 Linux / macOS / Windows 设备。
方法 A:docker-compose(推荐)
# 1. 克隆项目
git clone https://github.com/cropflre/nowen-note.git
cd nowen-note
# 2. 一键构建并启动
docker-compose up -d方法 B:纯 docker 命令(仅主应用)
# 1. 克隆并构建镜像
git clone https://github.com/cropflre/nowen-note.git
cd nowen-note
docker build -t nowen-note .
# 2. 创建数据目录并运行
mkdir -p /opt/nowen-note/data
docker run -d \
--name nowen-note \
--restart unless-stopped \
-p 3001:3001 \
-v /opt/nowen-note/data:/app/data \
-e DB_PATH=/app/data/nowen-note.db \
nowen-note浏览器访问 http://<你的IP>:3001 即可使用。
服务端口:
| 端口 | 服务 | 说明 |
|---|---|---|
3001 |
nowen-note | 主应用(前后端一体 + SQLite) |
环境变量说明:
| 变量名 | 默认值 | 说明 |
|---|---|---|
PORT |
3001 |
服务监听端口 |
DB_PATH |
/app/data/nowen-note.db |
数据库文件路径 |
NODE_ENV |
production |
运行环境 |
OLLAMA_URL |
(未设置) | Ollama 服务地址(如需本地 AI 请自行部署 Ollama) |
支持 Windows(NSIS 安装程序)、macOS(DMG)、Linux(AppImage)。
# 开发运行
npm run electron:dev
# 打包发布
npm run electron:build打包产物输出到 release/ 目录。桌面端自动 fork 后端进程,数据库存储在用户目录 nowen-data/ 下。
基于 Capacitor 8 构建 Android 原生应用,连接远程服务器使用。
方法 A:使用预编译 APK(推荐)
直接从 GitHub Releases 下载最新的 APK 安装包,传输到手机安装即可。
方法 B:自行编译
# 1. 构建前端
npm run build:frontend
# 2. 同步到 Android 项目
npx cap sync android
# 3. 用 Android Studio 打开并构建
npx cap open android
# 或直接命令行打包 Release APK(需配置签名)
cd frontend/android
./gradlew assembleRelease签名配置: 如需构建 Release 版本,请在 frontend/android/ 目录下创建 keystore.properties 文件:
storePassword=你的密码
keyPassword=你的密码
keyAlias=你的别名
storeFile=你的keystore路径移动端首次启动需配置服务器地址(IP:端口 或域名),通过 HTTP 连接到已部署的 nowen-note 后端。
Android 图标: 自定义设计的 Nowen Note 品牌图标,深色背景(#0D1117)+ 白色笔记纸 + 蓝色品牌字母 N + 铅笔装饰,支持 Android 自适应图标(Adaptive Icon)。
前提: 已安装 Container Manager(DSM 7.2+)或 Docker 套件(DSM 7.0 / 7.1)。
步骤:
-
上传镜像
- 在电脑上执行
docker build -t nowen-note .构建镜像 - 导出镜像:
docker save nowen-note -o nowen-note.tar - 在群晖 Container Manager → 映像 → 导入 → 上传
nowen-note.tar
- 在电脑上执行
-
创建容器
- 映像列表中选择
nowen-note→ 启动 - 端口设置:本地端口
3001→ 容器端口3001 - 存储空间:新增文件夹映射
- 本地路径:
/docker/nowen-note/data - 容器路径:
/app/data
- 本地路径:
- 环境变量(默认即可,无需修改)
- 映像列表中选择
-
访问使用
- 浏览器访问
http://<群晖IP>:3001
- 浏览器访问
提示: 数据备份只需复制
/docker/nowen-note/data/nowen-note.db文件。可使用群晖 Hyper Backup 定期备份该目录。
前提: 已开启 Docker 功能(绿联 UGOS Pro / UGOS)。
步骤:
-
导入镜像
- 在电脑上构建并导出镜像(同群晖步骤)
- 绿联 NAS → Docker → 镜像管理 → 本地导入
nowen-note.tar
-
创建容器
- 选择
nowen-note镜像 → 创建容器 - 网络:选择 bridge 模式
- 端口映射:主机
3001→ 容器3001 - 存储映射:
- 主机路径:
/mnt/user/appdata/nowen-note/data(或自定义路径) - 容器路径:
/app/data
- 主机路径:
- 重启策略:开机自启
- 选择
-
访问使用
- 浏览器访问
http://<绿联NAS IP>:3001
- 浏览器访问
前提: 飞牛 fnOS 已开启 Docker 功能。
步骤:
-
导入镜像
- 在电脑上构建并导出镜像(同群晖步骤)
- 飞牛 fnOS → Docker → 镜像 → 导入
nowen-note.tar
-
创建容器
- 选择
nowen-note镜像 → 创建容器 - 端口映射:主机
3001→ 容器3001 - 卷映射:
- 主机路径:
/vol1/docker/nowen-note/data(根据实际存储卷调整) - 容器路径:
/app/data
- 主机路径:
- 重启策略:除非手动停止
- 选择
-
访问使用
- 浏览器访问
http://<飞牛NAS IP>:3001
- 浏览器访问
前提: 已安装 Container Station(QTS 5.0+ / QuTS hero)。
步骤:
-
导入镜像
- 在电脑上构建并导出镜像(同群晖步骤)
- Container Station → 映像档 → 导入 → 选择
nowen-note.tar
-
创建容器
- 选择
nowen-note映像 → 创建 - 网络设置:NAT 模式,端口映射
3001→3001 - 共享文件夹:
- 主机路径:
/share/Container/nowen-note/data - 容器路径:
/app/data
- 主机路径:
- 其他:勾选"自动重新启动"
- 选择
-
访问使用
- 浏览器访问
http://<威联通IP>:3001
- 浏览器访问
提示: QNAP 也支持 docker-compose,在 Container Station → 创建 → 使用 YAML 创建,粘贴本项目的
docker-compose.yml内容即可。
前提: 极空间 ZOS 已开启 Docker 功能(极空间 Z4S / Z4 Pro / Z2 Pro 等)。
步骤:
-
导入镜像
- 在电脑上构建并导出镜像(同群晖步骤)
- 极空间 → Docker → 镜像 → 本地镜像 → 导入
nowen-note.tar
-
创建容器
- 选择
nowen-note镜像 → 创建容器 - 端口映射:本地
3001→ 容器3001 - 路径映射:
- 本地路径:选择一个文件夹(如
极空间/docker/nowen-note/data) - 容器路径:
/app/data
- 本地路径:选择一个文件夹(如
- 重启策略:自动重启
- 选择
-
访问使用
- 浏览器访问
http://<极空间IP>:3001
- 浏览器访问
- 数据持久化:务必将容器内的
/app/data目录映射到宿主机,否则容器删除后数据丢失 - 数据备份:只需备份映射目录中的
nowen-note.db文件 - 端口冲突:如 3001 端口被占用,可修改主机端口映射(如
8080:3001) - 安全建议:首次登录后请立即修改默认密码;如需外网访问,建议搭配反向代理(Nginx / Caddy)并启用 HTTPS
- Ollama:如需本地 AI 推理,请自行部署 Ollama 服务并配置
OLLAMA_URL环境变量
- JWT Token 认证(30 天有效期)
- 登录页面(带动画与默认账号提示)
- 修改用户名 / 密码(需验证当前密码)
- SHA256 → bcrypt 密码哈希自动升级
- 客户端模式支持服务器地址配置(Electron / Android / file:// 协议)
- 三栏布局:侧边栏 + 笔记列表 + 编辑器(均支持拖拽调整宽度,双击恢复默认)
- Tiptap 富文本编辑器:Markdown 快捷键、代码高亮、图片插入、任务列表
- 笔记操作:置顶、收藏、锁定(前后端双层保护)、软删除(回收站)、恢复、永久删除
- 笔记移动:右键菜单"移动到..."弹窗(树形笔记本选择器)、编辑器顶栏快速切换笔记本
- 字数统计:实时显示词数和字符数(中文按字计数,英文按空格分词)
- 笔记大纲:自动提取 H1-H3 标题生成大纲面板,点击标题跳转定位
- 日历筛选:笔记列表标题栏日历按钮,选择日期后按更新时间筛选笔记
- 乐观锁:version 字段防止编辑冲突
- 快捷键:
Alt+N快速新建笔记
- 支持无限层级嵌套(树形结构)
- 右键菜单:新建笔记、新建子笔记本、更换图标、重命名、删除
- 行内重命名:原地
<input>编辑,Enter 保存、Escape 取消 - 自定义图标:点击笔记本图标或右键「更换图标」弹出 Emoji 选择器(5 分类:物品/表情/科技/自然/食物)
- AI 写作助手:选中文本后触发,支持 10 种操作
- 续写、重写、润色、缩写、扩写
- 中英互译、总结、解释、语法修正
- 支持「替换选中」或「插入到光标后」两种应用方式
- AI 生成标题:基于笔记内容一键生成标题
- AI 推荐标签:智能推荐标签并自动创建、关联
- AI 知识问答(RAG):
- 基于 FTS5 + LIKE 模糊检索知识库相关笔记
- 将检索到的笔记片段作为上下文组装 RAG 提示词
- SSE 流式输出,Markdown 格式化渲染
- 支持多轮对话(自动携带最近 6 条历史消息)
- 显示参考笔记来源标签
- 多 AI 服务商支持:
| 服务商 | 默认模型 | 说明 |
|---|---|---|
| 通义千问 | qwen-plus | 阿里云 DashScope |
| OpenAI | gpt-4o-mini | OpenAI 官方 |
| Google Gemini | gemini-2.0-flash | Google AI Studio |
| DeepSeek | deepseek-chat | DeepSeek 官方 |
| 豆包(火山引擎) | doubao-1.5-pro-32k | 字节跳动 |
| Ollama | qwen2.5:7b | 本地部署,无需 API Key |
- 卡片式 Provider 选择:渐变色图标、配置状态指示、自动填充 URL 和模型
- 连接测试 & 模型列表拉取:实时验证配置可用性
- 可视化脑图编辑器,自研树形布局算法
- 节点操作:新增子节点、编辑、删除、折叠/展开
- 支持键盘快捷键(Tab/Enter/Delete/Space)
- 小地图导航,缩放平移,触摸手势
- 右键导出:PNG(2x 高清)、SVG、.xmind 格式
- 移动端适配:长按编辑节点、长按列表项触发导出菜单、响应式布局
- 任务中心:独立任务管理面板,桌面端三栏布局(筛选面板 + 列表 + 详情)
- 优先级:高 / 中 / 低三级优先级
- 截止日期:日期选择,智能显示(今天/明天/本周/已逾期)
- 子任务:父子关系任务拆分
- 多维筛选:全部 / 今天 / 本周 / 逾期 / 已完成
- 任务统计:完成率、逾期数等摘要
- 移动端适配:水平滚动筛选标签、任务详情全屏覆盖、触摸友好的删除按钮
- 微博风格时间线:一句话快速发布,轻量便捷
- 发布框:文字输入 + 心情选择(12 种)+
Ctrl+Enter快捷发布 - 动态卡片:内容 + 心情 emoji + 相对时间显示 + 删除(二次确认)
- 时间线分组:按日期自动分组(今天/昨天/具体日期),游标分页加载更多
- 统计概览:总动态数 + 今日发布数
- 基于 SQLite FTS5 虚拟表
- 通过触发器自动同步索引(INSERT/UPDATE/DELETE)
- 搜索 title + contentText
- 多对多关系,彩色标签
- 侧边栏标签面板快速筛选
- 通用右键菜单组件(毛玻璃面板 + 动画出入场)
- 四方向边缘碰撞检测(菜单不会溢出屏幕,8px 安全边距)
- 支持分隔线、危险操作高亮、禁用状态
- 笔记本列表 & 笔记列表均支持右键操作
- 导出备份:全量导出为 ZIP 压缩包(Markdown + YAML frontmatter),含进度条
- 导入笔记:支持拖拽上传
.md/.txt/.html/.zip文件,可选择目标笔记本 - 小米云笔记导入:通过 Cookie 认证连接小米云服务,自动获取笔记列表并批量导入
- OPPO 云便签导入:提供浏览器控制台提取脚本(OPPO 便签内容 AES 加密,仅页面端解密),一键复制脚本 → 粘贴 JSON → 选择导入
- iPhone/iCloud 备忘录导入:提供两种导入方式
- 方式一:通过 Mac/iPhone 直接导出为 .txt / .md / .html 文件后导入(推荐)
- 方式二:通过 iCloud 网页端控制台脚本自动提取,支持自动逐条点击 → 提取内容 → 复制到剪贴板 → 粘贴 JSON → 选择导入。自动转换 Apple Notes Checklist 为 Tiptap taskList 格式
- 恢复出厂设置:清空所有数据并重置管理员账户,二次确认防误触(需输入
RESET)
- 外观设置:主题切换(浅色 / 深色 / 跟随系统)、站点名称与图标自定义
- 字体管理:内置 4 种字体方案(默认 / 系统 / 衬线 / 等宽)+ 自定义字体上传(支持 otf/ttf/otc/ttc/woff/woff2,支持批量),实时预览
- AI 设置:AI 服务商配置、连接测试、模型管理
- 账号安全:修改用户名和密码
- 数据管理:导入导出与恢复出厂
- 深色 / 浅色 / 跟随系统三种主题模式
- 侧边栏可折叠(仅图标模式)
- 国际化支持:中英文双语切换
- Framer Motion 丝滑动画
- 全局快捷键:
Alt+N快速新建笔记 - 移动端全面适配:
- 抽屉式侧边栏(滑动手势开关)+ 列表/编辑器双视图切换
- TaskCenter 响应式三栏 → 移动端水平筛选标签 + 全屏详情
- SettingsModal 移动端全屏 + 顶部标签栏切换
- EditorPane 移动端「更多操作」菜单(删除/移动/AI/大纲)
- 触摸友好:所有 hover 交互按钮在移动端始终可见
- ContextMenu 四方向边界碰撞检测
- 编辑器元信息自动折行、MoveNoteModal 自适应宽度
- 日历筛选移动端入口、MindMap 列表长按导出
- safe-area-inset 安全区域适配(刘海屏 / 底部手势条)
- Web 端:浏览器直接访问,响应式布局适配桌面和移动端
- Electron 桌面端:Windows(NSIS)/ macOS(DMG)/ Linux(AppImage),自动管理后端进程,数据存储在用户目录
- Android 移动端:基于 Capacitor 构建原生应用,自定义品牌图标,支持 Release 签名打包,连接远程服务器使用
- 客户端模式:Electron 和 Android 端支持配置服务器地址,通过 HTTP 连接到已部署的后端
| 命令 | 说明 |
|---|---|
npm run install:all |
一键安装前后端所有依赖 |
npm run dev:backend |
开发模式启动后端(端口 3001) |
npm run dev:frontend |
开发模式启动前端(端口 5173) |
npm run build:all |
全量构建前后端 |
npm run build:frontend |
仅构建前端 |
npm run build:backend |
仅构建后端 |
npm run electron:dev |
Electron 开发运行 |
npm run electron:build |
Electron 打包发布 |
┌───────────────────────────────────────────┐
│ Docker Compose │
│ │
│ ┌─────────────────────────────────────┐ │
│ │ nowen-note :3001 │ │
│ │ │ │
│ │ ┌─────────────┐ │ │
│ │ │ Frontend │ │ │
│ │ │ React │ │ │
│ │ │ Tiptap │ │ │
│ │ ├─────────────┤ │ │
│ │ │ Backend │ │ │
│ │ │ Hono │◄──► 外部 AI API: │ │
│ │ │ SQLite │ 通义千问 │ │
│ │ │ JWT │ OpenAI/Gemini │ │
│ │ │ │ DeepSeek/豆包 │ │
│ │ └─────────────┘ Ollama(可选) │ │
│ └─────────────────────────────────────┘ │
└───────────────────────────────────────────┘
| 服务 | 镜像 | 端口 | 持久化卷 | 说明 |
|---|---|---|---|---|
| nowen-note | 自构建 | 3001 | nowen-note-data | 主应用(前后端一体 + SQLite) |
10 张数据表 + 1 张 FTS5 全文搜索虚拟表:
| 表名 | 说明 |
|---|---|
users |
用户表(用户名/密码哈希/头像) |
notebooks |
笔记本(支持 parentId 无限层级嵌套) |
notes |
笔记(JSON 内容 + 纯文本 + 锁定/置顶/收藏/归档/回收站) |
tags |
标签(彩色标签) |
note_tags |
笔记-标签多对多关联 |
attachments |
附件 |
tasks |
待办任务(支持子任务 parentId + 优先级 + 截止日期) |
diaries |
说说/动态(内容 + 心情 + 时间戳) |
system_settings |
系统设置键值对(含 AI 配置) |
custom_fonts |
自定义字体 |
notes_fts |
FTS5 全文搜索虚拟表(通过触发器自动同步) |
| 路径 | 认证 | 说明 |
|---|---|---|
/api/auth |
✗ | 登录 / 改密 / 恢复出厂 |
/api/health |
✗ | 健康检查 |
GET /api/settings |
✗ | 站点设置(品牌信息) |
GET /api/fonts |
✗ | 字体列表 / 字体文件 |
/api/notebooks |
✓ | 笔记本 CRUD |
/api/notes |
✓ | 笔记 CRUD |
/api/tags |
✓ | 标签管理 |
/api/search |
✓ | FTS5 全文搜索 |
/api/tasks |
✓ | 待办任务 |
/api/mindmaps |
✓ | 思维导图 CRUD |
/api/diary |
✓ | 说说/动态(发布/时间线/删除/统计) |
/api/ai |
✓ | AI 聊天 + 写作助手 + RAG |
/api/export |
✓ | 数据导入导出 |
/api/settings |
✓ | 站点配置(写操作) |
/api/fonts |
✓ | 字体上传 / 删除 |
/api/micloud |
✓ | 小米云笔记导入 |
/api/oppocloud |
✓ | OPPO 云便签导入 |
/api/icloud |
✓ | iCloud 备忘录导入 |
/api/me |
✓ | 当前用户信息 |
nowen-note is a self-hosted private knowledge management application with a modern frontend-backend separated architecture. It supports one-click Docker deployment, Electron desktop client, and Android mobile app (Capacitor). Featuring a Tiptap rich-text editor, AI-powered writing assistant (supporting 6 major AI providers + local Ollama), mind mapping, task management, moments/status updates, FTS5 full-text search, calendar filtering, multi-platform data import (Xiaomi / OPPO / iCloud), data export, and more — an all-in-one knowledge management platform.
| Layer | Technology |
|---|---|
| Frontend | React 18 + TypeScript + Vite 5 |
| Editor | Tiptap 3 (code highlight, image, task list, underline, text highlight, etc.) |
| UI Components | Radix UI + shadcn/ui style components + Lucide Icons |
| Styling | Tailwind CSS 3.4 + Framer Motion |
| i18n | i18next (Chinese/English) |
| Backend | Hono 4 + @hono/node-server |
| Database | SQLite (better-sqlite3) + FTS5 full-text search |
| Auth | JWT (jsonwebtoken) + bcryptjs password hashing |
| Validation | Zod |
| AI Engine | Qwen / OpenAI / Google Gemini / DeepSeek / Doubao / Ollama |
| Data Utils | JSZip (compression), Turndown (HTML→Markdown), FileSaver |
| Markdown | react-markdown + remark-gfm (AI chat rendering) |
| Desktop | Electron 33 (NSIS / DMG / AppImage packaging) |
| Mobile | Capacitor 8 (Android native shell) |
Default admin credentials:
admin/admin123Please change the password immediately after first login via Settings → Account Security.
Requirements: Node.js 20+, Git
# 1. Clone the project
git clone https://github.com/cropflre/nowen-note.git
cd nowen-note
# 2. Install all dependencies
npm run install:all
# 3. Start backend (port 3001)
npm run dev:backend
# 4. Open a new terminal, start frontend (port 5173, auto-proxies /api → 3001)
npm run dev:frontendVisit http://localhost:5173 in your browser.
Works on any device with Docker installed (Linux / macOS / Windows).
Method A: docker-compose (Recommended)
git clone https://github.com/cropflre/nowen-note.git
cd nowen-note
docker-compose up -dMethod B: docker run (main app only)
git clone https://github.com/cropflre/nowen-note.git
cd nowen-note
docker build -t nowen-note .
mkdir -p /opt/nowen-note/data
docker run -d \
--name nowen-note \
--restart unless-stopped \
-p 3001:3001 \
-v /opt/nowen-note/data:/app/data \
-e DB_PATH=/app/data/nowen-note.db \
nowen-noteVisit http://<your-ip>:3001 in your browser.
Service Ports:
| Port | Service | Description |
|---|---|---|
3001 |
nowen-note | Main app (frontend + backend + SQLite) |
Environment Variables:
| Variable | Default | Description |
|---|---|---|
PORT |
3001 |
Server listen port |
DB_PATH |
/app/data/nowen-note.db |
Database file path |
NODE_ENV |
production |
Runtime environment |
OLLAMA_URL |
(not set) | Ollama service URL (deploy Ollama yourself if local AI is needed) |
Supports Windows (NSIS installer), macOS (DMG), and Linux (AppImage).
# Development run
npm run electron:dev
# Build for release
npm run electron:buildOutput goes to the release/ directory. The desktop client automatically forks the backend process and stores data in the user's nowen-data/ directory.
Built with Capacitor 8 as a native Android app, connecting to a remote server.
# 1. Build frontend
npm run build:frontend
# 2. Sync to Android project
npx cap sync android
# 3. Open and build in Android Studio
npx cap open androidOn first launch, configure the server address (IP:port or domain) to connect to your deployed nowen-note backend via HTTP.
Android Icon: Custom-designed Nowen Note brand icon — dark background (#0D1117) + white note paper + blue brand letter N + pencil decoration, supporting Android Adaptive Icons.
All NAS platforms with Docker support follow the same general steps:
- Build & export image on your PC:
docker build -t nowen-note . && docker save nowen-note -o nowen-note.tar - Import
nowen-note.tarinto your NAS Docker manager - Create container with:
- Port mapping: host
3001→ container3001 - Volume mapping: host folder → container
/app/data - Restart policy: always / unless-stopped
- Port mapping: host
- Visit
http://<nas-ip>:3001
Important: Always map the
/app/datadirectory to persist your database. Back up thenowen-note.dbfile for data safety.
- JWT Token authentication (30-day expiry)
- Login page with animation and default credential hints
- Change username / password (requires current password verification)
- Automatic SHA256 → bcrypt password hash upgrade
- Client mode: server address configuration for Electron / Android / file:// protocol
- Three-column layout: Sidebar + Note List + Editor (all resizable via drag, double-click to reset)
- Tiptap rich-text editor: Markdown shortcuts, code highlighting, image upload, task lists
- Note operations: Pin, favorite, lock (frontend + backend dual-layer protection), soft delete (trash), restore, permanent delete
- Move notes: Right-click "Move to..." modal (tree notebook selector) + quick notebook switch in editor header
- Word count: Real-time word and character count (CJK characters counted individually, English by whitespace)
- Note outline: Auto-extract H1-H3 headings into outline panel with click-to-scroll navigation
- Calendar filter: Calendar button in note list header, filter notes by update date
- Optimistic locking: Version field to prevent edit conflicts
- Keyboard shortcut:
Alt+Nfor quick note creation
- Unlimited nested hierarchy (tree structure)
- Context menu: New note, new sub-notebook, change icon, rename, delete
- Inline rename: In-place
<input>editing, Enter to save, Escape to cancel - Custom icons: Click notebook icon or right-click "Change Icon" to open Emoji picker (5 categories: Objects/Smileys/Tech/Nature/Food)
- AI Writing Assistant: Triggered on text selection, 10 operations
- Continue, rewrite, polish, shorten, expand
- Translate (CN↔EN), summarize, explain, fix grammar
- Apply via "Replace selection" or "Insert after cursor"
- AI Title Generation: One-click title generation based on note content
- AI Tag Suggestion: Smart tag recommendation with auto-creation
- AI Knowledge Q&A (RAG):
- Retrieves related notes via FTS5 + LIKE fuzzy search
- Assembles RAG prompt with note snippets as context
- SSE streaming output with Markdown rendering
- Multi-turn conversation (last 6 messages as history)
- Displays referenced note source tags
- Multi-provider support:
| Provider | Default Model | Description |
|---|---|---|
| Qwen | qwen-plus | Alibaba DashScope |
| OpenAI | gpt-4o-mini | OpenAI Official |
| Google Gemini | gemini-2.0-flash | Google AI Studio |
| DeepSeek | deepseek-chat | DeepSeek Official |
| Doubao (Volcengine) | doubao-1.5-pro-32k | ByteDance |
| Ollama | qwen2.5:7b | Local deployment, no API key needed |
- Card-style provider selection: Gradient icons, config status indicators, auto-fill URL & model
- Connection test & model list fetch: Real-time configuration validation
- Visual mind map editor with custom tree layout algorithm
- Node operations: add child, edit, delete, collapse/expand
- Keyboard shortcuts (Tab/Enter/Delete/Space)
- Mini-map navigation, zoom/pan, touch gestures
- Right-click export: PNG (2x HD), SVG, .xmind format
- Mobile responsive: long-press to edit nodes, long-press list items for export menu, adaptive layout
- Task Center: Dedicated task management panel with desktop three-column layout (filter panel + list + detail)
- Priority levels: High / Medium / Low
- Due dates: Date picker with smart display (today/tomorrow/this week/overdue)
- Subtasks: Parent-child task breakdown
- Multi-filter: All / Today / This Week / Overdue / Completed
- Task statistics: Completion rate, overdue count summary
- Mobile adaptive: Horizontal scrollable filter tabs, full-screen task detail overlay, touch-friendly delete buttons
- Weibo-style timeline: Quick one-liner posting, lightweight and fast
- Compose box: Text input + mood selection (12 moods) +
Ctrl+Enterquick post - Moment cards: Content + mood emoji + relative time display + delete (with confirmation)
- Timeline grouping: Auto-grouped by date (today/yesterday/specific date), cursor-based pagination
- Stats overview: Total moments count + today's post count
- Based on SQLite FTS5 virtual tables
- Auto-synced via triggers (INSERT/UPDATE/DELETE)
- Searches both title and contentText
- Many-to-many relationships with colored tags
- Sidebar tag panel for quick filtering
- Reusable component (frosted glass panel + animated transitions)
- Four-direction edge collision detection (menu never overflows screen, 8px safe margin)
- Supports separators, danger action highlighting, disabled states
- Available on both notebook tree and note list
- Export backup: Full export as ZIP archive (Markdown + YAML frontmatter) with progress bar
- Import notes: Drag-and-drop
.md/.txt/.html/.zipfiles, choose target notebook - Mi Cloud import: Connect to Xiaomi Cloud via cookie authentication, auto-fetch and batch import
- OPPO Cloud import: Browser console extraction script (AES-encrypted, client-side only), copy script → paste JSON → import
- iPhone/iCloud import: Two import methods
- Method 1: Export from Mac/iPhone as .txt / .md / .html files and import directly (recommended)
- Method 2: Browser console script for iCloud web — auto-clicks notes one by one → extracts content → copies JSON to clipboard → paste and import. Automatically converts Apple Notes Checklist to Tiptap taskList format
- Factory reset: Wipe all data and reset admin account, requires typing
RESETto confirm
- Appearance: Theme switch (light / dark / system), custom site name and favicon
- Font management: 4 built-in font schemes (default / system / serif / monospace) + custom font upload (otf/ttf/otc/ttc/woff/woff2, batch upload), live preview
- AI settings: AI provider configuration, connection test, model management
- Account Security: Change username and password
- Data Management: Import/export and factory reset
- Light / Dark / System three theme modes
- Collapsible sidebar (icon-only mode)
- Internationalization: Chinese/English language switching
- Smooth Framer Motion animations
- Global keyboard shortcut:
Alt+Nfor quick note creation - Comprehensive mobile adaptation:
- Drawer-style sidebar (swipe gesture toggle) + list/editor dual-view switch
- TaskCenter responsive: desktop three-column → mobile horizontal filter tabs + full-screen detail
- SettingsModal mobile full-screen + top tab bar navigation
- EditorPane mobile "More actions" menu (delete/move/AI/outline)
- Touch-friendly: all hover-dependent buttons always visible on mobile
- ContextMenu four-direction boundary collision detection
- Editor meta info auto-wrap, MoveNoteModal responsive width
- Calendar filter mobile entry, MindMap list long-press export
- safe-area-inset adaptation (notch / gesture bar)
- Web: Browser access with responsive layout for desktop and mobile
- Electron Desktop: Windows (NSIS) / macOS (DMG) / Linux (AppImage), automatic backend process management, data stored in user directory
- Android Mobile: Native app built with Capacitor, custom brand icon, Release signing support, connects to remote server
- Client Mode: Electron and Android clients support server address configuration via HTTP
| Command | Description |
|---|---|
npm run install:all |
Install all frontend and backend dependencies |
npm run dev:backend |
Start backend in development mode (port 3001) |
npm run dev:frontend |
Start frontend in development mode (port 5173) |
npm run build:all |
Build both frontend and backend |
npm run build:frontend |
Build frontend only |
npm run build:backend |
Build backend only |
npm run electron:dev |
Run Electron in development mode |
npm run electron:build |
Build Electron for release |
┌───────────────────────────────────────────┐
│ Docker Compose │
│ │
│ ┌─────────────────────────────────────┐ │
│ │ nowen-note :3001 │ │
│ │ │ │
│ │ ┌─────────────┐ │ │
│ │ │ Frontend │ │ │
│ │ │ React │ │ │
│ │ │ Tiptap │ │ │
│ │ ├─────────────┤ │ │
│ │ │ Backend │ │ │
│ │ │ Hono │◄──► External AI: │ │
│ │ │ SQLite │ Qwen/OpenAI │ │
│ │ │ JWT │ Gemini/DeepSeek│ │
│ │ │ │ Doubao/Ollama │ │
│ │ └─────────────┘ │ │
│ └─────────────────────────────────────┘ │
└───────────────────────────────────────────┘
| Service | Image | Port | Volumes | Description |
|---|---|---|---|---|
| nowen-note | Self-built | 3001 | nowen-note-data | Main app (frontend + backend + SQLite) |
| Path | Auth | Description |
|---|---|---|
/api/auth |
✗ | Login / change password / factory reset |
/api/health |
✗ | Health check |
GET /api/settings |
✗ | Site settings (branding) |
GET /api/fonts |
✗ | Font list / font files |
/api/notebooks |
✓ | Notebook CRUD |
/api/notes |
✓ | Note CRUD |
/api/tags |
✓ | Tag management |
/api/search |
✓ | FTS5 full-text search |
/api/tasks |
✓ | Task management |
/api/mindmaps |
✓ | Mind map CRUD |
/api/diary |
✓ | Moments (post/timeline/delete/stats) |
/api/ai |
✓ | AI chat + writing assistant + RAG |
/api/export |
✓ | Data import/export |
/api/settings |
✓ | Site configuration (write) |
/api/fonts |
✓ | Font upload / delete |
/api/micloud |
✓ | Mi Cloud notes import |
/api/oppocloud |
✓ | OPPO Cloud notes import |
/api/icloud |
✓ | iCloud notes import |
/api/me |
✓ | Current user info |