# How to Vibe Code Your Own Excalidraw (and Stop Paying for It)

> Virtual, infinite-canvas collaborative whiteboard and diagramming tool

- Site: https://plus.excalidraw.com
- Category: Productivity / Collaboration
- Verdict: **Serious undertaking** (45/100 vibecodeable)
- Estimated effort: 4-6 weeks of intense building and debugging

## Verdict

You can build a single-user local canvas clone over a few weekends, but building a production-grade multi-user collaborative whiteboard with a custom hand-drawn rendering engine is a serious undertaking.

While the core open-source editor code is publicly available, vibecoding a personal-use clone of Excalidraw+ requires tackling complex real-time synchronization states, multi-user WebSocket rooms, and infinite canvas rendering performance. An AI coding agent will effortlessly scaffold the Next.js frontend and database schema, but debugging CRDT conflict resolution, fractional indexing for element stacking, and custom vector rendering math will demand rigorous iterative engineering.

### What you can't replicate

- The massive organic community and pre-built public component libraries
- The exact battle-tested real-time WebSocket infrastructure handling millions of concurrent collaborative strokes
- The robust enterprise compliance, SOC2 certification, and third-party plugin ecosystem

## What it does

Excalidraw is a virtual, infinite-canvas collaborative whiteboard and diagramming tool optimized for creating hand-drawn-style sketches, flowcharts, system architectures, wireframes, and presentations. Its Plus tier adds team workspace management, cloud synchronization, real-time collaboration, presentations, and generative AI features.

### Core features

- Infinite canvas with pan, zoom, and spatial indexing
- Hand-drawn vector rendering engine using Rough.js style algorithms
- Real-time multi-user collaboration via WebSockets and CRDTs/fractional indexing
- Scene serialization and export to PNG, SVG, and JSON
- Shape binding, arrows, text editing, and freehand drawing
- Slide presentation mode and frame management
- Generative AI integrations (Text-to-diagram, Mermaid syntax support)

## The business

### Pricing

- Free: $0
- Plus: $6/mo per user

Founded 2020.
Team size: ~6 core members.

## The hard parts

- Replicating the chaotic, imperfect hand-drawn vector aesthetic without performance degradation on thousands of elements
- Implementing conflict-free real-time multi-user canvas synchronization and element ordering
- High-performance viewport culling and spatial indexing to keep infinite canvas panning at 60 FPS
- Accurate SVG and high-resolution PNG export of vector shapes without font scaling or clipping bugs

## How to vibe code Excalidraw

### Prerequisites

- Node.js (free): Required runtime for running Next.js and frontend build tools
- GitHub (free): Repository hosting and CI/CD integration for deployment

### Recommended AI tools

- Claude Code: Best-in-class multi-file agentic coding tool for scaffolding complex canvas state machines and WebSocket servers
- Cursor: Ideal for fine-tuning UI components, React hooks, and canvas rendering math interactively

### Stack

- Frontend: Next.js with React, Tailwind CSS, HTML5 Canvas / SVG, Rough.js
- Backend: Node.js with WebSockets (ws library)
- Database: Turso (SQLite at the edge for scene metadata and user storage)
- Auth: better-auth
- Payments: Stripe
- Other: Liveblocks for real-time presence and collaborative state synchronization, Zod for schema validation

### Hosting

- Vercel (Hosting the Next.js frontend application and serverless API routes): $0/mo (Hobby Tier)
- Fly.io (Running the dedicated WebSocket real-time collaboration server): ~$3-5/mo

### Build guide

1. **Project Scaffolding & Database Schema** — Initialize the Next.js application with Tailwind CSS, configure Turso SQLite connection via Drizzle ORM, and set up better-auth for user authentication.

```
Create a new Next.js 16 project with TypeScript and Tailwind CSS v4. Set up Drizzle ORM configured for Turso SQLite. Create database schemas for users, workspaces, scenes (storing element JSON arrays), and collections. Implement better-auth with email/password authentication and session management. Ensure clean project directory structure with api routes and component folders.
```

2. **Infinite Canvas Viewport & Tooling** — Build the core interactive infinite canvas component supporting pan, zoom, and drawing tool selection (rectangle, diamond, ellipse, arrow, line, freedraw, text).

```
Build an infinite canvas React component using HTML5 Canvas or SVG layers. Implement mouse and touch event handlers for panning (space+drag or middle click) and zooming (wheel scaling clamped between 0.1x and 20x). Create a toolbar UI state machine supporting select, rectangle, diamond, ellipse, arrow, line, text, and freedraw tools. Store canvas elements in React state with unique IDs, coordinates, bounding boxes, and styling attributes.
```

3. **Hand-Drawn Vector Rendering Engine** — Integrate Rough.js or custom jitter algorithms to render shapes with the signature imperfect, sketchy hand-drawn aesthetic.

```
Integrate Rough.js into the canvas rendering loop to draw all geometric shapes, lines, and arrows with a hand-drawn sketchy aesthetic. Add support for customizable stroke color, background fill style (hachure, cross-hatch, solid), stroke width, and roughness parameters. Ensure smooth rendering performance during viewport movement and element selection transforms.
```

4. **Real-Time Collaboration & CRDT Synchronization** — Set up a WebSocket server and integrate Liveblocks or custom Yjs CRDT bindings to broadcast cursor positions and element modifications across users.

```
Implement real-time collaboration using Liveblocks or a standalone Node.js WebSocket server deployed on Fly.io. Broadcast active user cursors, viewport bounding boxes, and incremental element mutations (creation, updates, deletions) across connected clients. Handle conflict resolution using fractional indexing for element ordering layers to prevent race conditions during simultaneous editing.
```

5. **Scene Management, Export & Presentations** — Build dashboard scene organization, JSON/PNG/SVG export handlers, and slide presentation mode with frame grouping.

```
Implement scene management features including dashboard workspace folders, autosaving scene data to Turso, and full JSON file import/export. Create export utilities to convert canvas elements into high-resolution PNG and clean SVG strings. Add a slide presentation mode that cycles through user-defined 'frame' elements in sequential order with smooth pan-and-zoom camera transitions.
```

### Cost vs paying

**Starting costs (one-time):**

- AI Coding Assistant (Claude Pro / Cursor): $20
- Total: $20 one-time

**Ongoing costs (monthly):**

- Fly.io WebSocket Server: ~$3-5/mo
- Turso DB & Vercel: $0/mo
- Total: ~$3-5/mo

- Paying for the SaaS instead: $6/mo per user
- Build time: 40-60 hours
- AI tool credits: $20 (one month of Claude Pro / Cursor)
- Break-even: 1 month of Plus subscription

## Sources

- [Excalidraw Official Website & Plus Pricing](https://plus.excalidraw.com)
- [Excalidraw Public Changelog & Release Notes](https://plus.excalidraw.com)