Drafft.ink is a Rust-powered infinite canvas whiteboard designed for real-time collaboration without the usual complexity of centralized servers or heavy configurations. Its architecture combines state-of-the-art WebGPU rendering with conflict-free replicated data types (CRDTs) to deliver a smooth, synchronous drawing experience across clients connected over WebSockets.
What drafft.ink is and how it works
At its core, drafft.ink provides an infinite canvas whiteboard that supports collaborative sketching and text editing. The project is split into five main Rust crates, each with a clear responsibility:
- core: Manages application state and implements the Loro CRDT for conflict-free replication.
- render: Handles GPU-accelerated rendering and text layout using Vello (a WebGPU-based 2D renderer) and Parley.
- app: Builds the user interface using egui, an immediate-mode GUI framework, and manages event handling.
- server: Implements a minimal WebSocket server to synchronize state across clients.
- widgets: Contains UI widgets with a sketchy, hand-drawn aesthetic powered by roughr.
The rendering pipeline leverages the WebGPU API through Vello, allowing for GPU-accelerated 2D vector graphics and smooth text rendering. This choice aligns with modern browser and native GPU capabilities and avoids the limitations of traditional canvas or SVG rendering.
For collaboration, drafft.ink uses the Loro CRDT, a Rust library that maintains replicated state without central coordination or complex conflict resolution protocols like operational transformation. This means every client can update the shared canvas concurrently, and the system merges changes consistently without conflicts.
The server is intentionally minimalistic — a single binary with no configuration files, listening on a WebSocket endpoint by default. This design emphasizes ease of deployment and self-hosting without vendor lock-in or telemetry.
The UI uses egui, which is an immediate-mode Rust GUI framework. While immediate-mode UI can be less flexible for very complex interactions compared to retained-mode patterns, it offers simplicity and good performance here. Text layout uses Parley, and the sketchy visual style is created with roughr, giving the app a distinctive hand-drawn feel.
The entire project is AGPLv3-licensed, explicitly self-hostable, and anti-telemetry, which will appeal to privacy-conscious users.
Why drafft.ink’s architecture matters
The choice of Loro CRDT for real-time collaboration is the key technical differentiator here. Most collaborative whiteboards rely on operational transformation (OT) algorithms, which require complex server logic to order operations and resolve conflicts. CRDTs, on the other hand, allow each client to independently update state and merge changes deterministically. This shifts the complexity away from the server and reduces bottlenecks.
Using a CRDT like Loro means drafft.ink can support a truly decentralized collaboration model where the server acts mostly as a relay for updates rather than an authoritative state holder. This architecture improves scalability and fault tolerance.
The tradeoff is that CRDTs can be harder to design correctly and may increase the size of the data exchanged due to metadata needed for conflict resolution. However, Loro appears well-integrated and cleanly abstracted in the core crate.
The rendering approach with Vello and WebGPU is also notable. WebGPU is a modern, low-level graphics API that offers better performance and access to GPU features than WebGL or 2D canvas. Vello builds on this to provide vector graphics and text layout optimized for GPU acceleration. This results in smoother, more scalable rendering especially important for infinite canvas zoom and panning.
The immediate-mode UI with egui is a pragmatic choice balancing simplicity and performance, though it may limit advanced UI customizations compared to frameworks that store UI state explicitly.
The server’s single-binary zero-config approach simplifies deployment and lowers the barrier for self-hosting. It’s opinionated but practical for users who want a no-fuss setup.
Quick start with drafft.ink
The README provides clear commands to get started both for desktop and web builds, plus running the collaboration server:
git clone https://github.com/PatWie/drafft-ink.git
cd drafft-ink
cargo run --release
Or build natively with the provided script:
./build.sh --native
For web (local) builds:
./build.sh --wasm
Running the collaboration server is as simple as:
cargo build --release -p drafftink-server
./target/release/drafftink-server
The server listens on ws://localhost:3030/ws by default and requires no configuration.
Verdict
drafft.ink is a solid example of a Rust-based, web-native real-time collaborative whiteboard that embraces CRDTs to simplify synchronization logic. Its architecture is clean, with well-separated crates for state, rendering, UI, server, and widgets.
The project is best suited for developers or teams wanting a minimal, self-hosted whiteboard with real-time sync and a distinctive sketchy aesthetic. Its anti-telemetry stance and AGPLv3 license make it appealing for privacy-conscious users.
Limitations include the inherent complexity of CRDTs and the potential UI constraints from egui’s immediate-mode approach. The server is minimal by design, so it lacks advanced features like authentication or persistent storage out of the box.
Overall, drafft.ink is worth exploring if you want a lightweight, Rust-native collaborative drawing tool that you can run yourself without fuss. It’s not a drop-in replacement for fully-featured commercial whiteboards but a neat platform for experimentation and self-hosted collaboration.
Related Articles
- Pydoll: Async-native Chromium automation with typed extraction for web scraping — Pydoll is a Python library for Chromium automation using Chrome DevTools Protocol. It offers async-native APIs and Pydan
- Deep dive into DataDog’s PHP tracer: architecture, strengths, and setup — DataDog’s dd-trace-php brings APM and distributed tracing to PHP apps with Rust-powered precision. We explore its archit
→ GitHub Repo: PatWie/drafft-ink ⭐ 474 · Rust