The Video Chat Module is a reusable, TypeScript-based video-chat solution designed to seamlessly integrate real-time video, audio, and chat features into modern web applications.
A Next.js Frontend with server-side rendering and dynamic routing, featuring customizable React components for video calls, chat widgets, and user presence indicators.
A Node.js Signaling Server powered by Socket.io for reliable WebRTC negotiation, handling SDP offers/answers, ICE candidate exchanges, TURN/STUN fallback, and real time chat message updates.
A Chat & Data Service Layer exposing RESTful endpoints and services for message persistence, history retrieval, and real-time presence updates.
A PWA Infrastructure using service workers, workbox, and manifest.json to provide a Progressive Web App experience with installable app capabilities.
A Utility & Integration Layer providing authentication strategies, network status hooks, notification handlers for real-time alerts and background notifications when users are not on the chat tab using FCM, and TURN/STUN server configuration for extensibility.
The Video Chat Module operates through a structured flow that handles authentication, real-time communication, and notifications:
Users authenticate through view available rooms and contacts.
Upon dashboard load, the application establishes a WebSocket connection to the signaling server and initializes Socket.io and WebRTC peer instances for real-time communication.
Users can join specific chat rooms where they access message history, send text messages, share files, and initiate video/audio calls with other participants. Some more features are available for both one-to-one and group chats.
When users calls peer using unique peer IDs, the signaling server facilitates the exchange of SDP offers/answers and ICE candidates through WebSocket events to establish peer connections.
After successful signaling negotiation, a direct WebRTC connection is established between peers, enabling high-quality audio and video streaming without server intermediation.
Text messages, typing indicators, new message with global notification and user presence updates are transmitted through the WebSocket channel, with message persistence handled via REST API endpoints for chat history.
The site can be installed as a natice app, aith app capibilaties
React components dynamically render video streams, chat interfaces, and control panels in a responsive layout that adapts to different screen sizes and devices.
Key Benefits
Peer-to-peer audio and video calls via WebRTC with high-quality streaming
Comprehensive call logs tracking different call scenarios, in-call controls within the call room, and proper call disconnection handling
Scroll to view older message history, search functionality with highlighted search terms, paginated message loading
Dedicated chat room media gallery for shared files and images
Service worker implementation for app-like experience
FCM(Firebase Cloud Messaging) notifications for incoming calls and messages
Configurable TURN/STUN server management for reliable connectivity
Shadcn Library UI components with tailwind css. Modular components that are reusable, and an efficient rendering
Tailwind CSS-powered responsive UI adapting to various screensizes and devices
Next.js (version 15.3), React (version 19.0)
TypeScript
Tailwind CSS, PostCSS, Shadcn UI library
WebRTC, WebSocket (Socket.io), PeerJS
Axios, React Query
Service Workers, Workbox, manifest.json
Laravel (version 10.0)
PHP (version 8.1)
Node.js with Socket.io
WebSocket, Socket.io for WebRTC signaling using Node.js
RESTful APIs for data persistence and chat services
FCM(version 3.0)