All projects
  • Study project

Private Chat

Realtime Self-Destructing Rooms

Anonymous, two-person chat rooms that live for 10 minutes and can be destroyed on demand. Messages are delivered in real time and wiped from the server when the room ends.

realtime-chat-iota-six.vercel.app
Private Chat

The Challenge

Build a private chat with no sign-up where only two people can join a room, messages arrive instantly, and nothing is left behind once the room expires or is destroyed, all running on serverless infrastructure without a long-lived WebSocket server.

The Solution

Built on Next.js with an Elysia API mounted in a catch-all route and consumed through Eden's end-to-end typed client. Room metadata and messages live in Upstash Redis with a shared TTL, while Upstash Realtime pushes new messages and destroy events to both participants. A Next.js proxy issues an httpOnly token per participant and caps each room at two, and Zod validates every request and event.

Key Deliverables

  • Rooms limited to two participants with httpOnly token access
  • Real-time messaging via Upstash Realtime
  • 10-minute auto-expiry with live countdown
  • One-click destroy that wipes all messages for both users
  • Anonymous generated identities, no sign-up