A vanilla JS SPA movie web app using TMDB API.
Main Features • How To Set Up • How To Test • Credits • License
This can serve as a specification:
- Movies in theaters - Show latest movies currently available in theaters
- This is the home page.
- Initially 20 "In Theaters" movies are loaded.
- After searching for movies, you can go back to "In Theaters" movies if you click on the logo in the header
- Search as you type
- While you type, the web app will look for the movies matching your request.
- The results contain up to 20 movies
- If you empty the input search, the web app fallbacks to the "In Theaters" movies
- Infinite Scrolling
- When you scroll to the bottom, 20 more movies are shown
- As long as you don't refresh the page, the movies "In Theaters" are kept in a 'store' variable
- If you modify your search, the result of the previous search is not kept in the 'store' variable
- Movie basic information - the following information is displayed
- Picture
- Title
- Year
- Genres
- Average vote
- Overview
- Movie details - these are shown when clicking on a specific movie. Clicking again will hide it. The following details are displayed
- Movie videos (e.g. trailer)
- Reviews
- Similar movies
For the API to work, you need to request an API key from TMDB. Check How do I apply for an API key? here for more information.
Enter the following in your command line:
# Clone this repository
git clone https://github.com/webchopin/moviefinder
# Go into the repository
cd moviefinder
# Install dependencies
npm installCopy .env.example to .env and set your API key:
cp .env.example .envVITE_TMDB_API_KEY=your_api_key
Start the development server:
npm run devTo build and preview the production version:
npm run build
npm run previewE2E testing is used in this web app with Cypress.
To run all the tests from the command line:
npm run test:e2eThis builds the web app, starts the preview server, runs the tests and stops the server.
To run the tests interactively in the Cypress app, build and start the preview server first:
npm run build
npm run previewThen, in another terminal:
npm run cypress:openThe code is also checked with ESLint:
npm run lintThis web app uses the following open source packages:
MIT
X isma_eb