Prerequisites
Before you begin, ensure you have:- Node.js 20+ installed (download)
- npm, yarn, pnpm, or bun package manager
- Upstash account for Redis and Realtime (sign up free)
Setup Upstash services
Create Redis database
- Log in to Upstash Console
- Navigate to Redis section
- Click Create Database
- Choose a name and region (any region works)
- Copy the
UPSTASH_REDIS_REST_URLandUPSTASH_REDIS_REST_TOKEN
Upstash Realtime automatically uses your Redis credentials. You only need to configure Redis environment variables.
Install locally
Start the development server
Test the application
Create your first room
- Open http://localhost:3000
- You’ll see an auto-generated username (e.g.,
user_a8f9d2) - Click CREATE ROOM
- You’ll be redirected to a new room with a unique ID
Invite someone to join
- Copy the room URL from your browser
- Open it in an incognito window or another browser
- Each participant gets a unique username
- The 10-minute countdown timer starts when the room is created
Send messages
- Type a message in the input field
- Press Enter or click SEND
- Messages appear instantly for all connected participants
- Your messages show in green, others in blue
Verify real-time functionality
You should observe:- Instant message delivery - Messages appear immediately in all tabs
- Synchronized destruction - All tabs redirect when room is destroyed
- Countdown sync - All participants see the same countdown timer
Common issues
Error: Room not found
Error: Room not found
The room may have expired after 10 minutes. Create a new room to continue.
Messages not appearing in real-time
Messages not appearing in real-time
- Verify Upstash Redis credentials in
.env.local - Check browser console for WebSocket connection errors
- Ensure Realtime is enabled in your Upstash console
Authentication errors
Authentication errors
Clear your browser cookies and refresh. Authentication tokens are stored as cookies and may need to be reset.
Port 3000 already in use
Port 3000 already in use
Run on a different port:
Project structure
Key files and directories:Next steps
How it works
Learn about the architecture and core concepts
Deploy to Vercel
Launch your instance to production
API reference
Explore the REST API endpoints
Redis data model
Understand how data is stored and expires