forked from quic-issues/427e7578-d7bf-49c8-aee9-2dd999e25316
1.3 KiB
1.3 KiB
P2P Poll App
A peer-to-peer polling app where users can add options and vote on them. All data syncs directly between browsers using WebRTC — no central server stores any poll data.
How It Works
- Yjs CRDTs handle shared state — concurrent edits from different peers merge automatically without conflicts
- y-webrtc establishes direct WebRTC connections between browsers (a public signaling server is used only for peer discovery)
- Each user gets a stable random ID (stored in localStorage) ensuring one vote per user per option
- Polls are identified by room name, shareable via URL
Getting Started
npm install
npm run dev
Open http://localhost:5173 in your browser. To share a specific poll, use the ?room= query parameter:
http://localhost:5173/?room=my-poll
Share this URL with others to join the same poll.
Cross-Device Testing
npm run dev -- --host
Then open http://<your-local-ip>:5173/?room=test on another device on the same network.