Collaborate. is a production-focused anonymous real-time whiteboard built to demonstrate that the project owner can design, ship, and operate a small collaborative system with engineering discipline.
- Share a room link with no auth flow
- Draw with mouse, touch, or stylus
- Use pen, eraser, color, and stroke width controls
- Undo and redo your own strokes
- Clear only your own content
- Export the current board to PNG
- Rejoin the same room after refresh or transient disconnect
- Expire empty rooms automatically after a bounded TTL
apps/web- React + Vite frontendapps/api- Express + Socket.IO backendpackages/contracts- shared event names, schemas, and typesdocs- product, roadmap, and deployment notesv1- archived demo reference
RoomPageowns room entry and board presentationuseRoomSessionowns socket lifecycle, sync, and reconnect behavioruseBoardCanvasowns pointer input, local drawing, and exportAppErrorBoundarycontains runtime crashes behind a controlled fallback
RoomServiceowns room lifecycle and board mutation rulesRoomRepositoryabstracts storageregisterSocketHandlersvalidates and gates every socket eventcreateHttpAppexposes health, readiness, and metrics
All socket event names and payload schemas are defined once in packages/contracts and imported by both apps.
- First valid join creates a room.
- The API keeps canonical board state for the room.
- Refreshing the same room auto-rejoins with the last successful local identity.
- When the last participant leaves, the room enters expiring state.
- Empty rooms are deleted after
ROOM_EMPTY_TTL_MS.
The default repository mode is file-backed ephemeral storage.
ROOM_REPOSITORY=filepersists room state toROOM_STORAGE_PATHROOM_REPOSITORY=memoryis intended for tests and disposable local runs
This gives the project restart-safe rooms on a single API instance without reintroducing the original in-process-only limitation.
npm installcp apps/api/.env.example apps/api/.env
cp apps/web/.env.example apps/web/.envnpm run dev:apinpm run dev:webDefault URLs:
- Web:
http://localhost:5173 - API:
http://localhost:5000 - Health:
http://localhost:5000/health - Readiness:
http://localhost:5000/ready - Metrics:
http://localhost:5000/metrics
npm run lint
npm run typecheck
npm run test
npm run build
npm run e2eIf Playwright browsers are not installed locally:
npx playwright install chromiumIf you want to reuse a system Chrome instead:
PLAYWRIGHT_EXECUTABLE_PATH=/usr/bin/google-chrome npm run e2e- Zod validation on every socket payload
- Payload size limits
- Per-socket rate limiting
- Structured JSON logs
- Prometheus-style metrics
- Frontend error boundary
- Unhandled rejection and exception shutdown logging
- Bounded room history and bounded stroke sizes
- PRD: docs/PRD.md
- Implementation roadmap: docs/IMPLEMENTATION_ROADMAP.md
- Deployment notes: docs/DEPLOYMENT.md