Skip to content

The-Hero-Developers/Netflix-Clone-Frontend

Repository files navigation

This is a Next.js project bootstrapped with create-next-app.

Prerequisites

Make sure you have installed all of the following prerequisites on your development machine:

  • Node.js (v18)

You can use nvm or nvm-windows to manage your Node versions.

Installation

$ yarn install

Getting Started

First, run the development server:

$ yarn run dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.tsx. The page auto-updates as you edit the file.

The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

Technologies

FAQ

Where can I learn all of those technologies?

What I recommend to everyone is spending some time trying to read the documentation of every technology. It's the best way to learn them. Or you can watch some youtube videos to learn the basics.

Here I'll leave some cheatsheets so you can learn "fast".

I get an error running git commit, it's something with Husky.

There are a lot of reasons, the most common reason is because you have errors with Eslint or Typescript.

To see the errors of Eslint you can run:

$ yarn run lint

And for Typescript you can run:

$ npx tsc -p tsconfig.json

If you get any errors running any of them, please try to solve them.

If you don't have any errors, please try making the commit following the guidelines of conventional commits.

For example:

$ git commit -m "feat: my really descriptive commit about a feature"
$ git commit -m "fix: my fix of a problem"

I can't change of branch with git checkout. Help!

Check if you have any changes files on changed status or staged status. To check that, use:

$ git status

If you have any files there then, you have some options, it depends of the context.

  1. I want to change of branch because my branch will be deleted, but for some reason I made changes that won't be used.

Just remove the changes that you might have running:

$ git restore .
  1. I want to change of branch to check another branch but I don't want to loose my changes and I don't want to make a commit.

You can save them temporarily using git stash:

$ git stash

And now you can change of branch.

If you need to recover those changes run:

$ git stash apply
  1. I want to change of branch and keep my changes with a commit.

Save your changes with git add.

And create a commit, please make sure to follow conventional commit guidelines

When I run the app with yarn dev, it shows an error like: a module couldn't be found.

Just install/update dependencies:

$ yarn install

The frontend doesn't connect with the backend

Make sure that you have created the .env.local file, you can see the required variables inside .env.example file.