Skip to content

This repository contains a highly scalable ๐ŸŽฅ course platform that leverages modern ๐Ÿ”ง technologies to provide video streaming in ๐ŸŽฅ HLS format. The platform includes both an ๐Ÿ”จ admin panel for course management and a user-facing interface for consuming ๐Ÿ“ content.

Notifications You must be signed in to change notification settings

sahariardev/eduScope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

35 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“บ Video Course Platform

This repository contains a highly scalable course platform that leverages modern ๐Ÿ”ง technologies to provide video streaming in HLS format. The platform includes both an ๐Ÿ”จ admin panel for course management and a user-facing interface for consuming content.

๐Ÿ”ฌ Tech Stack

  • Frontend: Next.js
  • Backend: Nest.js
  • Storage: ๐Ÿ“ฅ Amazon S3 (for file storage)
  • Queue Service: ๐Ÿ“ข Amazon SQS (for asynchronous task management)
  • Database: ๐Ÿ“Š MySQL (for data storage and retrieval)

๐ŸŒ Features

๐Ÿ”จ Admin Panel

  • ๐Ÿ’พ Upload files in chunks using a multipart upload mechanism.
  • ๐ŸŽฎ Create and manage courses.
  • โœจ Automatic transcoding of uploaded videos to HLS format.

๐Ÿ‘ค User Interface

  • ๐Ÿ”„ Browse available courses.
  • ๐ŸŽฅ Stream in HLS format for a smooth viewing experience.

๐Ÿ”„ Backend Features

  • ๐Ÿ’พ Handles uploads to Amazon S3 using multipart upload for efficient handling of large files.
  • ๐Ÿ“ข Publishes SQS events upon successful upload.
  • โณ Listens to notifications for triggering the transcoding process.
  • โš™๏ธ Transcodes into HLS format for adaptive streaming.
  • ๐ŸŒ Scalable and fault-tolerant architecture.

๐Ÿ“Š System Architecture

  1. Frontend: The Next.js frontend allows admins to upload in chunks using multipart upload. Regular users can browse and view courses.

  2. Backend:

    • The Nest.js backend processes uploads and communicates with Amazon S3.
    • After a upload, it sends a notification to an Amazon SQS queue.
  3. SQS Worker:

    • A separate service listens to the queue for new events.
    • This worker processes the uploaded and transcodes it into multiple HLS formats for adaptive streaming.
  4. Storage:

    • ๐Ÿ“ฅ Amazon S3 is used for storing and HLS transcoded files.
  5. Database:

    • ๐Ÿ“Š MySQL is used to store information about courses and user data.

๐Ÿ”ง Installation

Prerequisites

  • ๐Ÿ› ๏ธ Node.js (โ‰ฅ 16.x)
  • ๐Ÿ“Š MySQL (โ‰ฅ 8.x)
  • ๐ŸŒ AWS account with access to S3 and SQS

Steps

  1. ๐Ÿ”„ Clone the repository:

    git clone git@github.com:sahariardev/eduScope.git
    cd eduScope
  2. ๐Ÿ”„ Install dependencies for both frontend and backend:

    cd edu-scope-backend
    npm install
    
    cd ../edu-scope-client
    npm install
  3. ๐Ÿ”ง Configure environment variables:

  • Create .env files in both frontend and backend directories.

  • Add the following variables:

    Frontend .env:

    NEXT_PUBLIC_API_URL=<backend-api-url>

    Backend .env:

    DATABASE_URL=<data_url>
    JWT_TOKEN=<jwt_sign_key>
    AWS_ACCESS_KEY_ID=<aws-access_key_id>
    AWS_SECRET_ACCESS_KEY=<aws_secret_key>
    AWS_VIDEO_UPLOAD_BUCKET=<video_upload_bucket_name>
    AWS_VIDEO_HLS_BUCKET=<hls_bucket_name>
    AWS_S3_REGION=<aws_region>
    AWS_SQS_URL=<sqs_url>
  1. ๐Ÿ”ง Set up the database:

    cd edu-scope-backend
    npm run migrate
  2. ๐Ÿ”„ Start the development servers:

    # Start backend
    cd edu-scope-backend
    npm run start:dev
    
    # Start frontend
    cd ../edu-scope-client
    npm run dev

๐Ÿš€ Deployment

Backend

  • Use ๐Ÿ› ๏ธ Docker or deploy directly to a cloud environment.
  • Ensure the .env variables are properly configured in the production environment.

Frontend

  • ๐Ÿ”„ Build the Next.js app:
    npm run build
  • Serve using a ๐Ÿ“  hosting service like Vercel or deploy on your own server.

Worker

  • Deploy the ๐Ÿ“ข SQS worker service alongside the backend or as a standalone service.
  • Ensure it has access to the ๐Ÿ“ข queue and ๐Ÿ“ฅ S3 bucket.

๐Ÿ’ก How It Works

  1. ๐ŸŽฅ Upload: Admins upload files in chunks. The frontend communicates with the backend to manage multipart uploads to S3.
  2. ๐Ÿ“ข Notification: Once the upload is complete, the backend sends an event to the SQS queue.
  3. โš™๏ธ Transcoding: The worker service picks up the event from and transcodes the into multiple HLS formats.
  4. ๐ŸŽฅ Streaming: Users stream the directly from S3 in HLS format.

๐Ÿ“š Contributing

We welcome ๐ŸŒ contributions! Please submit a pull request or open an issue for discussion.


๐ŸŒ License

This project is licensed under the MIT License.


๐Ÿ“ง Contact

For any inquiries, please contact: rifatsahariar@gmail.com

About

This repository contains a highly scalable ๐ŸŽฅ course platform that leverages modern ๐Ÿ”ง technologies to provide video streaming in ๐ŸŽฅ HLS format. The platform includes both an ๐Ÿ”จ admin panel for course management and a user-facing interface for consuming ๐Ÿ“ content.

Topics

Resources

Stars

Watchers

Forks