βοΈ Tech Stack: React.js, Node.js, Express.js, MongoDB, Tailwind CSS
- ποΈ 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
- π 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
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.
(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)
This folder serve static assets, like images, fonts files.
this folder contains react components which are independent and reusable.
this folders contains all custom hooks which will be used in components
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.
This folder contains state management files for zustand library.
this folder contains all the utility functions.
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.
To spin up this project locally, follow these steps
Use the git clone
CLI to clone template directly to your machine
npm run build
npm start
-
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}
-
Project Folders & Files Structure
-
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 ."
}
-
Setup Eslint & Prettier
-
Run project in development
npm install
npm run dev
Tip
Run this command to format code before running git commit
command.
npm run format