Videoconf is a robust, production-ready Video Conference API as a Service platform that provides seamless integration of video conferencing capabilities into JavaScript (React, Angular, etc.) and Node.js applications.
- Easy-to-use APIs and SDKs for video conferencing integration
- Support for multiple JavaScript frameworks (React, Angular, etc.)
- Node.js compatibility with TypeScript SDK
- Scalable microservice architecture with Go backend
- Real-time video and audio streaming via WebRTC
- Secure session management with JWT authentication
- Docker and Kubernetes ready for production deployment
- Load balancing with Nginx
- Health monitoring and logging
- RESTful APIs for session and user management
- Backend: Golang with Gin framework
- Database: MongoDB
- Frontend: React with TypeScript
- SDK: TypeScript/JavaScript
- WebRTC: Native browser WebRTC APIs
- Deployment: Docker, Kubernetes
- Load Balancer: Nginx
- Authentication: JWT tokens
Videoconf consists of four main components:
- Signalling Server (Go): Handles WebRTC signalling and session management
- Users Service (Go): Manages user authentication and user data
- Client SDK (TypeScript): Provides easy WebRTC integration
- Frontend Client (React): Demo web application
- MongoDB Database: Stores user and session data
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Load Balancer │ │ Users Service │ │Signalling Server│
│ (Nginx) │ │ (Port 8081) │ │ (Port 8080) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
│ └───────────────────────┘
│ │
│ ┌─────────────────┐
│ │ MongoDB │
│ │ (Port 27017) │
│ └─────────────────┘
│
┌─────────────────┐
│ Client App │
│ (React/SDK) │
└─────────────────┘
- Docker & Docker Compose (recommended)
- Go 1.22+ (for local development)
- Node.js 18+ (for local development)
- MongoDB (for local development)
-
Clone the repository:
git clone https://github.com/r3tr056/go-videoconf.git cd go-videoconf -
Start the entire stack:
docker-compose up --build
-
Access the application:
- Web Client: http://localhost
- Signalling API: http://localhost:8080
- Users API: http://localhost:8081
-
Install dependencies:
make install-deps
-
Build all services:
make build
-
Run tests:
make test -
Start development environment:
make dev
-
Setup Kubernetes cluster
-
Deploy to Kubernetes:
make deploy-k8s
-
Check deployment status:
kubectl get pods kubectl get services
npm install videoconf-sdkimport { VideoconfSDK, VideoContainer } from 'videoconf-sdk';
// Initialize SDK
const videoconf = new VideoconfSDK('your-api-key', 'project-id');
// Create a meeting
const sessionUrl = await videoconf.createSession('My Meeting', 'password123');
// Or join existing meeting
await videoconf.joinSession(sessionUrl, 'password123');
// Initialize camera and microphone
await videoconf.initializeCall();
// Handle events
videoconf.on('stream-added', (stream, peerId) => {
console.log('New participant joined:', peerId);
});
videoconf.on('stream-removed', (peerId) => {
console.log('Participant left:', peerId);
});
// Control media
videoconf.toggleVideo(false); // Turn off camera
videoconf.toggleAudio(false); // Mute microphone
// Leave meeting
await videoconf.leaveCall();import React, { useEffect, useState } from 'react';
import { VideoconfSDK, VideoGrid } from 'videoconf-sdk';
function VideoCall() {
const [sdk, setSdk] = useState(null);
const [localStream, setLocalStream] = useState(null);
const [remoteStreams, setRemoteStreams] = useState(new Map());
useEffect(() => {
const videoconf = new VideoconfSDK('api-key', 'project-id');
videoconf.on('local-stream', setLocalStream);
videoconf.on('remote-stream', (stream, peerId) => {
setRemoteStreams(prev => new Map(prev).set(peerId, stream));
});
setSdk(videoconf);
}, []);
return (
<VideoGrid
streams={remoteStreams}
localStream={localStream}
/>
);
}Create Session:
POST /session
Content-Type: application/json
{
"host": "user-id",
"title": "Meeting Title",
"password": "meeting-password"
}Join Session:
POST /connect/{sessionUrl}
Content-Type: application/json
{
"password": "meeting-password"
}WebSocket Connection:
ws://localhost:8080/ws/{socketUrl}
See API_DOCUMENTATION.md for complete API reference.
# Run all tests
make test
# Run specific service tests
cd server/signalling-server && go test -v
cd server/users-service && go test -vAll services provide health check endpoints:
- Signalling Server:
GET /health - Users Service:
GET /health - Load Balancer:
GET /(proxies to services)
# Check all services
make check-healthView logs:
docker-compose logs -fAccess individual services:
# Signalling server logs
docker-compose logs signalling-server
# Users service logs
docker-compose logs users-service
# Client logs
docker-compose logs videoconf-clientSignalling Server:
PORT: Server port (default: 8080)DB_URL: MongoDB hostDB_PORT: MongoDB portDB_USERNAME: MongoDB usernameDB_PASSWORD: MongoDB password
Users Service:
PORT: Server port (default: 8081)DB_HOST: MongoDB hostDB_NAME: Database nameJWT_SECRET: JWT signing secret
- JWT authentication for users
- Session password hashing
- CORS configuration
- WebSocket origin validation
- Environment-based secrets
- Horizontal scaling via Kubernetes
- Load balancing with Nginx
- Stateless service design
- MongoDB replication for HA
Available Make commands:
make help # Show all available commands
make build # Build all services
make test # Run tests
make clean # Clean build artifacts
make dev # Start development environment
make docker-up # Start with Docker
make deploy-k8s # Deploy to Kubernetes
make lint # Run linters
make format # Format code- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- 📧 Email: support@ankurdebnath.me
- 🐛 Issues: GitHub Issues
- 📖 Documentation: API Docs
Made with ❤️ by Ankur Debnath