A real-time collaborative pixel art canvas — draw together with your friends!
- Frontend: React + TypeScript + Tailwind + HTML5 Canvas.
- 1920×1080 pixel grid (~2 million pixels) rendered with
putImageData+ per-pixelfillRectupdates. useGameConnectionhook manages PartySocket connection with auto-reconnect.- Optimistic local rendering — your strokes appear instantly, then broadcast to others.
- 1920×1080 pixel grid (~2 million pixels) rendered with
- Backend: PartyKit (Cloudflare Durable Objects).
- Canvas state stored in a
Uint8Array(~2MB) in durable storage (chunked to stay under per-key limits). - Sends full binary canvas on connect, JSON delta updates for individual pixels.
- Auto-saves every 30 seconds.
- Canvas state stored in a
npm installnpm run dev:partynpm run devOpen http://localhost:3000. Open a second tab to test real-time sync.
# Login to PartyKit (uses Cloudflare under the hood)
npx partykit login
# Deploy the server
npm run deploy:partyThis gives you a URL like pixelplacer.<your-username>.partykit.dev (the PartyKit project name is still pixelplacer).
- Push this repo to GitHub.
- Import it in Vercel.
- Set the environment variable:
VITE_PARTYKIT_HOST=pixelplacer.<your-username>.partykit.dev
- Vercel auto-builds with
npm run buildand deploys the static site. - Share the Vercel URL with your friends!
Update the env var or edit constants.ts → PARTYKIT_HOST to point to your deployed PartyKit server, then:
npm run buildServe the dist/ folder with any static file host (Nginx, Netlify, Cloudflare Pages, etc.).