RelayRTC is a full-stack, production-style video conferencing application built using WebRTC with an SFU (Selective Forwarding Unit) architecture. It supports multi-party video meetings, real-time signaling, authentication, and meeting management, designed to demonstrate how modern platforms like Zoom or Google Meet work internally.
This project is suitable for:
- Learning WebRTC and real-time systems
- System design and backend engineering portfolios
- Interview demonstrations
- Building SFU-based media pipelines from scratch
- JWT-based authentication
- Secure login and registration
- Protected routes and session handling
- SFU-based multi-party video calls
- Real-time audio and video streaming
- Screen sharing support
- Media controls (microphone, camera, screen toggle)
- Create and join meetings via unique IDs
- Host and participant roles
- Active and past meeting tracking
- Socket.io for signaling
- SDP (Offer/Answer) exchange
- ICE candidate negotiation
- Live participant join/leave updates
- Modern responsive interface
- Dark mode optimized for video calls
- Real-time notifications
- Connection quality indicators
- User authenticates using JWT.
- Client establishes a WebSocket (Socket.io) connection.
- User creates or joins a meeting.
- WebRTC signaling (Offer / Answer / ICE) is exchanged via Socket.io.
- Media streams are sent to the SFU server.
- The SFU selectively forwards streams to other participants.
- UI updates in real time as peers connect or disconnect.
Media never flows through REST APIs; only signaling does.
getUserMedia()captures camera and microphone.RTCPeerConnectionmanages peer connections.- SDP describes media capabilities.
- ICE finds optimal network paths.
- Socket.io handles signaling only.
- Actual media is transported via WebRTC and routed by the SFU.
Selective Forwarding Unit (SFU):
- Receives streams from all participants.
- Forwards them without re-encoding.
- Low latency and low CPU usage.
- Scales significantly better than mesh topology.
- Industry standard used by Zoom, Google Meet, Microsoft Teams.
- Node.js, Express.js
- Socket.io
- WebRTC SFU
- MongoDB + Mongoose
- JWT Authentication
- TypeScript
- Next.js
- Tailwind CSS
- ShadCN UI
- Zustand (state management)
- Socket.io Client
- WebRTC APIs
- Zod + React Hook Form
backend/
├── services/ # SFU & signaling logic
├── routes/ # Auth & meeting APIs
├── middleware/ # JWT, validation
├── models/ # MongoDB schemas
└── index.ts # App entry
frontend/
├── app/ # Next.js routing
├── components/ # UI components
├── services/ # WebRTC & Socket logic
├── state/ # Global state (Zustand)
└── api/ # API clients
- Node.js v18+
- MongoDB
- npm or yarn
cd backend
npm install
cp .env.example .env
npm run devcd frontend
npm install
npm run devmongodNODE_ENV=development
PORT=3000
MONGODB_URI=mongodb://localhost:27017/relayrtc
JWT_SECRET=your_secret
ALLOWED_ORIGINS=http://localhost:3001
- In-meeting chat
- Meeting recording
- Host moderation tools
- TURN server integration
- Horizontal scaling with Redis and multiple SFU instances
MIT License