LiveCollab is a web application designed to facilitate real-time video chats, built with Django as the backend framework. It leverages the Agora Real-Time Voice and Video Engagement SDK to deliver high-quality video and voice communication. LiveCollab provides users with a smooth and interactive experience, making it an ideal platform for both personal and professional video calls.
- Real-Time Video & Voice: High-quality, low-latency video and voice communication powered by Agora's SDK.
- User-Friendly Interface: Intuitive and responsive UI for seamless navigation and usage.
- Secure & Private: Ensures user data privacy and secure video sessions.
- Cross-Platform: Accessible on both desktop and mobile devices.
- Group Video Chat: Support for multi-user video calls.
- Backend: Django (Python)
- Frontend: HTML, CSS, JavaScript
- Real-Time Communication: Agora Real-Time Voice and Video Engagement SDK
- Database: PostgreSQL (production), SQLite (fallback)
- Deployment: Render
This project demonstrates the integration of modern web technologies with real-time communication solutions, offering a flexible and reliable platform for video engagement.
-
Ensure
pipis installed on your device. The latest version can be installed and upgraded by using the command:py -m pip install --upgrade pip
-
Python uses
venvas the preferred module to create and manage virtual environments.venvis included in the Python standard library and does not require any additional installation. You can create a virtual environment in the specific project directory by running the command:py -m venv env
(Here,
envis the name assigned to the virtual environment, and you can use any name you wish.) -
Activate the virtual environment:
You need to activate the virtual environment. This will put the virtual environment-specific Python andpipexecutables into your shell’s PATH. You can do this by running the command:.\env\Scripts\activate
If an error occurs, you can resolve it temporarily by running:
Set-ExecutionPolicy RemoteSigned -Scope Process
To remove the error permanently, run:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
-
Exit the virtual environment:
You can exit the virtual environment by running the command:deactivate
-
To install Django, use the command in the terminal:
pip install django
To check the version of Django, run:
python -m django --version
-
To create a project in Django, use:
django-admin startproject demoproject
(Here,
demoprojectis the name of the project, and you can use any name you wish.)To create the project in the current working directory (avoiding subdirectories with the same name), run:
django-admin startproject demoproject .Use
CTRL + Cto stop the server, and then deactivate the virtual environment.
-
The
startappcommand option of themanage.pyscript creates a default folder structure for the app of that name. Here’s how to create ademoappin thedemoprojectfolder:python manage.py startapp demoapp
-
To run and view your Django app in the browser, execute the following commands in the terminal:
-
To run the server (if there is more than one Django project):
django-admin runserver
-
To run the server (if there is only one Django project):
python manage.py runserver
-
To compile the migrations:
python manage.py makemigrations
-
To migrate the changes in the database:
python manage.py migrate
-
The startproject template installs some Django apps by default, such as admin, auth, and sessions. You need to create the necessary database tables for these apps. Run the migrate command to build their respective table structure in the current MySQL database:
python manage.py migrate- The credentials below will only work when using the SQLite database included in this repository.
Username: admin
Password: admin123- Visit Agora.io and sign up for a free account.
- After logging in, create a new project in the Agora Console.
- Note your App ID and App Certificate from the project settings. These are essential for authenticating your application with Agora services.
- Go to the Agora SDK Downloads page.
- Choose the Video SDK for Web and download it.
- Extract the SDK files and add them to your project's static files folder. This will allow you to use the Agora functionalities in your web application.
- To manage token generation, install the
agora-token-builderpackage using:
pip install agora-token-buildergit clone https://github.com/SumithShetty1/livecollab.gitTo install the necessary dependencies for the project, navigate to the project directory and run the following command:
cd livecollab
pip install -r requirements.txtTo use this project, you'll need to update the Agora credentials in views.py and streams.js.
-
Create an Account:
- Go to agora.io and create an account.
- Create a new app and copy your App ID and App Certificate.
-
Update Files:
- In
views.py, replace the placeholders with your Agora credentials:
def getToken(request): appId = "YOUR APP ID" appCertificate = "YOUR APP CERTIFICATE" ...
- In
streams.js, update the App ID by replacing the placeholder with your actual Agora App ID. Locate the following line:
const APP_ID = 'YOUR APP ID'; ...
- In
To start the Django server, navigate to your project directory and run the following command:
python manage.py runserverThis guide explains the configuration differences between local development and deployment environments for your Django project.
In your settings.py file, use these settings for local development:
# settings.py
SECRET_KEY = 'django-insecure-^yycd4l+rk4jdxp+p3nu98^k-8$*74r&eomge^*&kchb^y9hg_'
DEBUG = True
ALLOWED_HOSTS = []
# Static Files Configuration
STATIC_URL = '/static/'
STATICFILES_DIRS = [
BASE_DIR / 'static'
]This configuration:
- Uses a hard-coded SECRET_KEY (only for development)
- Enables debug mode for detailed error pages
- Allows access from localhost only
- Sets up basic static file handling
First, install the necessary packages:
pip install gunicorn # Production-grade WSGI server
pip install whitenoise # Static file serving
pip freeze > requirements.txt # Save dependenciesUpdate your settings.py for deployment:
# settings.py
import os
# Security Settings
SECRET_KEY = os.environ.get('SECRET_KEY') # Get from environment variable
DEBUG = os.environ.get('DEBUG', 'False') == 'True' # Default to False
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', '').split(' ')
# Middleware Configuration
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware', # Add WhiteNoise
# ... other middleware ...
]
# Static Files Configuration
STATIC_URL = '/static/'
STATICFILES_DIRS = [
BASE_DIR / 'static'
]
# Production Static Files Settings
if not DEBUG:
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'This configuration:
- Retrieves sensitive settings from environment variables
- Disables debug mode by default
- Configures allowed hosts from environment variables
- Sets up WhiteNoise for efficient static file serving
- Configures static file compression and long-term caching
Make sure to set these environment variables on your deployment server:
SECRET_KEY=your-secure-secret-key
DEBUG=False
ALLOWED_HOSTS=yourdomain.com subdomain.yourdomain.comBefore deploying:
- Generate a new secure SECRET_KEY
- Set DEBUG to False
- Configure ALLOWED_HOSTS properly
- Run
python manage.py collectstatic - Ensure all requirements are in requirements.txt
- Configure your web server (e.g., Gunicorn) properly
The production setup:
- Uses WhiteNoise to serve static files efficiently
- Compresses static files automatically
- Adds unique hashes to filenames for cache busting
- Creates a 'staticfiles' directory when DEBUG is False
If static files aren't loading in production:
- Verify STATIC_ROOT is set correctly
- Ensure you've run
python manage.py collectstatic - Check that WhiteNoise middleware is in the correct order
- Verify your web server configuration
If environment variables aren't working:
- Double-check your environment variable syntax
- Verify they're properly set in your deployment platform
- Restart your application server after changing environment variables
This project is a personal/portfolio project created for educational and demonstration purposes. It is not affiliated with or endorsed by any existing company or product that may share a similar name.