Introduction
A collaborative drawing workspace, documented folder by folder.
This project is a TypeScript drawing application with guest storage on the device, authenticated scenes, real-time rooms, a hand-drawn renderer, and Redis write-behind persistence.
These notes describe what each folder owns and how the folders talk to each other. They never explain code — for behaviour, read the linked sources in the repo itself. Where the repo was unclear, the page says so.
Start with Installation, then the Monorepo layout, then the High-level architecture.
Tech stack at a glance
The codebase is TypeScript throughout, running on Node 24 or newer with pnpm workspaces. The drawing engine is custom code on the canvas API — no drawing library appears in any workspace manifest.
Language and tooling
Frontend
Realtime and backend
Data
Quality
| Workspace | Role | Language and runtime | Key libraries |
|---|---|---|---|
| Web | Next.js editor, account dashboard, and room access interface. | TypeScript, CSS · Node >=24 | Next.jsReactReact DOMTailwind CSS |
| HTTP server | Authenticated HTTP API for scenes, rooms, invites, files, and private library items. | TypeScript · Node >=24 | tsxExpressCORSZod |
| WebSocket server | Authenticated room WebSocket transport for presence, scene changes, selections, and laser trails. | TypeScript · Node >=24 | TypeScripttsxws |
| Flush worker | BullMQ worker that flushes Redis room state to durable Prisma snapshots. | TypeScript · Node >=24 | TypeScripttsx |
| Common | Platform-neutral element models, collaboration protocols, validation, and reconciliation. | TypeScript · Node >=24 | Vitest |
| Engine | Browser-independent drawing geometry, tools, renderer, scene capture, and history. | TypeScript · Node >=24 | Vitest |
| Backend common | Server-only collaboration and access operations shared by HTTP, WebSocket, and worker apps. | TypeScript · Node >=24 | Vitest |
| Database | The sole Prisma schema, database client, repositories, migration graph, and schema snapshots. | TypeScript, Prisma schema · Node >=24 | TypeScripttsxnode-postgresPrisma ORMPrisma CLI |
| Auth | Better Auth configuration, browser auth client, email delivery, and authentication helpers. | TypeScript · Node >=24 | TypeScriptBetter Authbcryptjsonwebtokendotenv |
| Redis | Redis live room state, pub/sub, rate limiting, and write-behind queue integration. | TypeScript · Node >=24 | TypeScripttsxBullMQioredis |
| Validations | Reusable request validation schemas. | TypeScript · Node >=24 | Zod |
| UI | Shared UI primitives. | TypeScript · Node >=24 | TypeScriptReact |
| Tooling configs | Collection of internal eslint configurations. | · Node >=24 | ESLintESLint JS configReact Hooks pluginGlobals |
| Tooling configs | Shared TypeScript configurations. | · Node >=24 | — |
Next.js editor, account dashboard, and room access interface.
TypeScript, CSS · Node >=24
Authenticated HTTP API for scenes, rooms, invites, files, and private library items.
TypeScript · Node >=24
Authenticated room WebSocket transport for presence, scene changes, selections, and laser trails.
TypeScript · Node >=24
BullMQ worker that flushes Redis room state to durable Prisma snapshots.
TypeScript · Node >=24
Platform-neutral element models, collaboration protocols, validation, and reconciliation.
TypeScript · Node >=24
Browser-independent drawing geometry, tools, renderer, scene capture, and history.
TypeScript · Node >=24
Server-only collaboration and access operations shared by HTTP, WebSocket, and worker apps.
TypeScript · Node >=24
The sole Prisma schema, database client, repositories, migration graph, and schema snapshots.
TypeScript, Prisma schema · Node >=24
Better Auth configuration, browser auth client, email delivery, and authentication helpers.
TypeScript · Node >=24
Redis live room state, pub/sub, rate limiting, and write-behind queue integration.
TypeScript · Node >=24
Reusable request validation schemas.
TypeScript · Node >=24
Shared UI primitives.
TypeScript · Node >=24
Collection of internal eslint configurations.
· Node >=24
Shared TypeScript configurations.
· Node >=24
The full list lives on the Tech stack page.
Sources: README.md (documented at commit b0026d9)