Skip to content

ayan-de/Fermion-assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Fermion Assignment - Real-time Video Streaming Application

A sophisticated real-time video streaming application built with WebRTC, MediaSoup, and HLS transcoding.

πŸš€ Features

  • Real-time Video Streaming: Stream your camera/microphone using WebRTC
  • Multi-user Support: Multiple users can connect and see each other's streams
  • HLS Transcoding: Automatic conversion of WebRTC streams to HLS format
  • Modern UI: Clean, responsive interface built with Next.js and Tailwind CSS
  • Cross-platform Compatibility: Works on desktop and mobile browsers

πŸ—οΈ Architecture

  • Frontend: Next.js 15 with React 19, TypeScript, and Tailwind CSS
  • Backend: Node.js with Express, Socket.IO, and MediaSoup
  • Real-time Communication: WebRTC via MediaSoup
  • Video Processing: FFmpeg for HLS (HTTP Live Streaming) transcoding

πŸ“ Project Structure

Fermion-assignment/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ client/          # Next.js frontend application
β”‚   β”‚   β”œβ”€β”€ src/app/
β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx        # Main landing page
β”‚   β”‚   β”‚   β”œβ”€β”€ stream/page.tsx # Video streaming interface
β”‚   β”‚   β”‚   └── watch/page.tsx  # HLS stream watching interface
β”‚   β”‚   └── package.json
β”‚   └── server/          # Node.js backend application
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ index.ts           # Main server entry point
β”‚       β”‚   β”œβ”€β”€ mediasoupServer.ts # MediaSoup WebRTC logic
β”‚       β”‚   └── ffmpeg.ts          # FFmpeg HLS transcoding
β”‚       └── package.json

πŸ› οΈ Prerequisites

  • Node.js 18+
  • FFmpeg (for HLS transcoding)
  • Modern browser with WebRTC support

πŸš€ Quick Start

1. Install Dependencies

# Install backend dependencies
cd apps/server
npm install

# Install frontend dependencies
cd ../client
npm install

2. Start the Services

# Start the backend server (in one terminal)
cd apps/server
npm run start

# Start the frontend (in another terminal)
cd apps/client
npm run dev

3. Access the Application

πŸ“– How to Use

Streaming (WebRTC)

  1. Open http://localhost:3000 in your browser
  2. Click the "Stream" button
  3. Allow camera and microphone access when prompted
  4. Your video stream will be displayed locally
  5. Other users can see your stream in real-time

Watching HLS Streams

  1. Open http://localhost:3000/watch in your browser
  2. Click "Refresh Streams" or "Refresh Page" to see available streams
  3. Click on any stream in the list to start watching
  4. The stream will play using HLS.js for optimal compatibility

Multi-user Testing

  1. Open multiple browser windows or incognito tabs
  2. Navigate to http://localhost:3000/stream in each
  3. Allow camera access in each window
  4. Each user will see their own stream and other users' streams
  5. Check the watch page to see HLS versions of the streams

πŸ“„ License

This project is part of the Fermion assignment.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages