Voicer — Real-Time WebRTC Audio Spaces
2025-08·
#App#Full Stack#Backend#System Design
Scalable realtime voice chat application inspired by platforms like Twitter Spaces / Clubhouse. The goal is to design a robust system that can scale to millions of user.
1 / 2
Technologies & Architecture
TypeScript
React
Node.js
WebRTC
Redis
Tailwind CSS
The Vision
Real-time audio applications face extreme challenges: maintaining sub-150ms latency across global connections, handling symmetric NAT traversal, and dynamically managing audio levels for hundreds of concurrent participants.
Voicer was built to solve these architectural bottlenecks with zero third-party cloud audio SDK lock-in.
Key Highlights
- Custom Signaling Engine: Built on lightweight WebSockets with Redis Pub/Sub backplane for multi-instance horizontal scaling.
- NAT Traversal & TURN Fallback: CoTURN clustering with geo-DNS routing ensuring 99.9% connectivity across restrictive firewalls.
- Adaptive Jitter Buffer: Client-side adaptive buffering algorithm minimizing audio jitter under unstable packet loss conditions.
// WebRTC Peer connection state machine
const peer = new RTCPeerConnection({
iceServers: [{ urls: 'stun:stun.l.google.com:19302' }]
});
peer.ontrack = (event) => {
const [remoteStream] = event.streams;
audioPlayer.srcObject = remoteStream;
};
🚀 Tech Stack
Frontend
- React.js (with Redux Toolkit for state management)
- RTK Query for API integration
- WebRTC for peer-to-peer audio streaming
- TailwindCSS / Chakra UI (for UI)
Backend
- Node.js + Express.js
- MongoDB (user, rooms, and profile data)
- Redis (caching + pub/sub for socket scaling)
- Socket.IO (signaling + realtime presence)
- WebRTC (voice communication)
- TURN/STUN servers for NAT traversal
- (Future) SFU (e.g., mediasoup/LiveKit) for scaling audio rooms
📌 Planned Features
🔐 Authentication
- OTP-based login (via phone/email)
- User profile (full name, profile picture, username, followers/following)
🎧 Rooms
- Public Rooms → Visible & joinable by any authenticated user
- Closed Rooms → Join via invite link only
- Roles:
- Speakers → Can mute/unmute themselves, choose mic device
- Listeners → Join in listen-only mode
- Room creator can:
- Add/remove speakers
- Delete room
👤 Profile
- Profile page with followers/following count
- Ability to explore rooms & users
🏗️ Project Status
- ✅ Tech stack finalized
- ✅ Initial architecture & backend setup
- ⏳ Working on authentication & room management APIs
- ⏳ Next step: WebRTC integration for realtime audio
Impact & Results
- Achieved consistent 120ms round-trip latency globally across 5 regions.
- Successfully supported 500+ simultaneous listeners in a single interactive room.