A professional-grade collaborative design tool inspired by Figma, built with Rust/WebAssembly for maximum performance.
Anatsui is a modern collaborative design tool that pushes the boundaries of what's possible in a web browser. Unlike traditional web-based design tools, Anatsui uses:
- Rust + WebAssembly for the rendering engine (instead of C++)
- WebGL2 for GPU-accelerated 2D graphics
- Vector Networks (Figma's innovation) instead of traditional paths
- CRDT-inspired sync for seamless real-time collaboration
- Bun for lightning-fast development and runtime
Named after El Anatsui, the renowned Ghanaian sculptor known for transforming simple materials into extraordinary art.
- High-Performance Rendering: Rust/WASM core with WebGL2 for smooth 60fps
- Real-time Collaboration: Multiple users can edit simultaneously
- Vector Networks: Advanced path editing with any-to-any connections
- Modern UI: React + TypeScript with Tailwind CSS
- Infinite Canvas: Smooth panning and zooming
- Design Tools: Rectangle, ellipse, line, frame, text, and pen tools
- Layer System: Full layer management with visibility and locking
- Properties Panel: Edit position, size, fill, stroke, and more
anatsui/
βββ packages/
β βββ core/ # Rust/WASM rendering engine
β βββ src/
β β βββ document/ # Document model with fractional indexing
β β βββ geometry/ # Vector networks implementation
β β βββ renderer/ # WebGL2 renderer with shaders
β β βββ multiplayer/# Sync engine and messaging
β β βββ tools.rs # Design tools (select, draw, etc.)
β βββ Cargo.toml
βββ apps/
β βββ web/ # React frontend
β β βββ src/
β β β βββ components/# UI components
β β β βββ store/ # Zustand state management
β β β βββ types/ # TypeScript types
β β βββ package.json
β βββ server/ # Bun WebSocket server
β βββ src/
β βββ index.ts # Multiplayer server
βββ docs/
β βββ ARCHITECTURE.md # Technical architecture
β βββ TECHNICAL_INSIGHTS.md # Figma research
βββ package.json # Monorepo root
- Bun v1.0+ (for package management and server)
- Rust v1.70+ (for WASM core)
- wasm-pack (for building WASM)
# Clone the repository
git clone https://github.com/your-username/anatsui.git
cd anatsui
# Install dependencies
bun install# Navigate to the core package
cd packages/core
# Build for web (release mode)
wasm-pack build --target web --release
# Or for development (faster builds)
wasm-pack build --target web --dev# Start the web app (from project root)
cd apps/web
bun dev
# In a separate terminal, start the multiplayer server
cd apps/server
bun devOpen http://localhost:3000 in your browser.
The document is stored as a property-level map: Map<ObjectID, Map<Property, Value>>. This enables:
- Fine-grained conflict resolution
- Efficient syncing (only changed properties)
- Property-level undo/redo
Unlike traditional SVG paths (sequences of points), vector networks are graphs where any point can connect to any other. This allows:
- Complex shapes from simple primitives
- Non-destructive boolean operations
- Intuitive direct manipulation
- Document changes trigger re-renders
- Nodes are sorted by z-index (fractional indexing)
- Geometry is tessellated using Lyon
- WebGL draws with custom shaders
- Property-level last-writer-wins (LWW)
- Fractional indexing for ordering
- WebSocket for real-time updates
- Optimistic updates with acknowledgements
| Key | Tool |
|---|---|
| V | Select |
| F | Frame |
| R | Rectangle |
| O | Ellipse |
| L | Line |
| P | Pen |
| T | Text |
| H | Hand (pan) |
| β/Ctrl + = | Zoom in |
| β/Ctrl + - | Zoom out |
| β/Ctrl + 0 | Reset zoom |
| Package | Description |
|---|---|
@anatsui/core |
Rust/WASM rendering engine |
@anatsui/web |
React frontend application |
@anatsui/server |
Bun WebSocket server |
# Root level
bun dev # Start web dev server
bun build # Build all packages
bun test # Run tests
# WASM Core (packages/core)
wasm-pack build # Build WASM
cargo test # Run Rust tests
cargo clippy # Lint Rust code
cargo doc # Generate docs
# Web App (apps/web)
bun dev # Start dev server
bun build # Production build
bun preview # Preview production build
# Server (apps/server)
bun dev # Start with hot reload
bun start # Production start- Rendering: Rust, wasm-bindgen, WebGL2
- Math: glam (linear algebra)
- Tessellation: Lyon (path tessellation)
- Text: fontdue (font rendering)
- Serialization: serde + serde_json
- Frontend: React 18, TypeScript, Tailwind CSS
- State: Zustand
- Build: Vite, wasm-pack
- Runtime: Bun
# Rust unit tests
cd packages/core
cargo test
# TypeScript tests (when implemented)
bun test# Build WASM core (optimized)
cd packages/core
wasm-pack build --target web --release
# Build frontend
cd apps/web
bun build
# Build server
cd apps/server
bun buildContributions are welcome! Please read our contributing guidelines before submitting a PR.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Figma for pioneering browser-based design tools
- Evan Wallace for the technical blog posts
- El Anatsui for inspiring the project name
- The Rust/WASM community for excellent tooling
Built with β€οΈ and Rust