apps/
WebSocket server
Authenticated room WebSocket transport for presence, scene changes, selections, and laser trails.
The server speaks two protocols over one socket family: presence frames and collaboration frames, each validated and rate-limited. Commits are applied through the shared collaboration service and acknowledged per mutation; previews and selections are fanned out to the room and never stored. One connection entry represents one tab, never one user.
What it owns
- Ticket-checked room upgrades with owner, editor, and viewer roles
- Presence: pointers, viewports, joins, and leaves
- Collaboration: sync snapshots, commits, previews, selections, and laser
- In-memory room connections plus Redis-backed room state
Files
File list and purposes from the folder README.
| File | Purpose |
|---|---|
src/index.ts | Service entry. |
src/server.ts | Room WebSocket transport. |
src/roomStore.ts | In-memory room connections (presence + collaboration). |
Dependencies
| Library | Version range | Why it is used here |
|---|---|---|
| ws | ^8.21.3 | WebSocket server and test client for room transport. |
Development and tooling (3)
| Library | Version range | Why it is used here |
|---|---|---|
| @types/node | 26.4.1 | Type declarations for Node.js built-ins. |
| @types/ws | ^8.18.1 | Type declarations for ws. |
| tsx | ^4.23.13 | Runs and watches TypeScript sources for development and tests. |
Dependencies as of commit b0026d9.
Internal packages used
Laying out ws-server folder…
BrowserAPIRealtimeCacheDatabaseShareddurableephemeral
Talks to
Sources: apps/ws-server/README.md, apps/ws-server/src/README.md, apps/ws-server/src/server.ts, apps/ws-server/src/roomStore.ts (documented at commit b0026d9)