AFFiNE
repository·canary·Indexed 13 days ago
https://github.com/toeverything/affineAn open-source, local-first workspace that merges document editing and visual whiteboarding into a single 'hyper-fused' platform. Built on a block-based architecture, it provides a privacy-focused alternative to Notion and Miro. The documentation covers the BlockSuite ecosystem, including extension providers for stores and views, the @blocksuite/std standard library, and the @blocksuite/std/gfx graphics API for managing visual elements and geometry.
What's inside AFFiNE
- AFFiNE Mobile Edition is a web application designed specifically for mobile environments. It provides a mobile-optimized experience of the AFFiNE workspace.
Overview of the @blocksuite/std/gfx API
canaryThegfxmodule within@blocksuite/stdprovides low-level graphics primitives and utilities for managing visual elements, geometry, and selection within the BlockSuite ecosystem. It includes abstractions for element models, geometry interfaces, and selection management, enabling developers to handle complex visual layouts and interactions.Overview of BlockSuite Playground Apps
canaryThe
blocksuite/playground/appsdirectory contains the application entry points used for the BlockSuite playground online site. These applications serve two primary purposes:- Comprehensive Examples: They demonstrate the full capabilities of the BlockSuite framework through real-world application implementations.
- E2E Testing Entry Points: They act as the starting points for executing End-to-End (E2E) test cases within the BlockSuite ecosystem.
Overview of @blocksuite/sync
canaryThe@blocksuite/syncpackage is the data synchronization engine for BlockSuite. It is responsible for managing data consistency and synchronization across different states or clients within the BlockSuite ecosystem.Overview of @blocksuite/store
canary@blocksuite/storeis a general-purpose state management data store designed for the BlockSuite framework. It is the underlying data management layer used in AFFiNE. For detailed technical documentation, API references, and advanced usage patterns, visit the official BlockSuite website.Overview of @blocksuite/std API
canaryThe@blocksuite/stdpackage provides the core standard library and foundational abstractions for BlockSuite. It includes essential classes for managing commands, monitoring lifecycles, and various extension points for customizing block views, configurations, flavors, keymaps, and widgets.What is AFFiNE
canaryAFFiNE is an open-source, local-first, and privacy-focused workspace designed as an alternative to Notion and Miro. It functions as a hyper-fused platform that merges document editing (Docs) with an edgeless visual whiteboard (Canvas).
Key capabilities include:
- Merged Docs and Whiteboard: Place any building block (rich text, sticky notes, embedded web pages, databases, shapes, etc.) on an edgeless canvas.
- Multimodal AI: Integrated AI for generating outlines, slides, mind maps, and prototypes.
- Local-first & Collaborative: Users own their data locally while supporting real-time synchronization and collaboration across web and cross-platform clients.
- Extensible: Supports self-hosting and is built on the Blocksuite framework.
Overview of the docs-search module
canaryThe
docs-searchmodule manages the synchronization between the document engine and the search indexer. It performs two primary functions:- Subscribing to updates: It listens for changes occurring within the doc engine.
- Indexing content: It writes updated document content into the indexer to enable search and aggregation capabilities across the documentation.
Overview of BlockSuite
canaryBlockSuite is a content editing tech stack designed for the web. It serves as a toolkit for building editors and collaborative applications. The ecosystem is built around three core pillars:
- Headless Editor Framework: A vanilla framework that allows you to design and build diverse editing interfaces without being tied to a specific UI.
- Extensive Components: A set of highly interoperable components built on top of the framework to help construct complex editor user interfaces.
- CRDT-Native Collaboration: Built with Conflict-free Replicated Data Types (CRDT) at its core, supporting native document streaming and conflict resolution for collaborative environments.
What is the BlockSuite Framework?
canaryBlockSuite is a toolkit for building editors and collaborative applications. It functions as a UI component library built on a minimized vanilla framework runtime. Because all BlockSuite components (including editors) are native web components, they are framework-agnostic and can be easily integrated into React, Vue, or other popular frameworks.
Key Capabilities
- Reuse Editors: Use prebuilt editors like
PageEditor(block-based document editor) andEdgelessEditor(graphics/canvas editor). - Extend Editors: Customize and enhance editors using a rich set of BlockSuite components.
- Build from Scratch: Use the underlying vanilla framework to create entirely new editor types.
- Multimodal Content: Support different view modes (text, slides, mind maps, etc.) using a consistent framework.
- Collaboration-Ready: Built-in support for real-time collaboration and decentralized data synchronization using CRDT technology.
- Reuse Editors: Use prebuilt editors like
Use the auto-generated GraphQL client
canaryThepackages/common/graphqlpackage provides an auto-generated GraphQL client specifically designed for interacting with theaffine.probackend. This client is intended to be used by developers building integrations or services that require type-safe communication with the AFFiNE GraphQL API.Use AFFiNE Command Abstractions for CMD-K
canaryThe@affine/corepackage provides command abstractions designed for the AFFiNE framework. These abstractions are specifically intended to power the 'CMD-K' (command palette) functionality. The design pattern is heavily inspired by the VSCode Command Abstractions, allowing for a structured way to register, execute, and manage commands within the application.