AFFiNE
Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.
AFFiNE is an open-source, local-first knowledge workspace that merges rich-text documents, infinite whiteboards, and multi-view databases into a single unified platform. Rather than forcing you to switch between a notes app, a whiteboard tool, and a task manager, AFFiNE places every type of content — paragraphs, sticky notes, embedded pages, databases, shapes, and slides — onto one edgeless canvas where connections between ideas are natural and immediate.
At its technical core, AFFiNE is powered by BlockSuite, a purpose-built collaborative editor framework, combined with y-octo — a Rust-native, high-performance implementation of the Yjs CRDT standard. This gives AFFiNE real-time collaboration without the typical conflicts of shared editing, while keeping all data resident on your device first. The backend, when self-hosted, runs on NestJS with PostgreSQL and Redis, exposing a GraphQL API consumed by the web client, desktop (Electron), iOS, and Android applications.
AFFiNE is built for individuals, teams, and organizations who need full ownership of their knowledge infrastructure. A solo developer can use it locally with no server at all; a team can self-host with full sync and real-time collaboration; an enterprise can deploy with the managed cloud tier or bring their own infrastructure. The project is MIT-licensed on the frontend and editor layers, with the backend under an EE license that requires a subscription for production use.
Backed by an active open-source community of over 200 contributors and consistently releasing updates, AFFiNE is one of the most technically ambitious knowledge management tools in the open-source ecosystem, combining the block-based expressiveness of Notion with the spatial freedom of Miro in a single application that you control.
What You Get
- Edgeless Canvas Editor — A unified infinite workspace where rich text blocks, sticky notes, web embeds, databases, shapes, and presentation slides can be placed and connected freely without rigid page layouts.
- AFFiNE AI Integration — Built-in AI assistant that transforms text outlines into slides, summarizes documents into mind maps, generates diagrams from prompts, and assists with writing and task planning directly inside the canvas.
- Local-First Architecture — All workspace data is stored on your device by default using a custom CRDT-based storage engine (nbstore), ensuring full data ownership and offline operation without requiring a server.
- Real-Time Collaborative Editing — Multiple users can simultaneously edit documents, whiteboards, and databases with live cursor tracking and conflict-free sync powered by y-octo (Rust-native Yjs CRDT) and WebSockets.
- Multi-View Databases — Create structured data tables and visualize the same records as kanban boards, calendars, galleries, or linked views — all embeddable directly within the canvas alongside other content types.
- Self-Hosting Support — The full server stack (NestJS, PostgreSQL, Redis) is open-source and documented, allowing teams to run AFFiNE entirely on their own infrastructure with complete control over data and access.
- Template Library — A growing collection of pre-built templates for vision boards, Cornell notes, ADHD planners, travel itineraries, lesson plans, and SOPs, all editable and shareable inside the app.
- Cross-Platform Native Apps — Dedicated Electron desktop apps for Windows, macOS, and Linux, plus iOS and Android mobile apps, all sharing the same CRDT-based storage so data stays consistent across devices.
Common Use Cases
- Personal knowledge management — A researcher uses AFFiNE to collect papers, annotate PDFs, draw concept maps, and link related ideas on a canvas, with AI summarizing articles into structured mind maps for review sessions.
- Distributed team planning — A product team combines roadmap whiteboards, sprint task databases, and meeting notes in a single shared AFFiNE workspace, collaborating in real time without switching between Notion, Miro, and Jira.
- Self-hosted company wiki — A startup deploys AFFiNE on their own server to maintain internal documentation, runbooks, and architectural diagrams in one place, keeping all knowledge assets off third-party cloud platforms.
- Creative project boards — A design team uses the infinite canvas to organize mood boards, embed reference images and URLs, add freehand sketches, and link to spec documents — all in one spatial workspace.
- Journaling and daily planning — An individual uses AFFiNE’s auto-generated date-based journal documents alongside kanban task boards to maintain daily logs, capture fleeting ideas, and track personal goals without multiple apps.
- Educational content creation — A teacher builds lesson plans with embedded videos, Cornell note templates, checklists, and mind maps, then shares the editable canvas with students for interactive class participation.
Under The Hood
Architecture AFFiNE is structured as a large TypeScript monorepo spanning dedicated packages for the editor framework (BlockSuite), frontend application core, shared native bindings, and the NestJS backend server — each with its own dependency graph and build target. The editor is built on a block-tree model where every piece of content, regardless of whether it appears in a document or on the canvas, is a first-class CRDT-backed block with a shared addressing scheme. This abstraction is what makes seamless transitions between page mode and edgeless canvas mode possible without content duplication or view-specific encoding. The backend follows a module-driven NestJS architecture with clear layering between controllers, resolvers, services, and models — and a plugin system that optionally activates enterprise features like payment, AI copilot, and license management without modifying core logic. Dependency injection is explicit throughout, enabling independent testing and conditional feature activation based on deployment environment.
Tech Stack The frontend is written entirely in TypeScript targeting web components via the Lit framework, bundled with Vite and SWC for rapid iteration. CRDT state management runs on y-octo, a Rust-compiled NAPI binding delivering native performance to the Node.js and browser runtimes. The backend runs NestJS on Node.js with PostgreSQL accessed through Prisma ORM, Redis for caching and job queues via BullMQ, and Socket.io for real-time sync channels. Desktop packaging uses Electron while mobile targets iOS (Swift) and Android (Kotlin) through a Capacitor bridge. Native Rust crates handle storage (SQLite via nbstore), media capture, and PDF/DOCX parsing. Build tooling spans oxlint, Prettier, taplo, vanilla-extract for type-safe scoped CSS, Vitest for unit tests, and Playwright for end-to-end test suites across local, cloud, desktop, and mobile targets.
Code Quality The codebase demonstrates comprehensive testing discipline across multiple layers: Vitest-based unit tests cover the BlockSuite store, document model, Yjs integration, schema validation, and transformer serialization; Playwright E2E test suites are organized by deployment target (affine-local, affine-cloud, affine-desktop, affine-mobile) and cover a wide range of user flows from drag-and-drop to AI interactions. Snapshot testing validates CRDT serialization fidelity. TypeScript strict mode is enforced across all packages, Prisma provides end-to-end type safety from schema to query result, and pre-commit hooks via lint-staged enforce formatting and linting before every commit. Error handling in the backend uses structured custom classes with explicit HTTP mappings, and the NestJS guard and interceptor patterns enforce consistent access control without scattering auth logic through individual handlers.
What Makes It Unique AFFiNE’s most distinctive technical contribution is the BlockSuite editor framework — a system where documents and infinite canvases share the same block tree, cursor model, and CRDT addressing, enabling genuinely unified editing rather than embedding two separate applications side by side. The decision to build y-octo as a high-performance Rust NAPI binding for Yjs — rather than relying on the JavaScript Yjs library alone — reflects a deliberate commitment to making real-time collaboration fast enough for canvas-scale operations with potentially thousands of blocks. The cross-platform story is architecturally coherent: the same nbstore CRDT storage abstraction underlies the local SQLite engine, the server-side sync, and the mobile native storage, so all clients share a unified data contract without platform-specific divergence.
Self-Hosting
AFFiNE uses a split licensing model that self-hosters must understand before deploying in production. The frontend application and BlockSuite editor framework are released under the MIT license, meaning you can freely use, modify, and redistribute those components without restriction, including for commercial purposes. However, the backend server code — everything under the packages/backend and packages/common/native directories — is released under the AFFiNE Enterprise Edition (EE) License, which requires a valid AFFiNE subscription to use in production. You may freely use and modify the server code for development and testing, but running it in a production environment serving real users requires purchasing a seat-based subscription from AFFiNE. This is a common business model in the open-core space, so read the EE license carefully before committing to self-hosting at scale.
Operationally, self-hosting AFFiNE is a meaningful engineering investment. The server stack requires PostgreSQL and Redis in addition to the Node.js application itself, and the native Rust components must be compiled for your target platform. Docker-based deployment is supported and documented, which simplifies initial setup, but ongoing responsibilities include database backups, PostgreSQL tuning as workspace data grows, Redis memory management, SSL termination, and keeping the server pinned to compatible client versions — AFFiNE has stated that clients below a certain version may be rejected by newer servers. There is no official Kubernetes Helm chart, so teams deploying to container orchestration platforms will need to author their own manifests. The project releases frequently (multiple times per month), so keeping a self-hosted instance current requires a consistent update cadence.
Compared to AFFiNE Cloud (the managed hosted offering), a self-hosted deployment trades convenience for control. The cloud tier handles infrastructure, automatic upgrades, managed backups, and SLA-backed uptime — none of which comes automatically with self-hosting. The AFFiNE Pro cloud subscription also unlocks AI features (the Copilot/AI plugin) and version history beyond the free tier; these same features are available to self-hosters with an appropriate license key, but require separate setup. Teams evaluating self-hosting should weigh their operational capacity against the subscription cost of the cloud offering, particularly if AI-assisted editing is a priority workflow.
Related Apps
AutoGPT
Automation · Productivity · AI Assistants
Build, deploy, and run autonomous AI agents that automate complex multi-step workflows using a visual block-based graph editor.
AutoGPT
OtherDify
No Code Platforms · AI Development · Developer Tools
Visual LLM workflow platform with RAG pipelines, agent capabilities, and model management for building production AI applications.
Dify
OtherZed
Developer Tools · Collaboration · Code Editors
High-performance, multiplayer code editor built in Rust by the creators of Atom and Tree-sitter, with native AI integration and real-time collaboration.