Skip to content

Anubhavbaranwal/PlayTime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YouTube Clone Backend

This repository contains the backend code for a YouTube clone created using Node.js, Express, and MongoDB. This backend server provides the necessary APIs to handle user authentication, video uploading, comments, likes, and more, mimicking the basic functionalities of YouTube.

Table of Contents

Features

  • User authentication (sign up, login, logout)
  • Video uploading and management
  • Commenting on videos
  • Like/Dislike videos
  • Subscription functionality
  • User profile management
  • Search functionality
  • ...and more!

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Node.js installed
  • MongoDB installed and running
  • npm or yarn package manager installed

Installation

  1. Clone the repository:

    git clone https://github.com/Anubhavbaranwal/PlayTime.git
  2. Navigate to the project directory:

    cd PlayTime
  3. Install dependencies:

    npm install
    # or
    yarn install

Configuration

  1. Create a .env file in the root directory and set the following environment variables:

     PORT=
     MONGODB_URI=
     CORS_ORIGIN=
     ACCESS_TOKEN_SECRET=
     ACCESS_TOKEN_EXPIRY=
     REFRESH_TOKEN_SECRET=
     REFRESH_TOKEN_EXPIRY=
    
     CLOUDINARY_CLOUD_NAME=
     CLOUDINARY_CLOUD_APIKEY=
     CLOUDINARY_CLOUD_APISECRET=

    Adjust the values according to your preferences and setup.

Usage

  1. Start the server:

    npm start
    # or
    yarn start
  2. The server will be running at http://localhost:8000 by default.

API Endpoints

  • POST /api/v1/user/register: Register a new user.
  • POST /api/v1/user/login: Login and receive an access token.
  • POST /api/v1/user/logout: Logout and invalidate the access token.
  • GET /api/v1/video: Get a list of all videos.
  • GET /api/v1/videos/:id: Get details of a specific video.
  • POST /api/v1/video: Upload a new video.
  • POST /api/v1/comments/:videoId: Add a comment to a video.
  • POST /api/v1/likes/toggle/v/:videoId: Like a video.
  • ...and more!

For detailed information about each endpoint and their usage, refer to the API documentation.

Contributing

Feel free to contribute by opening issues, providing feedback, or submitting pull requests.

License

This project is licensed under the MIT License.

About

a Youtube like video player code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published