Skip to content

alin00r/Netflix-Clone-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Feb 16, 2024
bdf49a1 · Feb 16, 2024

History

3 Commits
Feb 16, 2024
Feb 16, 2024
Feb 16, 2024
Feb 16, 2024
Feb 16, 2024
Feb 16, 2024
Feb 16, 2024
Feb 16, 2024
Feb 16, 2024

Repository files navigation

Netflix Clone REST API

Technologies 🚀

  • Node.js
  • Express.js
  • MongoDB
  • Mongoose
  • JSON Web Token
  • bcrypt

Structure

  • app
    • models
      • List.js
      • Movie.js
      • User.js
    • routes
      • listRoutes.js
      • movieRoutes.js
      • userRoutes.js
    • auth
      • verifyToken.js
    • index.js
    • db.js
  • node_modules
  • package.json

Features ✨

Lists Routes:

  • Handles CRUD operations for lists.
  • Uses middleware verify for authentication.
  • Supports creating and deleting lists.
  • Supports fetching lists based on type and genre.

Movies Routes:

  • Manages CRUD operations for movies.
  • Also includes a route to get a random movie.
  • Utilizes middleware verify for authentication.
  • Allows updating, deleting, fetching movies by ID, and fetching all movies.
  • Supports fetching a random movie based on type (series or movie).

User Routes:

  • Handles user-related operations like updating, deleting, and fetching users.
  • routes for user authentication like logout and logout from all devices.
  • Provides functionality to get user statistics.
  • Uses middleware verify for authentication.

Setting Up Your Local Environment

Follow these steps to set up your local environment for the Netflix-API:

  1. Clone the Repository: Clone this repository to your local machine:

    git clone https://github.com/alin00r/Netflix-API.git
    cd Netflix-API
  2. Install Dependencies: Run the following command to install all the required dependencies:

    npm install
  3. Configure Environment Variables:

    Before you can run the Netflix-API, you need to set up your environment variables. These variables store sensitive information required for the app to function properly. Follow these steps to configure your environment variables:

    1. Create a .env File: In the root directory of the app, create a file named .env.

    2. Add the Following Environment Variables: Replace the placeholders with your actual information. You might need to sign up for accounts and services to obtain the required credentials.

      # MongoDB Configuration
      DATABASE_URI=your-mongodb-database-url
      
      
      # JSON Web Token Configuration
      SECRET=your-json-web-token-secret
      

API reference

During API development, I use Postman for handling/testing all endpoints.

  • Postman collection/documentation is available on this link click here
  • Base URL endpoints: http://127.0.0.1:5000/api/V1/ or http://localhost:PORT/api/v1/

License

License