Overview
This guide will help you set up Watch N Chill on your local machine and create your first watch party room. The entire process takes less than 5 minutes.Watch N Chill uses a custom Next.js server that integrates Socket.IO for real-time features. Make sure you have Node.js 20+ and Redis installed before starting.
Prerequisites
Before you begin, ensure you have the following installed:Node.js
Version 20 or higher is required. Download from nodejs.org
Redis
Either a local Redis instance or an Upstash Redis URL
Installing Redis
Choose one of the following options:- Docker (Recommended)
- macOS (Homebrew)
- Linux
- Upstash
The easiest way to run Redis locally is with Docker:This creates a Redis container accessible at
localhost:6379.Installation
Configure environment variables
Create a Add your Redis connection URL:
.env.local file in the project root:.env.local
- Local Redis
- Upstash Redis
Create Your First Room
Now that Watch N Chill is running, let’s create your first watch party:Open the application
Navigate to http://localhost:3000 in your browser. You’ll see the landing page with options to create or join a room.
Create a new room
- Click “Create Room” or navigate to
/create - Enter your display name (2-20 characters)
- Click “Create Room”
- Generate a unique 6-character room ID
- Create a host token for you
- Redirect you to the room at
/room/[roomId]
Add a YouTube video
As the host, you can add a video:
- Paste any YouTube URL in the video input field
- Supported formats:
https://www.youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_ID
- The video will load for all participants automatically
Only hosts can change the video URL to prevent disruptions during the watch party.
Invite others to join
Share your room code with others:
- Copy the 6-character room ID from the URL or room header
- Friends can join by:
- Clicking “Join Room” on the landing page
- Entering the room code and their display name
- Or navigating directly to
/room/[roomId]
Control playback
As the host, you control the video for everyone:
- Play/Pause: Click the play button or press spacebar
- Seek: Drag the progress bar or use arrow keys
- Sync: All guests automatically sync every few seconds
Testing the Setup
Verify everything is working correctly:Check Socket.IO Connection
Check Socket.IO Connection
Open your browser’s developer console. You should see:If you see connection errors, verify:
- Redis is running (
redis-cli pingshould returnPONG) REDIS_URLis correctly configured- Port 3000 is not in use by another application
Check Redis Connection
Check Redis Connection
Test your Redis connection:Should return:
PONGView stored room data:Test Room Creation
Test Room Creation
Create a room and check:
- ✅ Redirected to
/room/[roomId] - ✅ Room ID displayed in header
- ✅ Your name appears in user list
- ✅ You have the “Host” badge
- ✅ Video input is enabled (host only)
Test Video Synchronization
Test Video Synchronization
Open the same room in two browser windows:
- Host window: Play/pause the video
- Guest window: Should sync automatically
- Host window: Seek to a different time
- Guest window: Should jump to the same time
Running with Docker (Alternative)
Prefer to use Docker? Run both the app and Redis with Docker Compose:docker-compose.yml file which:
- Builds the app image from the Dockerfile
- Starts Redis on port 6380 (mapped from container port 6379)
- Exposes the app on http://localhost:3000
- Includes health checks for both services
docker-compose.yml
Common Issues
Error: Redis connection failed
Error: Redis connection failed
Solution:
-
Verify Redis is running:
-
Check your
REDIS_URLin.env.local -
If using Docker, ensure the container is running:
Socket.IO connection error
Socket.IO connection error
Solution:
- Clear browser cache and hard reload (Cmd/Ctrl + Shift + R)
- Check if port 3000 is available:
- Restart the development server
Room not found after creation
Room not found after creation
Solution:
-
Check Redis is persisting data:
- Verify the Socket.IO event listeners are registered
- Check browser console for error messages
Video not syncing between users
Video not syncing between users
Solution:
- Ensure both users are in the same room (check room ID)
- Verify Socket.IO is connected on both clients
- Check if one user is the host (only hosts can control playback)
- Look for network issues blocking WebSocket connections
Next Steps
Now that Watch N Chill is running, explore these topics:Room Management
Learn about host promotion, room closing, and user management
Video Synchronization
Deep dive into how playback sync works
Chat System
Explore chat features, typing indicators, and message persistence
Deploy to Production
Deploy Watch N Chill to production with Docker and Upstash