A simple, personal-use voice and video calling application built with WebRTC. Users can create a room and share a link for instant, browser-based communication without authentication.
The application follows a client-server model with a signaling mechanism to establish Peer-to-Peer (P2P) connections.
graph TD
UserA[User A - Browser] <--> Server[Express Server + WebSocket Signaling]
UserB[User B - Browser] <--> Server
UserA -- WebRTC P2P (Audio/Video) --- UserB
Server <--> DB[(PostgreSQL)]
- Frontend (React + Vite): Handles the user interface, media device access (Camera/Mic), and WebRTC state management.
- Backend (Node.js + Express): Provides REST API for room management and hosts the WebSocket signaling server.
- Signaling Server (WebSocket): Facilitates the exchange of "handshake" information (SDP offers/answers and ICE candidates) between peers.
- Database (PostgreSQL): Stores room metadata for session persistence.
- WebRTC: Enables direct media streaming between browsers once the handshake is complete.
sequenceDiagram
participant A as User A (Initiator)
participant S as Signaling Server
participant B as User B (Joiner)
Note over A,B: Signaling via WebSocket
A->>S: Create Room / Join Room
B->>S: Join Room (via shared link)
S->>A: peer-joined
A->>A: Create WebRTC Offer
A->>S: send offer (SDP)
S->>B: forward offer
B->>B: Create WebRTC Answer
B->>S: send answer (SDP)
S->>A: forward answer
Note over A,B: ICE Candidate Exchange
A->>S: send ice-candidate
S->>B: forward candidate
B->>S: send ice-candidate
S->>A: forward candidate
Note over A,B: P2P Connection Established
A-->>B: Direct Video/Audio Stream
- Node.js: v18 or higher.
- PostgreSQL: A running instance (or use a local SQLite/Mock if modified).
- HTTPS: WebRTC requires a secure context. For local testing,
localhostworks, but for network access, you need SSL certificates.
- Clone the repository:
git clone <your-repo-url> cd <repo-name>
- Install Dependencies:
npm install
- Environment Variables:
Create a
.envfile in the root:DATABASE_URL=postgres://user:password@localhost:5432/dbname
- Database Push:
npm run db:push
- Run Development:
Access at
npm run dev
http://localhost:5000.
- Install Node.js & Postgres:
sudo apt update sudo apt install nodejs npm postgresql
- Setup Database:
sudo -u postgres psql -c "CREATE DATABASE vido_call;" - Deploy: Follow the same steps as Windows.
- Internet Access (Important):
- To use this over the internet, you must use a tool like Cloudflare Tunnel or Nginx with Let's Encrypt to provide an
https://URL. - WebRTC will fail on mobile devices if served over plain
http://.
- To use this over the internet, you must use a tool like Cloudflare Tunnel or Nginx with Let's Encrypt to provide an
- Frontend: React, Tailwind CSS, Framer Motion, Lucide Icons.
- Backend: Node.js, Express,
ws(WebSockets). - Database: Drizzle ORM + PostgreSQL.
- Real-time: WebRTC (Native Browser API) + Google STUN servers.