A real-time collaborative whiteboard, Figma-lite style: multiple people draw and move shapes on a shared canvas, see each other's cursors live, and edits sync in about a second — no lost work on refresh.
Built with Next.js, Supabase (Postgres + Realtime + Auth + Storage), and Konva.js.
- Auth — email magic-link sign-in, no passwords
- Boards — create, rename, duplicate, delete; each board is invite-only
- Roles — owner / editor / viewer per board, invite collaborators by email; viewers get a read-only canvas
- Canvas — rectangles, ellipses, freehand pen, text boxes, and image uploads: create, move, resize, recolor, layer (bring to front/back), delete
- Multi-select — shift-click or marquee-select to move/recolor/delete several shapes at once
- Pan & zoom — scroll to pan, Ctrl/Cmd+scroll to zoom, centered on the pointer
- Snap-to-grid, undo/redo, and PNG export of the current view
- Live sync — shape changes broadcast to everyone on the same board over a per-board Supabase Realtime channel, with a live connection-status indicator
- Live cursors + presence — see collaborators' cursor position, name, and color, plus an avatar stack of who's currently on the board
- Persistence — the board is saved to Postgres and restored on refresh
- Toast notifications, loading skeletons, and board thumbnails round out the everyday experience
![]() |
![]() |
| Framework | Next.js (App Router) + TypeScript |
| Backend | Supabase — Postgres, Realtime (broadcast + presence), Auth, Storage |
| Canvas | Konva.js via react-konva |
| Styling | Tailwind CSS |
| Deploy target | Vercel |
-
Install dependencies
npm install
-
Create a Supabase project at supabase.com/dashboard.
-
Configure environment variables
cp .env.local.example .env.local
From Project Settings → API in the Supabase dashboard, fill in:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY(the current dashboard issues asb_publishable_...key, not the legacy anon JWT)SUPABASE_SERVICE_ROLE_KEY— the secretservice_rolekey. Used server-side only, to invite collaborators by email and resolve member emails for the members panel. Never expose this to the browser.
-
Enable the magic-link redirect. In the dashboard, under Authentication → URL Configuration, add
http://localhost:3000/auth/callbackto the redirect URL allowlist (and your deployed URL's equivalent once you have one). Email OTP / magic link is on by default, though its shared sender has a low rate limit — see Custom SMTP below before inviting real users. -
Run the database migrations. Open the Supabase SQL Editor and run each file in
supabase/migrations/in order — they create the schema, storage bucket, and row-level security policies that later migrations depend on. -
Start the dev server
npm run dev
Open http://localhost:3000, sign in with your email, and you'll land on
/boardsonce the magic link is confirmed.
Supabase's built-in email sender is rate-limited to a handful of emails per hour — fine for your own testing, not enough for real signups or invites. Before other people need to receive magic links or invite emails, set up a provider under Project Settings → Authentication → SMTP Settings. Any provider that supports single sender verification (no domain required) works — Brevo's free tier is a good starting point.
- Each board is one Supabase Realtime channel (
board-<id>), carrying shape broadcasts, cursor position, and presence together. - Shape mutations are optimistic: applied to local state immediately, then upserted to Postgres and broadcast to the channel in the same step. Other clients merge incoming changes into their local state by shape id.
- Cursor position is sent in world coordinates (i.e. board space, not screen pixels), so it stays correct regardless of each viewer's own pan, zoom, or window size — only the receiver's own view transform is applied when rendering someone else's cursor.
- Access is membership-gated: a
board_memberstable with anowner/editor/viewerrole per user, enforced by Postgres row-level security (not just the UI) viaSECURITY DEFINERhelper functions that avoid RLS self-recursion. The board's link alone is not enough — invite collaborators from the board's People panel. - Shape rendering (Konva) is kept decoupled from the sync layer, so the conflict-resolution strategy (currently last-write-wins) can be swapped out later without touching the canvas code.
- No CRDT/OT — concurrent edits to the same shape are last-write-wins. Fine for a small group on one board; would need real conflict resolution to scale to heavier concurrent editing.
- No offline support.
- Custom SMTP is required before inviting collaborators who don't already have an account — otherwise Supabase's shared sender rate-limits fast.
Target platform is Vercel. Set the same environment variables from
.env.local.example (including SUPABASE_SERVICE_ROLE_KEY) in the Vercel
project settings, and update NEXT_PUBLIC_SITE_URL plus the Supabase
redirect URL allowlist to match the deployed domain.
Push order matters: this app's database migrations aren't applied automatically, so run any new migration in Supabase before pushing code that depends on it — pushing first would break the live site for everyone until the schema catches up.
npm run screenshots drives a headless browser through sign-up, board
creation, drawing, and the members panel, saving to docs/screenshots/. It
needs SUPABASE_SERVICE_ROLE_KEY in .env.local and the dev server running.
It creates throwaway screenshot-bot+<timestamp>@example.com accounts —
clean them up afterward with npm run cleanup-test-users.
See CLAUDE.md for the full project spec, data model, and build history.


