This is a React Application build to fetch and display Movie information from the TMDB API. The features of this Application are as follow:
- Connect to TMBD API
- Fetch “Now Playing” Movie Information
- Fetch Genre Information
- Display a list of Movies & related Information
- Filter Movies based on Rating & Genre
- The UI is Responsive to the following Breakpoints : small (480), medium(1024), large(1440)
- Filter Interactions:
- The rating input is implemented as a slider with a value range between 0 and 10, increments of 0.5 and a default set to 3.
- Multiple genres input is implemented as checkboxes and only contains genres from the TMDb API, that are in the returned movie result set.
- API Key Setup - Visit https://www.themoviedb.org/ and sign up for getting API key
- VS Code (Preferable)
- npm install --save bootstrap
- npm install --save reactstrap react react-dom
- npm install react-rangeslider --save
- Create a folder and in terminal go to that folder path.
- clone the repository
- npm install //This will install all the dependencies required
- npm start
- npm run build //For bulding the code which can be deployed on the server
- Componets: Contains all the componets(Genre Filter,Movies List, Rating Filter and Loader)
- Service API fetch File: service.js
- Setting Constant: Constant.js
- The API calls are only made once.
- Promise.all function is used for getting API response.
- API URLs used
- For Getting Now Playing Movies Details : https://api.themoviedb.org/3/movie/now_playing
- For Getting Genres Details : https://api.themoviedb.org/3/genre/movie/list
- Images are retrieved as part of “Now Playing” and don’t need to be separately fetched
- Important: Once the API key is setup, it needs to be added in the Constant.js file which will be maintained by the variable apiKey.
- Default value for Rating is configured in Constant.js with variable name defaultRange.
- We are currently not using hooks but will need that once the number and complexity of facets/filters increases.
- You will notice that there is one card slot blank in the last row. This is because the movie not displayed has a Rating of 1. Please change the Rating to 1 to see all Movie cards.