Chat
Chat, call or video call with your friends all in realtime.
React.jsNode.jsExpress.jsRedisSocket.ioKinde AuthCloudinaryTailwind CSSWebsocketsWebRTC
View Mode:
1. Problem Statement
What?
Users needed a secure, low-latency platform for text, voice, and video communication without relying on third-party data-hungry platforms.
Who?
Privacy-conscious users and small teams needing instant communication tools.
Why it mattered?
Existing chat solutions often have high overhead, complex setups, or privacy concerns regarding message storage.
2. Product Thinking
The Solution
Developed a full-stack chat application leveraging Redis as the primary data store for ultra-fast message delivery. Integrated Socket.io for real-time signaling and WebRTC for secure, peer-to-peer audio/video calling. Media assets are handled via Cloudinary with signed URLs stored in Redis to ensure secure access.
Alternatives Considered
- •HTTP Polling (too slow for real-time)
- •Firebase (vendor lock-in and pricing scaling issues)
- •Standard SQL DB (slower for high-frequency small message writes)
Trade-offs Made
- •Redis over SQL: Sacrificed complex querying capabilities for sub-millisecond message persistence and retrieval.
- •WebRTC P2P: Chose Peer-to-Peer over SFU/MCU to reduce server bandwidth costs and enhance privacy, accepting potential connection issues on restricted networks.
- •Ephemeral State: Redis handles active session and presence data, while long-term history is optimized for speed.
3. System Architecture
Next.js + Socket.io
Frontend
Signaling Server
Backend
Redis DB
Database
Cloudinary
External
STUN/TURN
External
Frontend
Backend
Database
Hover over components to see details. This diagram is interactive.
4. Impact & Outcome
Summary
Engineered a high-performance real-time communication platform supporting instant messaging and WebRTC-based video conferencing.
Key Impact
- ✓Reduced message delivery latency to sub-50ms using Redis pub/sub.
- ✓Implemented secure P2P video calls reducing server load by 95%.
- ✓Streamlined media sharing with 100% secure Cloudinary signed URLs.
Outcome
Delivered a robust, privacy-first communication tool that demonstrates expertise in real-time systems and WebRTC protocols.
5. Challenges & Failures
What Broke
ICE candidate exchange was failing in symmetric NAT environments, preventing video calls.
Lesson Learned
Integrated a global TURN server mesh to provide a fallback relay, ensuring high connection success rate.
What Broke
Message ordering was inconsistent during high-concurrency bursts.
Lesson Learned
Leveraged Redis Sorted Sets with high-precision timestamps (micro-seconds) to guarantee chronological delivery.
6. Outcome & Learnings
Key Learnings
- →WebRTC state machines are complex; robust signaling is half the battle.
- →Redis is an incredibly capable primary DB for real-time workloads when modeled correctly.
- →Signed URLs are essential for securing user-uploaded media without complex proxying.
- →Graceful degradation (falling back from video to audio/text) is key to good UX.
What I'd Improve Next
- ○Implement End-to-End Encryption (E2EE) using the Web Crypto API.
- ○Add group video calling support via a Selective Forwarding Unit (SFU).
- ○Build a desktop client using Electron for system-level notifications.