What Is AFFiNE and Its Core Purpose? The Open-Source All-in-One Workspace Explained
AFFiNE is an open-source, all-in-one workspace and operating system that combines wiki-style documents, multi-view databases, infinite whiteboards, and AI assistance into a single, local-first platform designed as a privacy-focused alternative to Notion and Miro.
AFFiNE (pronounced "a-fine") is a comprehensive knowledge management platform developed under the toeverything/AFFiNE repository. Understanding what AFFiNE is and its core purpose reveals why it stands out as a self-hostable, extensible workspace that merges structured documentation with visual canvas-based collaboration.
Understanding AFFiNE's Core Purpose and Architecture
The fundamental purpose of AFFiNE is to eliminate the friction between different modes of knowledge work—writing, planning, visualizing, and coding—by housing them in a unified, edgeless environment.
All-in-One Workspace Philosophy
At its core, AFFiNE functions as an operating system for knowledge that integrates:
- Wiki-style documents with rich-text editing
- Multi-view databases for structured data management
- Infinite canvas whiteboards with shapes, sticky notes, and embedded web pages
- Presentation mode for slide-based storytelling
- Digital asset management for images, files, and media
This hyper-merged environment, implemented in the frontend architecture found in packages/frontend/apps/desktop/src/main.ts, allows users to seamlessly transition between writing a technical specification and whiteboarding the architecture diagram on the same canvas.
Local-First Privacy Model
AFFiNE's core purpose emphasizes data sovereignty. Unlike cloud-only competitors, AFFiNE stores data locally by default using the OctoBase backend and Y-JS CRDTs (Conflict-free Replicated Data Types) for synchronization. This architecture ensures:
- Complete data ownership residing on your device
- Optional real-time sync and collaboration when desired
- Offline-first functionality with conflict resolution
Key Features That Define AFFiNE
AI-Powered Assistance
The integrated AFFiNE AI transforms the workspace from passive storage to active creation. According to the repository's implementation, the AI can:
- Generate presentation slides from bullet points
- Create mind maps from unstructured notes
- Write code snippets and technical documentation
- Transform natural language prompts into structured database entries
This functionality is accessible directly on the edgeless canvas, allowing AI-generated content to coexist with manually created documents and whiteboard elements.
Self-Hosting and Extensibility
AFFiNE is designed as a self-hostable platform built on modern web technologies including React, Vite, and Electron. The monorepo structure supports:
- Desktop applications via Electron (
packages/frontend/apps/desktop/) - Web clients with offline capabilities
- Docker-based self-hosted deployments
The plugin ecosystem, referenced in docs/reference/readme.md, allows developers to extend core functionality without modifying the underlying codebase.
Technical Implementation and Code Structure
Developers interacting with the AFFiNE codebase typically use the custom CLI and monorepo scripts defined in the root package.json.
Development Workflow
To start the local development server with hot-reloading:
# From the repository root
yarn affine dev
This command initializes the web client and local backend services, enabling real-time testing of document and canvas features.
Building Production Bundles
For creating optimized deployment assets:
yarn affine build
This produces production-ready bundles for both desktop (Electron) and web deployments, including Docker image generation for self-hosted instances.
Using the AFFiNE CLI
The repository provides the af shortcut for common workspace tasks:
# Initialize a fresh workspace
af init
# Start the development environment
af start
These commands reference the CLI entry point at affine.ts, which orchestrates the complex monorepo interactions across the frontend, backend, and infrastructure packages located in packages/common/infra/src/index.ts.
Summary
- AFFiNE is an open-source, all-in-one workspace combining documents, databases, and whiteboards into a single canvas.
- Its core purpose is to serve as a privacy-first, local-first operating system for knowledge management.
- The platform is built as a self-hostable alternative to Notion and Miro, utilizing React, Electron, and CRDT-based synchronization.
- AFFiNE AI integrates directly into the workspace to generate content, code, and visual structures.
- Developers can extend functionality through the plugin system and contribute to the monorepo using the
yarn affineCLI tools.
Frequently Asked Questions
What makes AFFiNE different from Notion?
Unlike Notion, which stores data primarily in the cloud, AFFiNE operates on a local-first architecture where your data resides on your device by default. AFFiNE also integrates infinite canvas whiteboarding directly alongside documents and databases, whereas Notion requires separate tools like Miro for visual collaboration. Additionally, being open-source, AFFiNE allows complete customization and self-hosting.
Is AFFiNE completely free to use?
Yes, AFFiNE is open-source and free under the appropriate license terms found in the repository. You can self-host the application without licensing fees, and the core functionality—including documents, whiteboards, databases, and basic AI features—is available at no cost. The project may offer managed cloud services in the future, but the software itself remains free and open-source.
How does AFFiNE handle data privacy?
AFFiNE implements a privacy-by-design approach using local-first storage powered by OctoBase and Y-JS CRDTs. Your data is stored locally on your device, ensuring you maintain full ownership. When collaboration is needed, AFFiNE uses encrypted synchronization protocols, but the default state keeps sensitive information off external servers. This architecture prevents vendor lock-in and ensures your knowledge base remains accessible even offline.
What technology stack powers AFFiNE?
AFFiNE is built on a modern React and TypeScript frontend utilizing Vite for build tooling. The desktop application runs on Electron, while the backend synchronization relies on OctoBase and Y-JS CRDTs for conflict-free real-time collaboration. The edgeless canvas and block-based editing system are powered by BlockSuite, a dedicated editor framework developed by the same team. The monorepo structure is managed with Yarn workspaces.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →