Tutorials

Make Youtube Video Streaming Clone Using MERN Stack & FFmpeg

In this tutorial, you will learn how to make a video streaming website that lets you upload and view videos, like/dislike them, and comment on others (just like YouTube). This Youtube Video Streaming Clone is built using the MERN stack (MongoDB, ExpressJS, ReactJS, NodeJS) and FFmpeg.

A download button is given at the end of this tutorial from where you can download the full source code of Youtube Video Streaming Clone project.

Installation

  1. Clone this repository
$ git clone https://github.com/asarj/PressPlay.git
  1. Navigate to the server/config directory
$ cd server/config
  1. Create a dev.js file
$ touch dev.js
  1. In the dev.js file, you will need to specify the URI to your MongoDB database.
    1. This can be obtained by logging into your MongoDB account and heading to your database cluster. From here, the URI can be found at:
      Clusters > Command Line Tools > Connect To Your Cluster > Connect Instructions > Connect your application (Make sure that Node.js is the selected driver and 3.0 or later is the selected version.)
    2. Once you’ve navigated to the correct page that has your MongoDB URI, the connection string should look something like this:
      mongodb+srv://<username>:<password>@cluster0-jl7lm.mongodb.net/test?retryWrites
      where <username> is the username to your cluster account and <password> is the corresponding password to your account
    3. Copy this string and navigate back to dev.js, where you will paste the following code:
    module.exports = { mongoURI: ‘<insert MongoURI here>’ }where <insert MongoURI here> is the connection string you found in step 4.2. You can also look at dev-example.js for a sample as to what it should look like
  2. Save the dev.js file
  3. Install the server dependencies
    1. Navigate back to the project root directory
    $ cd ../../
    1. npm install the server dependencies
    $ npm install
  4. Install the client/front-end dependencies
    1. Navigate to the client directory
    $ cd client/
    1. npm install the client dependencies
    $ npm install
  5. Navigate back to the project root directory
$ cd ..
  1. Run the application!
$ npm run dev
  1. Visit localhost:3000 to check it out!

Features

Sign Up Page

This is where you can register for an account in order to post videos and react to other users. All that is needed is your first and last name, email address, and password.

Sign Up Page

Sign In Page

You can sign in to the website here. You will be directed to this page right after registration, or if you click Sign In on the top right corner.

Sign In Page

Homepage

This is the main screen of the webapp. Here you can see all videos that every other user has posted, including ones that you’ve uploaded as well. For each video, you can see the title, the publisher, view count, and post date.

Homepage

Subscribed Videos

This is where you can view all the videos from people you subscribe to. For example, the user I have logged in as follows “Sport Fan” and “Rapper Fan,” hence why they show up in this screen.

Subscribed Videos

Upload a Video

If you wish to upload a video to share with the community, you can click the “Upload” link on the top right, where you’ll be presented with a webpage that looks like the one below. Here you can upload any video of your choice by clicking the plus (+) button, and the webapp will generate a thumbnail for you. You have the option of entering in the video title, description, privacy rating (public or private) and category as well.

Upload a Video

Watch a Video

Clicking on any video on the homepage or subscribed video page will take you to a dedicated link in which you can view the video. On this screen, you can view the selected video, or click on another video on the side panel after watching the current one.

Watch a Video

Reactions

The platform gives users a variety of ways to interact with each other. While watching a video, you have the option to like or dislike the video, subscribe to the user, or leave a comment with your thoughts. You can also reply to other users’ comments and like/dislike those too.

Reactions

Dependencies

  • Axios: promise-based HTTP client for NodeJS
  • Ant Design: a front-end framework used for styling simple and natural user interfaces
  • Express: back-end webapp framework for dealing with server-side requests
  • ffmpeg: a library that was used to aid in video streaming for this webapp
  • JsonWebToken (JWT): secure way for transmitting information between parties as a JSON object
  • MomentJS: a datetime library for JavaScript
  • Mongoose / MongoDB: A general purpose NoSQL DBMS
  • ReactJS: A front-end library developed by Facebook that is used for building front-end user interfaces
  • React-Redux: used in conjunction with ReactJS to coordinate state management
  • React-Router: handles routing endpoints in webapp via dynamic routing
  • React-Dropzone: a ReactJS hook library used for drag-and-drop file components

To-Do

  • Search bar functionality
  • Dedicated user pages
  • Modal alerts instead of browser alerts
  • Machine learning integration for new videos to watch
  • Potentially YouTube API integration

Download Youtube Video Streaming Clone

Download

Furqan

Well. I've been working for the past three years as a web designer and developer. I have successfully created websites for small to medium sized companies as part of my freelance career. During that time I've also completed my bachelor's in Information Technology.

Recent Posts

How can IT Professionals use ChatGPT?

If you're reading this, you must have heard the buzz about ChatGPT and its incredible…

September 2, 2023

ChatGPT in Cybersecurity: The Ultimate Guide

How to Use ChatGPT in Cybersecurity If you're a cybersecurity geek, you've probably heard about…

September 1, 2023

Add Cryptocurrency Price Widget in WordPress Website

Introduction In the dynamic world of cryptocurrencies, staying informed about the latest market trends is…

August 30, 2023

Best Addons for The Events Calendar Elementor Integration

The Events Calendar Widgets for Elementor has become easiest solution for managing events on WordPress…

August 30, 2023

Create Vertical Timeline in Elementor: A Step-by-step Guide

Introduction The "Story Timeline" is a versatile plugin that offers an innovative way to present…

August 30, 2023

TranslatePress Addon for Automate Page Translation in WordPress

Introduction In today's globalized world, catering to diverse audiences is very important. However, the process…

August 30, 2023