A modern React + Vite movie discovery app powered by the TMDB API.
- Search movies with debounced input
- Explore Trending, Popular, and Top Rated sections
- Open a detailed movie page with:
- Story and metadata
- Cast preview
- Official trailer (if available)
- Similar movie recommendations
- Recently searched terms saved in localStorage
- Interactive navbar with a toggleable help panel
- React 19
- React Router DOM
- Vite
- TMDB REST API
- CSS modules/files per component/page
movie-search-app/
public/
src/
components/
Loader/
MovieCard/
Navbar/
RecentlyViewed/
SearchBar/
SkeletonCard/
hooks/
useDebounce.js
pages/
Home.jsx
MovieDetails.jsx
services/
tmdbApi.js
styles/
global.css
App.jsx
main.jsx
.gitignore
index.html
package.json
vite.config.js
git clone (https://github.com/Sanjith2006k/MovieSearch)
cd movie-search-app
npm installCreate a .env file in the project root and add your TMDB API key:
VITE_TMDB_API_KEY=your_tmdb_api_key_hereYou can generate an API key at: https://www.themoviedb.org/settings/api
npm run devOpen the local URL shown in terminal (usually http://localhost:5173).
npm run dev # Start local dev server
npm run build # Create production build
npm run preview # Preview production build locally
npm run lint # Run ESLintVITE_TMDB_API_KEY: TMDB API key used bysrc/services/tmdbApi.js
- Confirm
VITE_TMDB_API_KEYis present in.env - Restart the dev server after adding/changing
.env - Hard refresh browser (
Ctrl + Shift + R) - Check browser console for import/export errors
- Verify your TMDB key is valid and active
- Confirm you are using TMDB v3 API key
- Inspect network requests in DevTools
- Never commit
.env - Keep
.envand.env.*ignored in.gitignore - If a key is exposed, rotate it immediately
By