A full-featured real-time chat application with WebRTC-based peer-to-peer video calling.
- WebSocket-based instant messaging
- Multiple chat rooms
- User presence and online status
- Typing indicators
- Message history (last 100 messages per room)
- System notifications for join/leave events
- WebRTC peer-to-peer video calls
- One-on-one video calls between users
- Audio/video controls (mute, camera toggle)
- Screen sharing capability
- Call signaling through WebSocket
- STUN server support for NAT traversal
- Modern, responsive design
- Real-time user list
- Incoming call notifications
- In-call controls
- Beautiful gradient animations
# Build and run
docker-compose up --build
# Or build manually
docker build -t webrtc-chat .
docker run -p 8000:8000 webrtc-chat- Open http://localhost:8000 in your browser
- Enter your username and room name
- Join the room to start chatting
- Click "Call" next to any user to start a video call
- Use in-call controls to mute, toggle video, or share screen
GET /- Web interfaceWS /ws- WebSocket connection for real-time communicationGET /api/rooms- List active roomsGET /api/stats- Platform statistics
join- Join a roomchat- Send chat messagetyping- Send typing indicatorstart_call- Initiate video callanswer_call- Answer incoming callice_candidate- WebRTC ICE candidateend_call- End calldecline_call- Decline incoming call
history- Message historyusers_list- Online usersuser_joined- User joined notificationuser_left- User left notificationchat- Chat messagetyping- Typing indicatorincoming_call- Incoming video callcall_answered- Call was answeredice_candidate- WebRTC ICE candidatecall_ended- Call endedcall_declined- Call was declined
- Backend: FastAPI with WebSocket support
- Frontend: Vanilla JavaScript with WebRTC API
- Signaling: WebSocket for call coordination
- Media: WebRTC for peer-to-peer audio/video
- STUN Servers: Google's public STUN servers
- Container: Docker with Python 3.12
- Modern browser with WebRTC support (Chrome, Firefox, Safari, Edge)
- Camera and microphone permissions
- HTTPS or localhost required for media devices
- TURN server for better NAT traversal
- Group video calls
- File sharing
- Message reactions and emojis
- User authentication
- Persistent message storage (database)
- Message search
- Video recording
- Chat moderation tools
- Mobile apps (React Native)