A production-ready Omegle clone built specifically for college students with WebRTC peer-to-peer video chat functionality.
- ✅ Real-time Video Chat: WebRTC peer-to-peer video and audio communication
- ✅ User Matching: Automatic matching system for connecting users
- ✅ Database Integration: MongoDB for user and room management
- ✅ Security: Rate limiting, CORS, helmet.js security headers
- ✅ Logging: Comprehensive logging system with Winston
- ✅ Room Management: Automatic cleanup on disconnect
- ✅ Reporting System: Users can report inappropriate behavior
- ✅ Production Ready: Environment variables, error handling, graceful shutdown
- Node.js + TypeScript
- Express.js
- Socket.io
- MongoDB + Mongoose
- Winston (Logging)
- Helmet (Security)
- Express Rate Limit
- React + TypeScript
- Vite
- Socket.io Client
- WebRTC API
- Node.js 18+
- MongoDB (local or MongoDB Atlas)
- npm or yarn
- Clone the repository
git clone <your-repo-url>
cd omegle-master-3- Backend Setup
cd backend
npm install- Create backend
.envfile
PORT=3000
NODE_ENV=development
MONGODB_URI=mongodb://localhost:27017/omegle-clone
CORS_ORIGIN=http://localhost:5173- Frontend Setup
cd frontend
npm install- Start MongoDB (if running locally)
# macOS
brew services start mongodb-community
# Linux
sudo systemctl start mongodb- Start Backend
cd backend
npm run dev- Start Frontend (in a new terminal)
cd frontend
npm run dev- Open Browser
Navigate to
http://localhost:5173
omegle-master-3/
├── backend/
│ ├── src/
│ │ ├── config/ # Configuration files
│ │ │ ├── database.ts # MongoDB connection
│ │ │ ├── logger.ts # Winston logger
│ │ │ └── webrtc.ts # WebRTC config
│ │ ├── models/ # MongoDB models
│ │ │ ├── User.ts # User schema
│ │ │ └── Room.ts # Room schema
│ │ ├── managers/ # Business logic
│ │ │ ├── UserManger.ts
│ │ │ └── RoomManager.ts
│ │ └── index.ts # Main server file
│ ├── dist/ # Compiled JavaScript
│ └── logs/ # Application logs
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ ├── Landing.tsx # Landing page
│ │ │ └── Room.tsx # Video chat room
│ │ └── App.tsx
│ └── dist/ # Production build
└── README.md
GET /- Health checkGET /api/rtc-config- WebRTC configuration
join- Join the matching queuesocket.emit('join', { name: string, interests?: string[] })
offer- Send WebRTC offeranswer- Send WebRTC answeradd-ice-candidate- Send ICE candidatedisconnect-room- Disconnect from current roomreport-user- Report a user
lobby- User is in matching queuesend-offer- Start WebRTC connectionoffer- Receive WebRTC offeranswer- Receive WebRTC answeradd-ice-candidate- Receive ICE candidateuser-disconnected- Other user disconnectederror- Error message
See .env.example files in both backend and frontend directories for all available environment variables.
See PRODUCTION_GUIDE.md for detailed production deployment instructions.
cd backend
npm run dev # Builds and starts server
npm run build # Only builds TypeScript
npm start # Runs compiled JavaScriptcd frontend
npm run dev # Starts Vite dev server
npm run build # Builds for production
npm run preview # Preview production build- College email verification
- Interest-based matching
- Text chat alongside video
- Admin dashboard for moderation
- User profiles
- Block users
- Video filters/effects
- Screen sharing
- Mobile app support
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
ISC
For issues or questions, please open an issue on GitHub.