This is a full-stack, real-time video and audio chat application built with modern web technologies. It allows multiple users to join a room and communicate via peer-to-peer connections, facilitated by a central signaling server.
A live version of the application is deployed here: https://krishan-video-call-app.netlify.app
- Real-Time Communication: High-quality, low-latency video and audio streaming using WebRTC.
- Room-Based System: Users can create new, unique rooms or join existing ones using a room ID or a direct link.
- Dynamic Video Grid: The layout automatically adjusts to the number of participants in the call for an optimal viewing experience.
- Media Controls: Users can mute/unmute their microphone and enable/disable their camera at any time.
- Active Speaker Detection: The participant who is currently speaking is highlighted with a visual indicator.
- Connection Status: A clear indicator shows the current connection status to the signaling server.
- Video-Off Avatars: When a user's video is turned off, an avatar is displayed with their status.
- Responsive Design: The UI is fully responsive and works seamlessly on both desktop and mobile devices.
The project is a monorepo divided into a Client (frontend) and a Server (backend).
- Framework: React 19
- Build Tool: Vite
- Routing: React Router
- Real-Time Engine: Socket.IO Client
- Icons: Lucide React
- Unique IDs: UUID
- Runtime: Node.js
- Framework: Express.js
- Real-Time Engine: Socket.IO
- CORS: node-cors
- Environment Variables: dotenv
- Development: Nodemon
Video-Call-Application/
├── Client/
│ ├── public/
│ ├── src/
│ │ ├── Pages/
│ │ │ ├── LandingPage.jsx
│ │ │ ├── Room.css
│ │ │ └── Room.jsx
│ │ ├── App.jsx
│ │ └── main.jsx
│ ├── .env
│ ├── netlify.toml
│ ├── package.json
│ └── vite.config.js
│
└── Server/
├── .env
├── package.json
├── server.js
└── socket.js
Follow these instructions to set up and run the project on your local machine.
-
Clone the repository:
git clone https://github.com/krishangoyal12/Video-Chat-Application cd Video-Call-Application -
Set up the Backend Server:
cd Server npm installCreate a
.envfile in theServerdirectory and add the following variables:# Server port PORT=8000 # The URL of your running frontend client FRONTEND_URL=http://localhost:5173
Now, start the server:
npm startThe server should now be running at
http://localhost:8000. -
Set up the Frontend Client: Open a new terminal window.
cd Client npm installCreate a
.envfile in theClientdirectory and add the following:# The URL of your running backend server VITE_BACKEND_URL=http://localhost:8000
Now, start the client development server:
npm run dev
The application should now be running at
http://localhost:5173.
The application leverages WebRTC for peer-to-peer media streaming, with a Node.js server acting as a signaling server to coordinate connections.
- Joining a Room: When a user joins a room, the client connects to the Socket.IO server and emits a
join-roomevent. - Signaling: The server adds the user to a room and notifies them of existing participants. For each existing participant, a new
RTCPeerConnectionis created. - Peer Connection: The new user exchanges signaling messages (SDP offers/answers and ICE candidates) with other users in the room via the Socket.IO server. This process, known as the "handshake," establishes a direct peer-to-peer connection.
- Media Streaming: Once the connection is established, video and audio data are streamed directly between the users' browsers, minimizing latency and server load.
- Disconnection: When a user leaves, a
disconnectevent is fired, and the server notifies all other room participants to close the corresponding peer connection.
- Client: The frontend is deployed on Netlify.
- Server: The backend server is deployed to Render.