WebRTC Chat & Calls: Real-Time Messaging and Video Calling App
Portfolio project
WebRTC Chat & Calls is a real-time messenger with built-in audio and video calling, inspired by Telegram's look and feel. Join with a display name, see who is online, chat instantly and start a call from the conversation header. No sign-up and nothing to install.

What it does
• Instant join: pick a display name and you are online. The server keeps names unique.
• Live presence: every user's online or in-a-call status updates in real time.
• Real-time chat: one-to-one messages over WebSockets with timestamps, delivery ticks, message previews, latest-first ordering and search.
• Audio and video calls: start either from the chat header. The caller sees a ringing screen; the other person gets an incoming-call prompt with Accept and Decline.
• In-call controls: mute, speaker, camera on/off, hang up, a live timer and a picture-in-picture self view.
• Responsive: two panels on desktop; on phones the list and chat swap with a back button and calls go full screen.




How it works
A Node.js and Express server hosts a WebSocket signaling endpoint. It tracks connected users in memory, broadcasts who is online, relays chat messages and routes call events (offer, answer, reject, end). When a call starts, the two browsers exchange WebRTC session descriptions and ICE candidates through that server, then connect directly using public STUN servers. Audio and video travel peer-to-peer, encrypted by WebRTC, and never pass through the server.

Engineering details
• Typed signaling protocol shared by the client and the server (TypeScript and a Zod enum), so message types cannot drift apart.
• Race-safe call setup: offers and ICE candidates that arrive before the other side is ready are queued, then applied in order.
• Busy handling: the server rejects a call to a user who is already in one.
• Clean teardown: if someone drops mid-call, the other side is notified and returned to the chat.
• Call logic isolated in two React hooks, useSignaling (WebSocket, chat, presence) and useWebRTC (peer connection, media, mute, camera, speaker).
0 likes · 0 views · Nov 23, 2026
A Telegram-style web app for real-time chat with built-in peer-to-peer audio and video calls: live presence, delivery ticks, a ring / accept / decline call flow