A modern, feature-rich realtime chat application with integrated video calling capabilities. Built with the MERN stack and Socket.io for seamless communication.
- Instant Messaging: Send and receive messages in real-time
- Group Chats: Create and manage group conversations
- Online Status: See who's online and available to chat
- Message History: Persistent message storage with MongoDB
- Typing Indicators: Know when someone is typing
- HD Video Calls: Crystal-clear video communication
- Audio Controls: Mute/unmute microphone and camera
- Call Management: Initiate, accept, reject, or end calls
- Peer-to-Peer: Direct connection for better performance
- JWT Authentication: Secure token-based authentication
- Google OAuth: Sign in with Google account
- Password Encryption: bcrypt hashing for security
- Protected Routes: Secure API endpoints
- Responsive Design: Works perfectly on desktop and mobile
- Dark/Light Themes: Toggle between themes
- Beautiful Components: DaisyUI component library
- Loading States: Skeleton loaders and smooth transitions
- Error Handling: Comprehensive error management
- Profile Management: Customize your profile with avatars
- User Search: Find and connect with other users
- Avatar Upload: Cloudinary integration for image storage
- React 18 - Modern React with hooks
- Vite - Lightning-fast build tool
- Tailwind CSS - Utility-first CSS framework
- DaisyUI - Beautiful component library
- Zustand - Simple state management
- Socket.io-client - Realtime communication
- Node.js - JavaScript runtime
- Express.js - Robust web framework
- MongoDB - NoSQL database
- Socket.io - Bidirectional communication
- JWT - Secure authentication
- Cloudinary - Media storage
- Node.js (v18 or higher)
- MongoDB (local or Atlas)
- npm or yarn
-
Clone the repository
git clone https://github.com/mandar1045/videoChat.git cd yochat -
Install dependencies
npm install
-
Environment Setup
Create
.envfiles in bothbackend/andfrontend/directories:backend/.env
MONGODB_URI=your_mongodb_connection_string PORT=5001 JWT_SECRET=your_jwt_secret_key CLOUDINARY_CLOUD_NAME=your_cloudinary_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_secret GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret NODE_ENV=development
frontend/.env
VITE_API_URL=http://localhost:5001 VITE_CLOUDINARY_CLOUD_NAME=your_cloudinary_name
-
Start the development servers
Terminal 1 - Backend:
cd backend npm run devTerminal 2 - Frontend:
cd frontend npm run dev -
Open your browser
http://localhost:5173
yochat/
βββ backend/
β βββ src/
β β βββ controllers/ # API route handlers
β β βββ lib/ # Database, Socket, Cloudinary utils
β β βββ middleware/ # Authentication middleware
β β βββ models/ # MongoDB schemas
β β βββ routes/ # API endpoints
β β βββ seeds/ # Database seeders
β βββ package.json
βββ frontend/
β βββ public/ # Static assets
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Application pages
β β βββ store/ # Zustand state stores
β β βββ lib/ # Utility functions
β β βββ constants/ # App constants
β βββ package.json
βββ package.json # Root build scripts
# Build the entire application
npm run build
# Start production server
npm start| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/signup |
User registration |
| POST | /api/auth/login |
User login |
| GET | /api/messages/:userId |
Get chat messages |
| POST | /api/messages/send/:userId |
Send message |
| GET | /api/groups |
Get user groups |
| POST | /api/groups |
Create group |
sendMessage- Send a messagestartCall- Initiate video callacceptCall- Accept incoming callendCall- End current call
newMessage- Receive new messageincomingCall- Incoming call notificationcallAccepted- Call acceptedgetOnlineUsers- Online users list
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the ISC License - see the LICENSE file for details.
- Socket.io for realtime communication
- DaisyUI for beautiful components
- Tailwind CSS for styling
- React for the frontend framework
If you have any questions or need help, feel free to open an issue or contact the maintainers.
Made with β€οΈ by mandar1045