Notion's architecture, self-hosted: a block editor with real-time AI
A full-stack TypeScript project that wires Tiptap, Yjs CRDTs, and NestJS into a collaborative document platform with built-in brainstorming and writing assistance.

What it does
DocFlow is a block-level document editor built for teams. It gives you Notion-style draggable blocks—text, tables, code, media, and 20-odd other types—plus real-time multiplayer editing through Yjs CRDTs. AI features (brainstorming, rewriting, continuation, and a basic chat) are baked into the editor rather than bolted on the side. The stack is deliberately conventional: Next.js App Router on the frontend, NestJS with Prisma on the backend, Hocuspocus handling WebSocket sync, and the usual observability suspects (Prometheus/Grafana, ELK, MinIO, RabbitMQ) already wired in.
The interesting bit
The project treats AI as a context-aware collaborator, not a text generator. The “brainstorm” feature returns 3–6 structured cards with implementation angles; the “continue writing” feature uses RAG to pull from earlier document content so the prose stays on-theme. That is a harder integration than slapping a chatbot next to a textarea, and it suggests the authors actually use the tool for planning and specs.
Key highlights
- Block editor with 20+ content types, drag-and-drop reordering, and slash-command shortcuts via Tiptap/ProseMirror extensions
- Real-time collaborative editing with cursor tracking, presence awareness, and automatic conflict resolution via Yjs
- AI assistant for brainstorming, tone-aware rewriting, and RAG-grounded continuation
- Full backend included: NestJS, Prisma ORM, Hocuspocus WebSocket server, plus Docker Compose for one-command deployment
- Monitoring and logging stack already integrated: Prometheus/Grafana metrics, ELK for log search, RabbitMQ for async jobs
Caveats
- Requires Node.js ≥ 24 and pnpm ≥ 10.28.2, which is aggressive for some CI environments
- AI chat currently lives on a separate page; sidebar integration and “Agent” mode (auto-editing like Cursor) are explicitly marked as future work
- Monorepo refactor and plugin ecosystem are roadmap items, not shipped
Verdict
Worth a look if you want a self-hosted Notion alternative with real-time collaboration already working and AI features that go beyond generic GPT wrappers. Skip it if you need a polished SaaS with mobile apps or if your infrastructure is stuck on older Node versions.