# Quick Start Guide

## 🚀 Start the Application

```bash
npm run dev
```

OR use the start script:
```bash
./start.sh
```

## 🌐 Access the App

Open your browser and go to: **http://localhost:5173**

## 📝 How to Use

### Starting a Meeting
1. Enter your name (e.g., "John")
2. Enter a room name (e.g., "meeting-123")
3. Click "Join Meeting"
4. Allow camera and microphone access

### Inviting Others
- Share the room name with others
- They enter the same room name to join
- Everyone in the same room can see and hear each other

### Controls During Meeting

| Button | Function |
|--------|----------|
| 🎤 | Toggle microphone on/off |
| 📹 | Toggle camera on/off |
| 🖥️ | Share your screen |
| 📞 | Leave the meeting |

## 🔧 Technical Details

### What's Running
- **Backend Server**: Port 3000 (Express + Socket.IO + Mediasoup)
- **Frontend Client**: Port 5173 (Vite dev server)
- **WebRTC Ports**: 40000-49999 (for media streaming)

### Key Features Implemented
✅ Real-time video/audio streaming
✅ Multiple participants support
✅ Room-based meetings
✅ Mute/unmute controls
✅ Screen sharing
✅ Participant tracking
✅ Automatic reconnection handling
✅ Responsive grid layout

## 🐛 Common Issues & Solutions

### Issue: "Camera not found"
**Solution**: 
- Check browser permissions
- Ensure no other app is using the camera
- Try refreshing the page

### Issue: "Can't hear other participants"
**Solution**:
- Click anywhere on the page (browser autoplay policy)
- Check your speaker volume
- Ensure participants haven't muted themselves

### Issue: "Connection failed"
**Solution**:
- Verify server is running: `npm run server`
- Check if port 3000 is available
- Restart both server and client

### Issue: "Screen share not working"
**Solution**:
- Only works on HTTPS or localhost
- Check browser permissions
- Try Chrome/Edge (best support)

## 📱 Testing with Multiple Users

### Option 1: Same Computer
1. Open multiple browser tabs
2. Use different names in each tab
3. Use the same room name

### Option 2: Different Computers (Same Network)
1. Find your local IP: `ifconfig` (Mac/Linux) or `ipconfig` (Windows)
2. Update client.js line 48: Change `localhost` to your IP
3. Others access: `http://YOUR_IP:5173`

### Option 3: Different Networks
- Requires TURN server configuration
- Or use ngrok for testing: `ngrok http 3000`

## 🎯 Next Steps

To make this production-ready:
1. Add HTTPS certificates
2. Configure TURN/STUN servers
3. Add user authentication
4. Implement chat feature
5. Add recording capability
6. Deploy to cloud (AWS, Heroku, etc.)

## 📊 Performance Tips

- **Recommended**: 3-6 participants for best quality
- **Maximum**: Depends on server resources
- **Bandwidth**: ~2-3 Mbps per participant
- **Browser**: Chrome/Edge recommended

## 🔐 Security Notes

⚠️ **Current Setup**: Development only
- No authentication
- No encryption beyond WebRTC
- No rate limiting
- No input validation

For production, implement:
- User authentication (JWT, OAuth)
- Room passwords
- Participant limits
- Input sanitization
- Rate limiting
- HTTPS everywhere

## 📞 Support

Check console logs for debugging:
- **Browser Console**: F12 → Console tab
- **Server Logs**: Terminal running `npm run server`

Common log messages:
- ✅ "Client connected" - User joined
- 🎥 "New producer" - Camera/mic started
- ▶ "Consumer created" - Receiving stream
- 👋 "Client disconnected" - User left

---

**Enjoy your video meetings! 🎉**
