Web application to explore movies using The Movie Database (TMDb) API. Discover trending movies, search by title, explore by categories, and save your favorites.
- Trending Movies: View the most popular movies of the moment
- Search: Find movies by name
- Categories: Explore movies by genre (Action, Drama, Romance, etc.)
- Movie Details: Complete information including synopsis, rating, and related movies
- Favorites: Save and manage your favorite movies
- Responsive Design: Adapted for mobile and desktop devices
- HTML5
- CSS3
- Vanilla JavaScript
- Axios - For HTTP requests
- The Movie Database (TMDb) API - Movie data source
- Clone the repository:
git clone https://github.com/juanda404/API-REST-MOVIES
cd jds-movies- Create a
src/secrets.jsfile with your TMDb API Key:
const API_KEY = 'your_api_key_here';- Open
index.htmlin your browser or use a local server:
# With Python 3
python -m http.server 8000
# With Node.js (http-server)
npx http-server- Sign up at The Movie Database
- Go to your profile > Settings > API
- Request an API Key (it's free)
- Copy your API Key to the
secrets.jsfile
jds-movies/
├── index.html
├── styles/
│ └── app.css
├── src/
│ ├── secrets.js # API Key (do not include in git)
│ ├── node.js # DOM selectors
│ ├── main.js # Main logic
│ └── navigation.js # Navigation system
└── README.md
- Home: Shows trending movies and categories
- Search: Use the search field in the header
- Categories: Click any category to see movies of that genre
- Details: Click any movie to see complete information
- Click on a movie to mark it as favorite
- Your favorites are saved in the browser (LocalStorage)
- View all your favorite movies in the "Movies Favorites" section
// Trending movies
GET /trending/movie/day
// Movie search
GET /search/movie?query={query}
// Genre list
GET /genre/movie/list
// Movies by category
GET /discover/movie?with_genres={genreId}
// Movie details
GET /movie/{movieId}
// Similar movies
GET /movie/{movieId}/recommendationsThe project uses Google Fonts:
- Dosis (700, 800) - For titles
- Red Hat Display (400, 500) - For general text
You can customize colors by editing styles/app.css
- The application uses LocalStorage to save favorite movies
- Internet connection required to load movies
- Images are loaded from TMDb servers
- Respect API rate limiting (40 requests per 10 seconds)
Contributions are welcome. Please:
- Fork the project
- Create a 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 under the MIT License.
JuanDa
⭐ If you liked this project, give it a star on GitHub