Back to projects
Sep 2026

Realtime Chat: WebSockets & WebRTC

A hands-on project for learning real-time communication on the web, starting with WebSockets via Socket.IO and progressively exploring WebRTC for peer-to-peer features.

Node.jsExpressSocket.IOJavaScriptWebRTC

What's built

A real-time group chat app with:

  • Real-time messaging: messages broadcast instantly to all connected clients via Socket.IO
  • Username system: users set a display name on join; shown in all messages
  • Active users sidebar: live list of connected users, updated on join/disconnect
  • Chat history: messages persisted to a JSON file and replayed to new joiners
  • Clean separation: socket handlers, services, and routes each in their own layer

Tech stack

LayerTechnology
BackendNode.js, Express, Socket.IO
FrontendVanilla JS, HTML/CSS (no framework)
PersistenceFile-based JSON

What's next: WebRTC

This project doubles as a running checklist for learning WebRTC on top of the existing Socket.IO signaling server:

  • Fundamentals: peer connections (RTCPeerConnection), SDP offers/answers, ICE candidates and NAT traversal
  • Audio & video: getUserMedia, local/remote <video> streams, a basic 1-on-1 video call
  • Data channels: peer-to-peer text and binary transfer with RTCDataChannel, building toward P2P file transfer
  • Multi-peer: mesh vs. SFU vs. MCU topologies, and where a mesh call breaks down
  • Infrastructure: STUN for NAT traversal, self-hosting a TURN server (coturn) for symmetric NAT cases

More Projects