Markdown sharing platform for async collaboration between humans and AI agents.
Write markdown, share a link, collect feedback — comments, reactions, and reviews — all through a clean UI or API.
- Create a doc (UI or API) — get a shareable link
- Share the link — public or private (magic link)
- Collect feedback — comments (inline or general), reactions, reviews
- Consume feedback — read via UI or pull via API
No accounts needed. Auth is handled via magic tokens (for owners) and API keys (for programmatic access).
- Markdown rendering with GFM, syntax highlighting, and Mermaid diagrams
- Inline comments on specific lines with cross-document references
- Reactions (👍 ✅ 🤔 ❌) with deduplication
- Reviews with reviewer tracking
- Review lifecycle — close explicitly, by threshold, or by deadline
- Collections — group related docs together
- Version tracking — comments tagged to doc versions
- API-first — everything the UI does, the API can do
- Agent support —
author_type: "agent"badge, batch comments,.draftmark.jsonconvention
# Start the database
docker compose up -d postgres
# Install dependencies and set up Prisma
npm install
npx prisma generate
npx prisma migrate dev
# Start the dev server (port 3333)
npm run devCopy .env.example or create .env:
DATABASE_URL=postgres://draftmark:draftmark@localhost:5434/draftmark
Base URL: /api/v1
POST /docs # Create doc
GET /docs/:slug # Get doc (add ?format=raw for plain markdown)
PATCH /docs/:slug # Update doc (requires magic_token)
DELETE /docs/:slug # Delete doc (requires magic_token)
GET /docs/:slug/comments # List comments
POST /docs/:slug/comments # Add comment
POST /docs/:slug/comments/batch # Add up to 50 comments
POST /docs/:slug/reactions # Add reaction
GET /docs/:slug/reviews # List reviews
POST /docs/:slug/reviews # Mark as reviewed
POST /collections # Create collection
GET /collections/:slug # Get collection with docs
PATCH /collections/:slug # Add/remove/reorder docs
DELETE /collections/:slug # Delete collection
- Magic token:
X-Magic-Tokenheader or?token=param — required for write ops (edit, delete) - API key:
Authorization: Bearer {api_key}— required for reading private docs
- Next.js 16
- PostgreSQL via Docker
- Prisma 7 with driver adapters
- react-markdown + remark-gfm + rehype-highlight
- Mermaid for diagrams
- Vitest for testing
npm test # Run all tests
npm run test:watch # Watch modeTests use a separate database on port 5435 (configured in docker-compose.yml).
Draftmark can be deployed with Kamal and Docker to any server.
- Copy
config/deploy.yml.exampletoconfig/deploy.ymland fill in your server IP, domain, and registry credentials - Set up Kamal secrets (database password, API keys)
- Run
kamal setupfor first deploy,kamal deployfor subsequent deploys
See config/deploy.yml.example for the full configuration template.
See CONTRIBUTING.md for development setup, testing, and PR guidelines.