Skip to content

An affordable, scalable video transcoding and streaming service (fullstack)

Notifications You must be signed in to change notification settings

amankumarsingh77/StreamScale

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Project Banner
nextdotjs typescript tailwindcss nodejs aws mongodb

StreamScale

A simple and scalable OpenSource video transcoding and streaming service.
  1. Introduction
  2. Tech Stack
  3. Features
  4. Quick Start
  5. Cloud Setup
  6. Pricing
  7. Connect With Me

StreamScale is an open-source tool designed to simplify the process of transcoding and streaming videos. Whether you're looking to convert video files into different formats or stream them seamlessly across various devices, StreamScale provides a robust solution. Built with NodeJS (API,Worker), NextJS (frontend), it offers scalability and efficiency, making it ideal for developers and organizations needing reliable video processing capabilities.

architecture diagram

  • Next.js
  • MongoDB
  • AWS
  • Typescript
  • TailwindCSS
  • ShadCN
  • NodeJS

👉 Register: Users can sign up to get access to the dashboard.

👉 Upload Video Files: Users can upload videos that will then be transcoded.

👉 Update Profile: Users can update their profile details.

👉 User Authorization: As transcoding a video is a costly process only a few people are allowed to use the app as of now (Will shift to subscription-based soon).

👉 File Upload Using AWS S3: Users can upload the video files which will initially stored on AWS S3.

👉 Transcode A Video: A transcoding task starts as soon as a user uploads the video and does all the required processes to make it work.

👉 Dashboard: Authorized users can upload and view the details (name, status, size) of the videos.

👉 Video Player: After the video is transcoded the user can play the videos in the browser itself.

New features will added in future

Follow these steps to set up the project locally on your machine.

Prerequisites

Make sure you have the following installed on your machine:

Here are some prerequisites that are required to run this project:

  • AWS account.
  • Cloudflare Account with updated billing information (You can skip this if you want to use s3 as your primary storage).
  • MongoDB and a Redis database URL (Ignore if deploying locally).

Cloning the Repository

git clone https://github.com/amankumarsingh77/StreamScale.git
cd StreamScale

Installation

Install the project dependencies using npm:

Client

cd client
npm install

Server

cd client
npm install

Worker

cd client
npm install

Set Up Environment Variables

Create a new file named .env.local in the root of your project and add the following content:

#aws credentials 

  AWS_ACCESS_KEY_ID=
  AWS_SECRET_ACCESS_KEY=
  AWS_REGION=
  AWS_CLUSTER_ARN=
  AWS_TASK_ARN=
  AWS_QUEUE_URL=
  SUBNET1=
  SUBNET2=
  SUBNET3=
  SECURITY_GROUP_ID=
  AWS_S3_BUCKET=

  #cloudflare r2 credentials

  R2_BUCKET=
  R2_REGION=
  R2_ACCESS_KEY_ID=
  R2_SECRET_ACCESS_KEY=
  R2_ENDPOINT=
  CLOUDFLARE_PUBLIC_BASE_URL=

  #redis credentials

  UPSTASH_REDIS_URL=
  UPSTASH_REDIS_TOKEN=
  
  #mongodb credentials

  MONGO_URI=

  #others

  MAX_RUNNING_TASKS=
  SECRET_KEY=

Replace the placeholder values with your actual credentials.

Running the Project

Client

npm run dev

Server

node server.js

Client

npm run dev

Open http://localhost:3000 in your browser to view the project.

AWS

Upload the AWS Cloudformation template:

  • Make sure to have your AWS account registered, up and running here
  • Download the cloudformation.yml file from here
  • Visit AWS CloudFormation service.
  • Click on the Create Stack button.
  • On the Create Stack page, select Upload a template file.
  • Choose the cloudformation.yml file you downloaded earlier, and click on Next.
  • Once the stack creation is complete click on the output tab to get all the aws required credentials and copy them into your .env file.

Cloudflare R2

Create a R2 bucket:

  • Navigate to R2 section
  • Click on "Create Bucket"
  • Fill the basic details as per your requirements and click on "Create Bucket" button.

Configure R2:

  • R2 dev domain is used to serve the static files. But it is disabled by default.
  • You can enable it by going to settings tab of the bucket and clicking on the "Allow Access" (Not recommended. Learn more).
  • You can attach your own domain. learn more

Connect With Me

Q) Want to chat or need assistance with setting up a project?

A) You can connect with me on X and Gmail

About

An affordable, scalable video transcoding and streaming service (fullstack)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published