A modern 6-person video chat application built with WebRTC mesh networking. Connect face-to-face with up to 5 other people in high-quality peer-to-peer video calls with real-time messaging.
- 6-Person Video Chat: WebRTC mesh networking for direct peer-to-peer connections
- Real-time Messaging: Integrated chat alongside video calls
- Modern Dark UI: "Slate Studio" design system with Tailwind CSS
- Responsive Layout: Dynamic video grid that adapts from 1-6 participants
- Audio/Video Controls: Toggle camera and microphone with visual feedback
- User Authentication: Secure Auth0 integration
- Human-Readable Room Names: Auto-generated room names (e.g., "brave-blue-tiger")
- Mobile Responsive: Works across desktop, tablet, and mobile devices
- Frontend: React 18 + TypeScript, Tailwind CSS, Auth0, Socket.IO Client
- Backend: Node.js + Express (ES6 modules), MongoDB + Mongoose, Socket.IO
- Real-time: WebRTC for video/audio, Socket.IO for signaling
- Database: MongoDB with Mongoose ODM
- Deployment: Render.com ready
- Mesh Topology: Each user connects directly to every other user (P2P)
- Signaling Server: Socket.IO handles offer/answer/ICE candidate exchange
- Media Management: Custom hooks for stream handling and peer connections
- Graceful Degradation: Fallback UI when video is disabled
- Node.js (v16 or higher)
- MongoDB (local or cloud instance)
- npm or yarn
-
Clone the repository
git clone <repository-url> cd yap
-
Install dependencies
# Install backend dependencies npm install # Install frontend dependencies cd client npm install cd ..
-
Environment Variables
Create a
.envfile in the root directory:# MongoDB Connection MONGODB_URI=mongodb://127.0.0.1:27017/yap # Auth0 Configuration (required for authentication) AUTH0_DOMAIN=your-auth0-domain AUTH0_CLIENT_ID=your-auth0-client-id # Server Configuration PORT=3001 NODE_ENV=development
-
Database Setup
Local MongoDB:
# Install MongoDB Community Edition # macOS (with Homebrew) brew install mongodb-community brew services start mongodb-community # Linux (Ubuntu/Debian) sudo apt-get install -y mongodb sudo systemctl start mongod # Windows # Download and install from: https://www.mongodb.com/try/download/community
Or use MongoDB Atlas (Cloud):
- Create account at MongoDB Atlas
- Create a cluster and get connection string
- Update
MONGODB_URIin.envwith your Atlas connection string
-
Start MongoDB (if using local installation)
# macOS/Linux mongod # Or if installed via Homebrew brew services start mongodb-community
-
Start the backend server
npm start
Server will run on
http://localhost:3001 -
Start the frontend (in a new terminal)
cd client npm startClient will run on
http://localhost:3000 -
Access the application
- Open
http://localhost:3000in your browser - Create or join a room to start video chatting!
- Open
Backend (root directory):
npm start # Start the Node.js serverFrontend (client directory):
npm start # Start development server
npm run build # Production build
npm test # Run tests in watch modeyap/
├── server.js # Main server entry point
├── models/ # MongoDB schemas
│ ├── User.js
│ ├── Room.js
│ └── Message.js
├── routes/ # Express API routes
│ ├── roomRoutes.js
│ └── userRoutes.js
├── sockets/ # Socket.IO event handlers
│ └── socketEvents.js
└── client/ # React frontend
├── src/
│ ├── components/ # React components
│ │ ├── atoms/ # Base components
│ │ ├── molecules/ # Composite components
│ │ └── Room/ # Video chat components
│ ├── services/ # Socket.IO client
│ ├── types/ # TypeScript definitions
│ └── hooks/ # Custom React hooks
└── public/
- Room.tsx: Main video chat interface with WebRTC implementation
- VideoGrid.tsx: Dynamic layout system for 1-6 participants
- PeerConnectionManager.ts: Manages multiple RTCPeerConnection instances
- socketEvents.js: WebRTC signaling server and room management
- useMediaStream.ts: Custom hook for camera/microphone control
Authentication is handled through Auth0. You can use Auth0 or configure another authentication provider:
- Create Auth0 account at auth0.com
- Create a new application (Single Page Application)
- Configure callback URLs:
- Allowed Callback URLs:
http://localhost:3000 - Allowed Logout URLs:
http://localhost:3000 - Allowed Web Origins:
http://localhost:3000
- Allowed Callback URLs:
- Update
.envwith your Auth0 credentials
The application expects MongoDB to be running on the default port (27017). You can customize this by updating the MONGODB_URI environment variable.
This application can be deployed to any hosting platform that supports Node.js applications (Heroku, Railway, DigitalOcean, AWS, Render, etc.).
General deployment requirements:
- Node.js runtime environment
- MongoDB database (local or cloud)
- Environment variables configured
- Static file serving for the React frontend
Build commands:
- Backend:
npm install→npm start - Frontend:
cd client && npm install && npm run build - Frontend build output:
client/build/
The frontend build uses CI=false flag to treat warnings as warnings rather than errors.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ using WebRTC, React, and Node.js