Connectify is a Zoom-like video conferencing application that allows users to create accounts, join video calls, and maintain a history of their meetings. The application uses WebRTC for peer-to-peer video communication and Socket.IO for real-time signaling.
- Architecture
- Technology Stack
- Folder Structure
- Features
- Installation
- Usage
- API Endpoints
- Database Schema
- Code Documentation
- Diagrams
Connectify follows a client-server architecture with real-time communication capabilities:
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Frontend │◄────────┤ Socket.IO │◄────────┤ Backend │
│ (React) │ │ Signaling │ │ (Node.js) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ WebRTC │◄────────┤ WebRTC │◄────────┤ WebRTC │
│ (Peer 1) │ │ Signaling │ │ (Peer 2) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
- Frontend (React): User interface for authentication, video calling, and meeting history
- Backend (Node.js/Express): REST API for user management and Socket.IO server for WebRTC signaling
- Database (MongoDB): Storage for user accounts and meeting history
- WebRTC: Peer-to-peer video/audio communication between clients
- Socket.IO: Real-time signaling for WebRTC connection establishment
- React.js (v18+)
- React Router v6+
- Material-UI (MUI) for UI components
- Socket.IO Client for real-time communication
- Axios for HTTP requests
- WebRTC for video/audio streaming
- Node.js (v18+)
- Express.js (v5+)
- Socket.IO for real-time communication
- MongoDB with Mongoose for database
- Bcrypt for password hashing
- Crypto for token generation
- MongoDB Atlas (Cloud)
.
├── backend/
│ ├── src/
│ │ ├── controllers/
│ │ │ ├── socketManager.js # WebRTC signaling logic
│ │ │ └── user.controller.js # User authentication and history
│ │ ├── models/
│ │ │ ├── meeting.model.js # Meeting schema
│ │ │ └── user.model.js # User schema
│ │ ├── routes/
│ │ │ └── users.routes.js # User API routes
│ │ └── app.js # Express app configuration
│ ├── .env # Environment variables
│ ├── package.json # Backend dependencies
│ └── package-lock.json
└── frontend/
├── public/ # Static assets
├── src/
│ ├── contexts/ # React context for authentication
│ │ └── AuthContext.jsx
│ ├── pages/ # Application pages
│ │ ├── VideoMeet.jsx # Video call interface
│ │ ├── authentication.jsx # Login/registration
│ │ ├── history.jsx # Meeting history
│ │ ├── home.jsx # Home/dashboard
│ │ └── landing.jsx # Landing page
│ ├── styles/ # CSS modules and styles
│ ├── utils/ # Utility functions
│ │ └── withAuth.jsx # Authentication HOC
│ ├── App.js # Main application component
│ ├── enviroment.js # Environment configuration
│ └── index.js # Application entry point
├── package.json # Frontend dependencies
└── package-lock.json
-
User Authentication
- User registration with name, username, and password
- User login with token-based authentication
- Logout functionality
-
Video Conferencing
- Real-time video and audio communication using WebRTC
- Multi-party video calls
- Toggle video on/off
- Toggle audio on/off
- Screen sharing capability
- In-call chat functionality
-
Meeting Management
- Unique meeting codes for each session
- Meeting history tracking
- Join meetings via meeting code
-
User Interface
- Responsive design
- Intuitive navigation
- Dark theme interface
- Material-UI components
- Node.js (v18 or higher)
- MongoDB Atlas account
- npm or yarn package manager
-
Navigate to the backend directory:
cd backend -
Install dependencies:
npm install
-
Update the MongoDB connection string in app.js:
const connectionDb = await mongoose.connect("YOUR_MONGODB_CONNECTION_STRING");
-
Start the backend server:
npm run dev
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Update the environment configuration in enviroment.js if needed:
let IS_PROD=false; const servers=IS_PROD ? "https://your-production-url.com" : "http://localhost:8000";
-
Start the frontend development server:
npm start
-
Access the Application
- Open your browser and navigate to
http://localhost:3000
- Open your browser and navigate to
-
Registration
- Click on "Register" on the landing page
- Fill in your name, username, and password
- Submit the registration form
-
Login
- Click on "Login" on the landing page
- Enter your username and password
- Submit the login form
-
Join or Create a Meeting
- On the home page, enter a meeting code to join an existing meeting
- Or navigate to any URL (e.g.,
/abcd1234) to create a new meeting
-
Video Call Controls
- Toggle video on/off with the camera icon
- Toggle audio on/off with the microphone icon
- Share screen with the screen share icon
- End call with the red phone icon
- Open chat with the chat icon
-
View Meeting History
- Click on the history icon in the navigation bar
- View all previous meetings with dates
POST /api/v1/users/register
Request Body:
{
"name": "string",
"username": "string",
"password": "string"
}Response:
{
"message": "User registered successfully"
}POST /api/v1/users/login
Request Body:
{
"username": "string",
"password": "string"
}Response:
{
"token": "string"
}POST /api/v1/users/add_to_activity
Request Body:
{
"token": "string",
"meeting_code": "string"
}Response:
{
"message": "Added code to history"
}GET /api/v1/users/get_all_activity?token=string
Response:
[
{
"user_id": "string",
"meetingCode": "string",
"date": "date"
}
]{
name: { type: String, required: true },
username: { type: String, required: true, unique: true },
password: { type: String, required: true },
token: { type: String }
}{
user_id: { type: String },
meetingCode: { type: String, required: true },
date: { type: Date, default: Date.now }
}The main Express application file that sets up the server, connects to MongoDB, and configures middleware.
Handles WebRTC signaling using Socket.IO. Manages user connections, message passing, and call coordination.
Key functions:
join-call: Handles users joining a callsignal: Manages WebRTC signaling messageschat-message: Handles in-call chat messagesdisconnect: Manages user disconnection
Handles user authentication and meeting history.
Functions:
login: Authenticates users and generates tokensregister: Creates new user accountsgetUserHistory: Retrieves user's meeting historyaddToHistory: Adds meetings to user's history
Defines the API routes for user-related operations.
Main application component that sets up routing for all pages.
Core video conferencing component that handles WebRTC connections, media streams, and call controls.
Key features:
- Media stream management
- WebRTC peer connection handling
- Call controls (video, audio, screen share)
- In-call chat functionality
React context for managing user authentication state and API calls.
User authentication interface with login and registration forms.
User dashboard for joining meetings and accessing history.
Displays user's meeting history with dates.
Landing page with application introduction and navigation to authentication.
graph TD
A[Frontend - React] --> B[Backend - Node.js/Express]
B --> C[MongoDB]
A --> D[WebRTC Peer Connections]
B --> E[Socket.IO Signaling]
D --> A
E --> A
E --> B
graph TD
A[Landing Page] --> B{Authenticated?}
B -->|No| C[Authentication Page]
C --> D[Login/Register]
D --> E[Home Page]
B -->|Yes| E
E --> F{Join or Create Meeting}
F --> G[Video Call Page]
G --> H[WebRTC Connection]
E --> I[History Page]
I --> J[View Past Meetings]
sequenceDiagram
participant User1
participant Server
participant User2
User1->>Server: Join Call
Server->>User1: User Joined (with client list)
User2->>Server: Join Call
Server->>User1: New User Joined
Server->>User2: User Joined (with client list)
User1->>Server: Signal (Offer)
Server->>User2: Signal (Offer)
User2->>Server: Signal (Answer)
Server->>User1: Signal (Answer)
loop ICE Candidates
User1->>Server: Signal (ICE Candidate)
Server->>User2: Signal (ICE Candidate)
User2->>Server: Signal (ICE Candidate)
Server->>User1: Signal (ICE Candidate)
end
-
Start the backend server:
cd backend npm run dev -
Start the frontend development server:
cd frontend npm start
-
Build the frontend:
cd frontend npm run build -
The built files will be in the
builddirectory, ready for deployment.
The application can be deployed to any platform that supports Node.js and React applications:
- Render
- Heroku
- AWS
- Google Cloud Platform
- DigitalOcean
Remember to update the environment variables and connection strings for production deployment.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a pull request