- 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.
