Application uses external TMDB API.
To see a preview of the initial idea, use this link. This implementation was based on that example.
The themoviedb.org API was used for the backend. API requires the use of API key so you need to register and get API key (you can enter any data during registration process).
The following endpoints were used in this work:
Link to the API documentation.
The app has the following routes:
'/'
- home page with a list of popular movies. Component HomePage
. /movies
- page with movie search by keyword. Component MoviesPage
./movies/:movieId
- page with detailed information about the movie. Component MovieDetailsPage
./movies/:movieId/cast
- information about the cast. Component Cast
. Rendered on the page MovieDetailsPage
./movies/:movieId/reviews
- information about reviews. Component Reviews
. Rendered on the page MovieDetailsPage
.The asynchronous JS code loading for the application routes was added using React.lazy()
and <Suspense>
.
The live page for this repository can be viewed at GitHub Pages.
npm install
command..env.local
file in the project root and add following environment variables (follows provided .env.example file as a helping guide):
REACT_APP_TMDB_API_KEY
variableREACT_APP_ROUTING_BASENAME
variable (location within your application, when your application is served from a sub-directory on the server) when deploying to GitHub to match your case.REACT_APP_FUNC_SHOW_LESS
variable. Change is to true
for "show more / show less" folding functionality for unlimited folds/unfoldes or to false
for "show more" functionality only when all respective elements may be unfolded once and after that button disappear.npm start
command.gh-pages
branch.homepage
value in package.json (should match your repo GitHub URL, e.g. https://<profile-name>.github.io/<repository-name>/
)REACT_APP_TMDB_API_KEY
should be set as a repository secret and should match obtained TMDB API key API key.REACT_APP_ROUTING_BASENAME
should be set as a repository variable and match your repository name (as your application will be served from a sub-directory on the server that matches your repository name) or other depending on your deploy conditions.REACT_APP_FUNC_SHOW_LESS
should be set as repository variable. Change is to true
for "show more / show less" folding functionality for unlimited folds/unfoldes or to false
for "show more" functionality only when all respective elements may be unfolded once and after that button disappear.React project template is used as a starting point for the application.
goit-react-hw-05-movies
repository is created.GitHub Pages
.propTypes
are described for all components.Prettier
is used