- Overview
- Features
- Tech Stack
- Architecture
- API Routes
- WebSocket Events
- Installation & Setup
- Usage
- Environment Variables
- Contributors
- License
ApnaVideo is a modern video conferencing solution built on the MERN (MongoDB, Express, React, Node.js) stack with real-time capabilities powered by Socket.io and WebRTC. The platform enables high-quality peer-to-peer video and audio communication, real-time messaging, and meeting history tracking, all within an intuitive and responsive interface.
- Peer-to-Peer Video & Audio: Direct WebRTC connections for high-quality, low-latency communication
- Screen Sharing: Share your screen during meetings
- Live Chat Messaging: Exchange text messages in real-time during meetings
- Secure Authentication: Traditional username/password and Google OAuth integration
- Meeting History: Track and easily rejoin past meetings
- Meeting Rooms: Create or join meetings with unique meeting codes
- Custom User Identifiers: Display names for easy participant recognition
- Device Control: Toggle camera and microphone during calls
- Responsive Design: Optimized for both desktop and mobile devices
- Room Persistence: Meeting data maintained until all participants leave
The application follows a modern client-server architecture with WebRTC peer-to-peer connections:
┌───────────────┐
│ Frontend │
│ (React) │
└───────┬───────┘
│
▼
┌────────────────────────────────────────────┐
│ Backend │
│ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Express API │ │ Socket.io │ │
│ │ Endpoints │◄──────►│ Server │ │
│ └──────┬───────┘ └──────┬───────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌─────────────────────────────────────┐ │
│ │ MongoDB │ │
│ │ (Users & Meeting History) │ │
│ └─────────────────────────────────────┘ │
└────────────────────────────────────────────┘
Detailed overview
┌─────────────────────────────────────────────────────────────────────┐
│ CLIENT ARCHITECTURE │
│ │
│ ┌──────────────────────────────────────────────────────────────┐ │
│ │ React Components │ │
│ │ │ │
│ │ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐ │ │
│ │ │ Landing │ │ Video │ │ Auth │ │ History │ │ │
│ │ │ Page │ │ Meet │ │ Pages │ │ Page │ │ │
│ │ └────────────┘ └────────────┘ └────────────┘ └────────────┘ │ │
│ └────────────────────────┬─────────────────────────────────────┘ │
│ │ │
│ ┌────────────────────────▼─────────────────────────────────────┐ │
│ │ Context API │ │
│ │ │ │
│ │ ┌────────────────────────┐ ┌────────────────────────┐ │ │
│ │ │ Auth Context │ │ WebRTC Logic │ │ │
│ │ │ (User Authentication) │ │ (Media & Connections) │ │ │
│ │ └────────────────────────┘ └────────────────────────┘ │ │
│ └────────────────────────┬─────────────────────────────────────┘ │
│ │ │
│ ┌────────────────────────▼─────────────────────────────────────┐ │
│ │ Network Communication │ │
│ │ │ │
│ │ ┌────────────────────────┐ ┌────────────────────────┐ │ │
│ │ │ Axios │ │ Socket.io │ │ │
│ │ │ (HTTP Requests) │ │ (Real-time Events) │ │ │
│ │ └────────────────────────┘ └────────────────────────┘ │ │
│ └──────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
│
│
▼
┌─────────────────────────────────────────────────────────────────────┐
│ SERVER ARCHITECTURE │
│ │
│ ┌──────────────────────────────────────────────────────────────┐ │
│ │ Express Application │ │
│ │ │ │
│ │ ┌────────────────────────┐ ┌────────────────────────┐ │ │
│ │ │ REST API Routes │ │ Socket.io Server │ │ │
│ │ │ (Auth & Data) │ │ (WebRTC Signaling) │ │ │
│ │ └────────────────────────┘ └────────────────────────┘ │ │
│ └────────────────────────┬─────────────────────────────────────┘ │
│ │ │
│ ┌────────────────────────▼─────────────────────────────────────┐ │
│ │ Controllers │ │
│ │ │ │
│ │ ┌────────────────────────┐ ┌────────────────────────┐ │ │
│ │ │ User Controller │ │ Socket Manager │ │ │
│ │ │ (Authentication Logic) │ │ (Connection Handling) │ │ │
│ │ └────────────────────────┘ └────────────────────────┘ │ │
│ └────────────────────────┬─────────────────────────────────────┘ │
│ │ │
│ ┌────────────────────────▼─────────────────────────────────────┐ │
│ │ Models │ │
│ │ │ │
│ │ ┌────────────────────────┐ ┌────────────────────────┐ │ │
│ │ │ User Model │ │ Meeting Model │ │ │
│ │ │ (User Information) │ │ (Meeting History) │ │ │
│ │ └────────────────────────┘ └────────────────────────┘ │ │
│ └──────────────────────────────────────────────────────────────┘ │
│ │
│ ┌──────────────────────────────────────────────────────────────┐ │
│ │ MongoDB Database │ │
│ └──────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
┌───────────────────────────────────────────────┐
│ PEER-TO-PEER CONNECTIONS │
│ │
│ Direct WebRTC connections between clients │
│ for audio, video, and screen sharing │
│ (Server only facilitates initial signaling) │
│ │
└───────────────────────────────────────────────┘
-
Authentication:
- User credentials flow through Axios to Express routes to User Controller
- JWT tokens are generated and stored in localStorage
-
Video Meeting:
- Socket.io establishes signaling connection with server
- WebRTC negotiates peer connections through Socket.io
- Media streams flow directly between peers via WebRTC
- Chat messages are relayed through Socket.io
-
Meeting History:
- Meeting codes are saved to MongoDB when users join meetings
- History is retrieved and displayed in the History component
POST /api/v1/users/register- Register a new user with name, username, and passwordPOST /api/v1/users/login- Authenticate user with username and passwordPOST /api/v1/users/google-login- Authenticate user with Google OAuth
POST /api/v1/users/add_to_activity- Record a meeting in user's historyGET /api/v1/users/get_all_activity- Retrieve user's meeting history
join-call- Join a meeting room with optional usernameuser-joined- Notification when a new user joins with their socket ID and usernameleave-call- Leave the current meeting roomuser-left- Notification when a user disconnects
signal- Exchange SDP offers, answers, and ICE candidates for WebRTC connection setupuser-mute- Broadcast when a user mutes/unmutes their microphoneuser-video- Broadcast when a user enables/disables their camera
chat-message- Send or receive a text message in the meeting roommessage-received- Confirmation that a message was delivered
- Node.js (v16+)
- MongoDB Atlas account or local MongoDB instance
- npm or yarn package manager
# Navigate to backend directory
cd backend
# Install dependencies
npm install
# Create .env file with the following variables:
PORT=8000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
# Start development server with hot reloading
npm run dev
# For production deployment
npm start# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Create .env file with the following variables:
VITE_BACKEND_URL=http://localhost:8000 (development) or your production URL
VITE_FIREBASE_API_KEY=your_firebase_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain
VITE_FIREBASE_PROJECT_ID=your_firebase_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_firebase_storage_bucket
VITE_FIREBASE_MESSAGING_SENDER_ID=your_firebase_messaging_sender_id
VITE_FIREBASE_APP_ID=your_firebase_app_id
# Start development server with hot reloading
npm run dev
# Build for production
npm run build
# Preview production build locally
npm run preview- Register or log in to your account
- Navigate to the home page
- A unique meeting code is automatically generated
- Share this code with participants you want to invite
- Register or log in to your account
- Navigate to the home page
- Enter the meeting code in the input field
- Click "Join" to enter the meeting room
- Toggle your camera on/off with the camera button
- Mute/unmute your microphone with the mic button
- Share your screen with the screen share button
- Open the chat panel to send and receive messages
- End the call with the hang up button
- Log in to your account
- Navigate to the History page
- View a list of all your past meetings
- Click on a meeting code to rejoin that meeting
# Server configuration
PORT=8000
# MongoDB connection
MONGODB_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/<database>
# Authentication
JWT_SECRET=your_jwt_secret_for_token_generation
JWT_EXPIRES_IN=30d
# CORS settings (optional)
CORS_ORIGIN=*
# API endpoint
VITE_BACKEND_URL=http://localhost:8000 # or your production backend URL
# Firebase configuration for Google Auth
VITE_FIREBASE_API_KEY=your_firebase_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain
VITE_FIREBASE_PROJECT_ID=your_firebase_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_firebase_storage_bucket
VITE_FIREBASE_MESSAGING_SENDER_ID=your_firebase_messaging_sender_id
VITE_FIREBASE_APP_ID=your_firebase_app_id
# Environment toggle
VITE_IS_PRODUCTION=true # or false for development
- Pratham Potdar - Project Lead & Developer
This project is licensed under the ISC License.
