DrawyParty: Low-Latency Collaborative Whiteboard with Cloudflare PartyKit
Ultra-low-latency, edge-powered collaborative whiteboards powered by Excalidraw and Cloudflare PartyKit.
🚀 Live Demo: https://drawyparty.pratyay.online/ | 📦 GitHub: Pratyay360/drawy-party
What is DrawyParty?
Section titled “What is DrawyParty?”DrawyParty is a performance-focused, edge-first variant of Drawy designed for teams that require sub-millisecond real-time synchronization across geographic regions.
Instead of routing real-time WebSockets through centralized database servers, DrawyParty utilizes PartyKit running directly on Cloudflare Workers. Each collaborative whiteboard room runs as an isolated, stateful edge micro-server located closest to the connected users, providing instant cursor presence and effortless concurrent drawing.
Key Technical Highlights
Section titled “Key Technical Highlights”- ⚡ Edge-Native WebSockets: Powered by Cloudflare Workers and PartyKit for lightning-fast broadcast of cursor positions and whiteboard strokes.
- 🐘 Pooled PostgreSQL Persistence: Whiteboard snapshots and document versions persist reliably in PostgreSQL (compatible with Supabase, Neon, Tembo, or any connection-pooled Postgres).
- 🧩 Optimistic CRDT Updates: Conflict-free concurrent drawing prevents conflicting element overrides when multiple teammates sketch simultaneously.
- 🌐 Deploy Anywhere: Packaged with Nitro and TanStack Start for universal hosting across Vercel, Netlify, or Cloudflare Pages.
Architecture: How PartyKit Powers DrawyParty
Section titled “Architecture: How PartyKit Powers DrawyParty”Traditional real-time web whiteboards face latency challenges when collaborators are distributed across different continents:
[User A (Europe)] ──> [Cloudflare Edge PartyKit Room (Frankfurt)] <── [User B (Europe)] │ ▼ (Async Snapshot Sync) [PostgreSQL Database]- Stateful Rooms: When a user creates or joins a whiteboard, PartyKit automatically provisions a stateful WebSocket room on Cloudflare’s nearest edge node.
- Instant Broadcast: Drawing events and cursor coordinates broadcast immediately between peer connections without database write bottlenecks.
- Durable Persistence: Board states are asynchronously saved to pooled PostgreSQL for permanent document storage and retrieval.
Quickstart & Deployment
Section titled “Quickstart & Deployment”1. One-Click Cloud Deployment
Section titled “1. One-Click Cloud Deployment”Deploy DrawyParty directly to Vercel:
2. Local Development
Section titled “2. Local Development”Clone the repository and set up your local development environment:
git clone https://github.com/Pratyay360/drawy-party.gitcd drawy-party
# Install dependencies using mise or npmnpm install3. Environment Variables
Section titled “3. Environment Variables”Create your .env file from .env.example:
cp .env.example .envConfigure your PartyKit room host and PostgreSQL connection string:
DATABASE_URL="postgres://user:password@host:5432/drawyparty?sslmode=require"VITE_PARTYKIT_HOST="127.0.0.1:1999"Start the local server and PartyKit development daemon:
npm run devCompare Drawy Editions
Section titled “Compare Drawy Editions”| Edition | Realtime Engine | Data Storage | Ideal Deployment |
|---|---|---|---|
| Drawy | Supabase Realtime | Supabase PostgreSQL | Full-stack teams on Vercel + Supabase |
| DrawyParty | Cloudflare PartyKit | Pooled PostgreSQL | Low-latency global edge collaboration |
| DrawX | Local Native Runtime | Local Filesystem | Air-gapped, 100% private offline sketching |