This React application allows users to fetch and display popular movies and TV shows from The Movie Database (TMDB) API. Users can toggle between movies and TV shows, filter by year, and view details for each item.
- Fetch popular movies and TV shows from TMDB
- Toggle between movies and TV shows
- Filter results by year
- Display movie/show posters, titles, release dates, and ratings
- Responsive design for various screen sizes
- React
- TypeScript
- Tailwind CSS
- shadcn/ui components
- TMDB API
- Node.js (v14 or later)
- npm
-
Clone the repository:
git clone https://github.com/your-username/tmdb-movie-tv-fetcher.git cd tmdb-movie-tv-fetcher
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory and add your TMDB API key:REACT_APP_API_KEY=your_tmdb_api_key_here REACT_APP_BASE_URL=https://api.themoviedb.org/3 REACT_APP_POSTER_BASE_URL=https://image.tmdb.org/t/p/w500
-
Start the development server:
npm start
-
Open http://localhost:3000 in your browser to view the app.
- Use the toggle button to switch between Movies and TV Shows.
- Enter a year in the input field to filter results by year.
- Check the "Fetch by Year" checkbox to apply the year filter.
- Click on a movie or TV show card to view more details on TMDB website.
This project is set up with CircleCI for continuous integration and deployment. The config.yml
file in the .circleci
directory defines the build and deploy jobs.
To deploy:
- Ensure your CircleCI project is connected to your GitHub repository.
- Set up the necessary environment variables in CircleCI (e.g.,
SERVER_USER
,SERVER_IP
,SERVER_DIR
). - Push changes to the
master
branch to trigger the build and deploy workflow.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is open source and available under the MIT License.
- The Movie Database (TMDB) for providing the API
- shadcn/ui for the UI components
- Tailwind CSS for the utility-first CSS framework