/ concept-collection / commoncall
concept-collection / commoncall
commoncall / README.md
45 lines · 2.0 KBCodeBlameHistory
3Serverless peer-to-peer video calls in the browser.
5**Live page:** https://concept-collection.github.io/commoncall/
7Visit the page, enter an ID, and you'll see the IDs of everyone else currently
8on the page. Click a visitor to request a call; once they accept — both users
9must agree — a direct WebRTC connection is established and audio/video flows
558b70bAdd screen sharing via in-place video track swap (no renegotiation)Jeremy Magland 10peer-to-peer. During a call you can share your screen in place of your camera.
12## How it works
14There is no backend. The techniques are the same as the sibling project
15[commonview](https://github.com/concept-collection/commonview):
17- **Identity** — each browser generates a secp256k1 (BIP340 schnorr) keypair,
18 persisted in localStorage. The x-only public key is the peer ID, and every
19 message is signed with it, so peers can't be impersonated.
20- **Presence & signaling over nostr** — a minimal nostr client (modeled on
21 trystero's nostr strategy) publishes ephemeral events to a handful of public
22 relays. Everyone announces `{peerId, name, busy}` on a shared root topic
23 every few seconds; entries expire when announcements stop. Call requests,
24 accept/decline, and WebRTC offer/answer/ICE messages are delivered on a
25 per-peer topic derived from the recipient's ID.
26- **Mutual consent** — clicking "Call" only publishes a `call-request`. Neither
27 side touches the camera or opens a WebRTC connection until the callee
28 explicitly accepts.
29- **WebRTC media** — after acceptance, the peer with the smaller ID creates the
30 offer (deterministic initiator, no glare handling needed). Audio and video
31 tracks flow directly between the browsers, with public STUN servers and a
32 free TURN relay as fallback for hard NATs.
34## Development
36```sh
37npm install
38npm run dev
39```
41Open the page in two browsers (or one normal + one private window — identity is
42per-browser-profile) and call yourself.
44`npm run build` type-checks and bundles to `dist/`. Pushes to `main` deploy to
45GitHub Pages via `.github/workflows/deploy.yml`.