/ concept-collection / commonroom
Sign in
concept-collection / commonroom
commonroom / CLAUDE.md
5.4 KBPreviewCodeBlameHistoryRaw

CLAUDE.md#

Tips for future agents working in this repo. It combines the p2p techniques of the sibling projects commonview (auto-connecting mesh) and commoncall (WebRTC media, settings, screen share) — read those first; this file only covers what is different here.

Architecture#

src/p2p/
  identity.ts  schnorr keypair; pubkey hex = peer ID     — ported from commoncall
  nostr.ts     minimal relay client + topic scheme        — ported (roomTopic takes a room ID)
  peer.ts      WebRTC wrapper: media + control channel    — ported (replaceTrack generalized to audio|video)
  settings.ts  shared ROOM settings, quality presets      — default quality is 'medium', not 'auto'
  network.ts   the heart: rooms, presence, mesh, media, settings sync
src/App.tsx    landing form (light) + in-room view (dark), video grid with
               click-to-spotlight (gallery ↔ one big tile + filmstrip; Esc or
               click again to return), control bar, chat panel (side panel on
               wide screens, overlay ≤700px, unread badge)

Key design decisions#

Testing#

npm run dev, then open the room in two browsers (identity is per-browser-profile via localStorage, so two tabs in one profile are the SAME peer — use a private window or second browser). npm run build type-checks (tsc -b) and bundles. Let the user test multi-party media in real browsers; don't try to automate camera/mic flows.

moveopenescclose