This is a Next.js application that allows users to search for movies using the TMDB API. It fetches movie data based on user queries and displays the results in a responsive grid layout.
- **Search Functionality: Users can search for movies by title using URL search parameters instead of useState, allowing direct linking to specific searches.
- Debounced Search: The app uses debounced input to minimize unnecessary API calls.
- Responsive Design: The layout adapts to different screen sizes.
- Dynamic Routing: Each movie links to a detailed page using Next.js dynamic routing.
- Next.js: Framework for server-side rendering and static site generation.
- Tailwind CSS: Utility-first CSS framework for styling.
- TypeScript: For type-safe JavaScript development.
- TMDB API: Used to fetch movie data.
- Clone the repository:
git clone https://github.com/pnvdev/nextjs-movies.git
- Install dependencies:
npm install
- Run the development server:
npm run dev
- Open http://localhost:3000 to see the app in action.
To run this project, you will need to add the following environment variables to your .env.local
file:
NEXT_PUBLIC_TMDB_API_KEY=your_tmdb_api_key
This app can be easily deployed on Vercel, the platform from the creators of Next.js.
This project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to TMDB for providing the movie data API.