TriadJS group project movie app
NVM is a version manager for node. It allows you to install multiple versions of node and switch between them.
It uses .nvmrc
file to specify the version of node to use.
- Install nvm
-
$ nvm install $ nvm use
- Check your node version
$ node -v
This is for newer Mac's that use zsh terminals (MacOS Catalina and up).
watch this video for help starting at 3:10 mins to 6:53 mins
- open a new terminal window (you should be in /Users/your-username directory) that is the default for a new terminal window. The reason for this is because that is where it is going to look for .zshrc file and also where it will put nvm.
$ pwd
- Run this command to see if you have a .zshrc file in your current directory.
$ ls -al
- Look to see if you have a .zshrc file is in the list. If you don't, then type the following command.
$ touch .zshrc
- Use the curl command on the nvm page.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
- Make sure you do this step (it updates your .zshrc file).
$ source ~/.zshrc
- Open a terminal in your project folder (either in vs code or navigate a terminal to your project path) and run these 2 commands.
the node version is in the
$ nvm install $ nvm use
.nvmrc
and that is where it will pull it from. - Check your node version
$ node -v
Asdf is a version manager for multiple languages. It allows you to install multiple versions of node and switch between them.
It uses plugins to manage different languages. It uses .tool-versions
file to specify the version of the language to use.
- Install asdf
- Install nodejs plugin for asdf
- Install asdf nodejs plugin
$ brew install gpg gawk $ asdf plugin add nodejs $ asdf install
- Check your node version
$ node -v
You don't have to use nvm. You can install node.js through the node.js website for the quickest easiest solution. However, if you plan to use node.js for different projects and you want to avoid issues with needing to use different versions of node then you would benefit from using nvm for windows.
- Install nvm-windows
- Scroll down until you see Install nvm-windows "latest installer"
- download and install nvm-setup.exe
- In cmd (this version of node is from the .nvmrc file in our project)
nvm install 22.3.0
- Use that version of node
nvm use 22.3.0
watch this video for help 0:00 mins to 2:44 mins
- Once nvm-windows is installed follow steps 4 and 5 above
- If you watched the whole video the reason his nvm wouldn't install node at first is because you have to use either
xx.x.x
orxx
so it would be either22.3.0
or22
- Create a
.env
file in the root of the project - Copy the contents of
.env.example
to.env
- Fill in the values in
.env
file - Don't forget to add your API Key and API Token to your
.env
file.
$ npm install
$ npm start
We are using themoviedb.org API for our requests. Sadly they now require a lot of info about you before they give you an API key and token. They didn't use to and I didn't realize that until helping another person register their app. I do know they have had a lot of bad actors using their API so they had to do something. However, I still think they have the best movie and tv show API around. They are the go to source for a lot of other sites because of their vast amount of data and images.
- Sign up for a basic account https://www.themoviedb.org/signup
- Verify your email address using a link they send you via email and then log in.
- Go to the settings and then click api or use this link https://www.themoviedb.org/settings/api
- Under Request an API Key use the "click here" link.
- You have a choice between two options. Choose Developer. Click accept if you agree.
- Type of Use select Website
- Application name is up to you
- Application URL can be set to localhost:3000
- Application summary has to be a short sentence or you will get an error
- Fill out the rest of the form and click submit
- You will be presented with your API Key and an API Read Access Token. Copy your API Key and Token to your local
.env
file.- Side Note: Personally I recommend using the Token since it is used in all the examples. The Token also allows you to use v3 and v4 of the API and the API Key only lets you use v3. Basically the API key works through a query parameter in the URL and the Token works through setting a header in your URL request. I know people are at different knowledge levels that is why I included both.
- That is it. You can find the API docs here developer.themoviedb.org and endpoints here https://developer.themoviedb.org/reference/intro/getting-started.