@nielpattin/documine
v1.1.3
Published
Self-hosted collaborative markdown editor (pdf preview) with inline comment threads
Downloads
55
Maintainers
Readme
Quick Start
pnpm install
pnpm devOpen http://localhost:5173 for the editor and http://localhost:3120 for the API.
Prefer a global install?
pnpm add -g @nielpattin/documine
documine serve --port=3120 --data=./dataFeatures
| | |
|---|---|
| ✏️ Real-time collab | Multiple cursors, live sync, undo/redo — works across tabs and users |
| 🔍 Live PDF preview | Rendered preview pane synced to the editor, with scroll sync |
| 🖨️ PDF export | Configurable Pandoc PDF export with shareable, revocable links |
| 💬 Anchored comments | Select text, add a thread. Reply, resolve, reopen. Threads survive edits |
| 🔗 Share with control | Per-note links with configurable access: view, comment, or edit |
| 🤖 Agent-ready CLI | Register with an API key or share link. Read, edit, comment — from a terminal or AI agent |
| 🌓 Dark + light | Theme toggle with persisted preference |
| 📱 Mobile | Responsive layout for editing on smaller screens |
| 🐳 Docker | One-command deployment with docker-compose |
CLI
DocuMine's CLI works in two modes. Both are accessible to humans and agents alike.
Owner mode
Create API keys from the settings gear on the landing page. Full access to all notes.
documine register myserver https://documine.example.com <api-key>
documine myserver list
documine myserver search "query"
documine myserver read <note-id>
documine myserver create "My note"
documine myserver edit <note-id> '[{"oldText":"foo","newText":"bar"}]'
documine myserver delete <note-id>Shared mode
Share links are the credential. No API key needed. Access level set by the owner.
documine register shared https://documine.example.com/s/abc123
documine shared read
documine shared edit '[{"oldText":"foo","newText":"bar"}]'
documine shared comment "quoted text" "comment body" --name="My Agent"HTTP API
All owner endpoints use Authorization: Bearer <api-key>.
| Method | Endpoint | Description |
| ------ | -------- | ----------- |
| GET | /api/notes?q=<query> | List / search notes |
| POST | /api/notes | Create note |
| GET | /api/notes/:id | Read note |
| PUT | /api/notes/:id | Update title, markdown, or share access |
| DELETE | /api/notes/:id | Delete note |
| POST | /api/notes/:id/edit | Apply text edits |
| POST | /api/notes/:id/threads | Create comment thread |
| POST | /api/notes/:id/threads/:tid/replies | Reply to thread |
| PATCH | /api/notes/:id/threads/:tid | Resolve / reopen thread |
| DELETE | /api/notes/:id/threads/:tid | Delete thread |
| PATCH | /api/notes/:id/messages/:mid | Edit comment |
| DELETE | /api/notes/:id/messages/:mid | Delete comment |
| GET | /api/keys | List API keys |
| POST | /api/keys | Create API key |
| DELETE | /api/keys/:id | Delete API key |
| Method | Endpoint | Description |
| ------ | -------- | ----------- |
| GET | /api/share/:sid | Read shared note |
| GET | /api/share/:sid/note | Read shared note (lightweight) |
| POST | /api/share/:sid/edit | Edit (requires edit access) |
| POST | /api/share/:sid/threads | Create comment |
| POST | /api/share/:sid/threads/:tid/replies | Reply |
| POST | /api/share/:sid/render | Render markdown to HTML |
Architecture
apps/web → React + Vite frontend (editor, preview, comments)
src/server.ts → Hono API server with WebSocket collab
data/ → .md files on disk + .json sidecars (source of truth)Notes are stored as markdown files on disk. The .json sidecar holds the collaborative editing state (history, cursors, threads). Markdown files are written for convenience — grep, backup, and external tooling.
Docker
cd docker
bash control.sh startdevStarts the API on http://localhost:3120 and the frontend on http://localhost:5175.
Development
git clone https://github.com/nielpattin/documine.git
cd documine
pnpm install
pnpm devThe API runs on http://localhost:3120. The frontend runs on http://localhost:5175.
Data layout
data/
auth.json
notes/
<id>.md
<id>.jsonContributing
Contributions are welcome. Open an issue or pull request.
