A React application for discovering movies, viewing details, and saving favorites using the TMDb API.
- User Authentication: Simple login system with demo credentials
- Movie Discovery: Browse trending movies from TMDb
- Search Functionality: Search for movies by title
- Movie Details: View comprehensive information about movies including:
- Overview, genres, rating, release date, runtime
- Cast information
- Trailers (via YouTube)
- Production companies
- Favorites Management: Add/remove movies to a favorites list
- Dark/Light Mode: Toggle between dark and light themes
- Responsive Design: Mobile-first approach for all screen sizes
- Infinite Scrolling: Load more results automatically as you scroll
- Error Handling: User-friendly error messages
- Node.js and npm installed
- TMDb API key (get one at https://www.themoviedb.org/settings/api)
-
Clone the repository:
git clone <repository-url> cd movie-explorer
-
Install dependencies:
npm install
-
Create a
.envfile in the root directory and add your TMDb API key:REACT_APP_TMDB_API_KEY=your_api_key_here -
Update the API key in
src/api/tmdbApi.jswith your key. -
Start the development server:
npm start
-
Open http://localhost:3000 in your browser.
movie-explorer/
│
├── public/
│ ├── index.html
│ └── ...
│
├── src/
│ ├── api/
│ │ └── tmdbApi.js # API configuration and helper functions
│ │
│ ├── components/
│ │ ├── Header.js # App header with navigation
│ │ ├── LoginForm.js # User authentication form
│ │ ├── MovieCard.js # Card component for movie display
│ │ └── SearchBar.js # Search input component
│ │
│ ├── context/
│ │ ├── AuthContext.js # Authentication state management
│ │ └── MovieContext.js # Movie data state management
│ │
│ ├── pages/
│ │ ├── FavoritesPage.js # User's favorite movies
│ │ ├── HomePage.js # Trending movies display
│ │ ├── LoginPage.js # User login
│ │ ├── MovieDetailsPage.js # Detailed movie information
│ │ └── SearchResultsPage.js # Search results display
│ │
│ ├── App.js # Main app component with routing
│ ├── index.js # Entry point
│ └── index.css # Global styles
│
├── .env # Environment variables (not in repo)
├── package.json # Project dependencies
└── README.md # Project documentation
- React: Frontend library
- React Router: Navigation and routing
- Context API: State management
- Material-UI: UI component library
- Axios: HTTP client for API requests
- TMDb API: Movie data source
- YouTube API: For embedded trailers
- LocalStorage: For saving user preferences and favorites
The app can be deployed using Vercel or Netlify:
- Push your code to a GitHub repository
- Visit Vercel and import your project
- Set the environment variables for your API key
- Deploy
- Push your code to a GitHub repository
- Visit Netlify and import your project
- Set the environment variables for your API key
- Deploy
For testing the application, use:
- Username:
user - Password:
password
- User registration
- Movie recommendations
- Filter by genre, year, and rating
- User reviews and ratings
- Watch list functionality
- Multi-language support
- TMDb API for movie data
- Material-UI for the component library
- React Documentation