Skip to content

kundanhere/netflix-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

48 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MERN Netflix Clone 🎬

Demo App

This is how the project looks like:

About This Project:

GitHub repo size

βš›οΈ Tech Stack: React.js, Node.js, Express.js, MongoDB, Tailwind CSS

πŸ”§ Backend

  • πŸ—„οΈ MongoDB Setup
  • πŸ” Authentication with JWT
  • πŸ”„ Forgot & Reset Password
  • πŸ“§ Sending account related emails
  • πŸ”’ Protecting Our Routes
  • 🎬 Fetch Movies and Tv Shows from TMDB API
  • πŸ™Œ Fetch Similar Movies and Tv Shows
  • πŸ”Ž Search for Actors and Movies

🌐 Frontend

  • πŸ“‹ Signup Page UI
  • πŸ”“ Login Page UI
  • βœ… Email Verification Page UI
  • πŸ“€ Implementing Signup
  • πŸ”‘ Implementing Login
  • πŸ“§ Implementing Email Verification
  • πŸ”„ Implementing Forgot Password
  • πŸ“± Responsive UI
  • πŸŽ₯ Watch Trailers
  • πŸ”₯ Fetch Search History
  • πŸ’™ Awesome Landing Page
  • 🌐 Deployment
  • πŸš€ And Many More Cool Features

System requirements

Note

Before you start, make sure you have the following installed:

  • Node.js 20.12.0 or later installed.
  • React.js 18.3.1 or later.
  • Operating systems: macOS, Windows, or Linux.
  • VSCode or another text editor of your choice.

Code organization and folder structure


(Root)
β”œβ”€β”€β”€backend               
β”‚     β”œβ”€β”€β”€config
β”‚     β”œβ”€β”€β”€controllers
β”‚     β”œβ”€β”€β”€helpers
β”‚     β”œβ”€β”€β”€middlewares
β”‚     β”œβ”€β”€β”€models
β”‚     β”œβ”€β”€β”€routes
β”‚     β”œβ”€β”€β”€services
β”‚     β”‚    β”œβ”€β”€β”€mailtrap-service.js
β”‚     β”‚    β”‚   └───[[...emails]]
β”‚     β”‚    └───tmdb-service.js
β”‚     β”‚       └───[[...data]]
β”‚     β”œβ”€β”€β”€(app.js)
β”‚     β”œβ”€β”€β”€(package.json)
β”‚     └───(package.lock.json)
β”‚
β”œβ”€β”€β”€frontend               
β”‚     β”œβ”€β”€β”€public
β”‚     β”‚    └─[[...assets]]
β”‚     β”œβ”€β”€β”€src  
β”‚     β”‚     β”œβ”€β”€β”€components
β”‚     β”‚     β”‚     └───skeletons 
β”‚     β”‚     β”œβ”€β”€β”€hooks
β”‚     β”‚     β”œβ”€β”€β”€pages
β”‚     β”‚     β”‚     └───home
β”‚     β”‚     β”œβ”€β”€β”€store
β”‚     β”‚     β”œβ”€β”€β”€utils
β”‚     β”‚     β”œβ”€β”€β”€(app.jsx)
β”‚     β”‚     β”œβ”€β”€β”€(main.jsx)
β”‚     β”‚     └───(index.css)
β”‚     β”‚
β”‚     β”œβ”€β”€β”€(index.html)
β”‚     β”œβ”€β”€β”€(eslint.config.js)
β”‚     β”œβ”€β”€β”€(tailwind.config.js)
β”‚     β”œβ”€β”€β”€(package.json)
β”‚     └───(package.lock.json)
β”‚             
β”œβ”€β”€β”€(.prettierignore)
β”œβ”€β”€β”€(.prettierrc.js)
β”œβ”€β”€β”€(package.json)
└───(package.lock.json)

public directory

This folder serve static assets, like images, fonts files.

components directory

this folder contains react components which are independent and reusable.

hooks directory

this folders contains all custom hooks which will be used in components

pages directory

You can use this directory to create object page models. The Page Object Model (POM) is a design pattern commonly used in software testing, specifically in the context of test automation for web applications. It helps in creating an organized and maintainable structure for test scripts by encapsulating the details of the web pages and their elements.

store directory

This folder contains state management files for zustand library.

utils directory

this folder contains all the utility functions.

index.css file

This is the main css file of the application. You can use this file to add CSS rules to all the routes in your application - such as CSS reset rules, site-wide styles for HTML elements like links, and more.


πŸš€ Quick Start Guide

To spin up this project locally, follow these steps

Clone

Use the git clone CLI to clone template directly to your machine

Run project on local

npm run build
npm start

Project Dev Steps

  1. Environment Setup

    Create a .env file on the root of project PUT THIS INSIDE

# Node server
SERVER_PORT=8000
NODE_ENV=development

# CLient config
CLIENT_HOST=localhost
CLIENT_PORT=5173
CLIENT_URL=http://localhost:5173

# JWT secret
JWT_SECRET=your_jwt_secret

# Database integration
MONGO_URI=your_mongodb_uri

# TMDB API integration
TMDB_API_KEY=your_tmdb_api_key

# Mailtrap integration
MAILTRAP_TOKEN=your_mailtrap_token
MAILTRAP_ENDPOINT=https://sandbox.api.mailtrap.io/api/send/{your_mailbox_id}
    
  1. Project Folders & Files Structure

  2. Update package.json file from root directory

// For mac and linux users
 "scripts": {
    "dev": "NODE_ENV=development&& concurrently \"cd backend && npm run dev\" \"cd frontend && npm run dev\" ",
    "start": "NODE_ENV=production&& node backend/app.js",
    "build": "npm install && npm install --prefix backend && npm install --prefix frontend && npm run build --prefix frontend",
    "format": "prettier --print-width=120 --write ."
  }

// For windows users
 "scripts": {
    "dev": "SET NODE_ENV=development&& concurrently \"cd backend && npm run dev\" \"cd frontend && npm run dev\" ",
    "start": "SET NODE_ENV=production&& node backend/app.js",
    "build": "npm install && npm install --prefix backend && npm install --prefix frontend && npm run build --prefix frontend",
    "format": "prettier --print-width=120 --write ."
  }

  1. Setup Eslint & Prettier

  2. Run project in development

npm install
npm run dev

Tip

Run this command to format code before running git commit command.

npm run format

I'll see you in the next one!


Back to top

Releases

No releases published

Packages

No packages published

Languages