Skip to content

Real-time video broadcasting backend built with Django and WebRTC. Implements WebSocket signaling with Django Channels and supports unique stream IDs for live video streams. Designed for containerized deployment with Docker and seamless integration with a React frontend.

Notifications You must be signed in to change notification settings

dharshan-kumarj/WebCamBroadcast_Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎥 Django WebRTC Broadcasting Application

A real-time video broadcasting application built with Django and WebRTC. This application allows users to create WebRTC broadcasts and share them with viewers through unique stream IDs.

👉 Frontend Repo: WebCamBroadcast_Frontend


🌟 Features

  • Real-time video broadcasting using WebRTC
  • WebSocket-based signaling server built with Django Channels
  • Unique stream IDs for each broadcast
  • Dedicated broadcaster and viewer interfaces
  • Containerized deployment with Docker

🔧 Prerequisites

  • Docker

🚀 Installation with Docker (Recommended)

  1. Clone the repository

    git clone <repository-url>
    cd <project-directory>
    
    
  2. Build the Docker image

    sudo docker build -t django-webrtc-app .
  3. Run the container

    sudo docker run -p 8000:8000 django-webrtc-app

🧪 Usage

After starting the application, you can access:

Make sure to also run the frontend alongside this backend. The frontend handles the WebRTC media stream, UI, and player logic.


🔁 WebRTC Signaling Flow

  1. Broadcaster creates a stream with a unique ID
  2. Viewers connect to the stream using that ID
  3. WebSocket connections established through /ws/webrtc/<stream_id>/
  4. WebRTC signaling messages (offers, answers, ICE candidates) exchanged via WebSockets
  5. Peer-to-peer connection established between broadcaster and viewers

⚙️ Production Considerations

  • Replace InMemoryChannelLayer with Redis for Channels
  • Set DEBUG=False in settings.py
  • Use secure secret key management
  • Enable HTTPS (required for WebRTC in production)
  • Add authentication and rate limiting for broadcasters/viewers

🐳 Docker Configuration

The included Dockerfile:

  • Uses Alpine Linux for minimal image size
  • Implements multi-stage build
  • Runs as a non-root user
  • Exposes port 8000 for the Daphne ASGI server

📂 Related Repositories

🔗 Frontend (React-based): WebCamBroadcast_Frontend


About

Real-time video broadcasting backend built with Django and WebRTC. Implements WebSocket signaling with Django Channels and supports unique stream IDs for live video streams. Designed for containerized deployment with Docker and seamless integration with a React frontend.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published