Technology
How the pieces fit together.
React & TypeScript
The interface is built with React. TypeScript adds type checking so the browser and server agree on the exact shape of every message.
Node.js
The server runs on Node.js. It hands out guest sessions, manages rooms and share links, and referees games.
PostgreSQL
A database for the few things that must survive a restart: rooms, who is in them, game state, and share-link status. Never videos or files.
WebSockets / Socket.IO
A persistent two-way connection so the server can push updates instantly: “your friend joined”, “it’s your turn”, “playback paused”.
WebRTC
A browser standard for real-time audio, video and data directly between browsers, encrypted end to end between the two peers.
STUN & TURN
STUN helps a browser discover its public address so peers can connect directly. TURN relays encrypted traffic when a direct path is blocked.
Peer-to-peer media
The creator’s browser captures the playing video and sends it as a live stream track to the guest — the same mechanism video calls use.
DataChannels & chunking
Files are cut into small chunks and sent over a WebRTC DataChannel with flow control, so a slow connection never overwhelms memory.
Server-authoritative games
Browsers send intentions; the server validates moves, rolls dice with a cryptographic random generator, and decides results.
HTTPS & secure signaling
In production everything runs over HTTPS and secure WebSockets (WSS); WebRTC itself always encrypts media (SRTP) and data (DTLS).
About playNshare
playNshare was built around one idea: the simplest way to do something together online is to connect two browsers directly and keep the server out of the way. It deliberately does three things — watch, play and share — for exactly two people, without accounts.
The source is organised so each feature can be audited on its own, and the documentation is honest about what has and has not been verified.