MovieTime is a website built in React.js using The Movie Database API. No external frameworks have been used. The code uses CSS Flexbox to align and center element horizontally inside of their respective containers, and CSS Grid to display them on both the horizontal and the vertical axes.
To get started:
- clone the project or download it as a .zip file
- open your terminal
- cd into the project folder
- install all project dependencies with
npm install
- start the development server with
npm start
In order to fetch data from the API and display the movies, you need an API key. To get one, follow the steps outlined on the TMDb official website here.
Once you have your own key, you can either manually insert it into the URL you will send a request to, or create a file and import it into the App.js component. In the current project, I followed the following steps:
- I created a separate JavaScript file
- I declared a variable and stored the API key value as a string into that variable
- I exported the variable using the syntax
export let apiKey = "<insert your API key here>"
- Finally, I imported the variable into the component where I needed it (specifically, where I fetched the data from the API). In my case, it was the App.js file.
This project was bootstrapped with Create React App. You can find more information on how to perform common tasks here.
This app is released under a MIT license.