IMDb Clone - TMDB API Integration
A modern, responsive movie and TV show discovery application built with Svelte and powered by The Movie Database (TMDB) API.
š Features
Core Functionality
- Movie Discovery: Browse trending, popular, top-rated, and upcoming movies
- TV Show Discovery: Explore trending, popular, and top-rated TV series
- Advanced Search: Search across movies, TV shows, and people
- Comprehensive Filtering: Filter by genre, year, and sort by various criteria
- Responsive Design: Mobile-first design that works on all devices
Pages & Sections
- Home: Featured content with trending movies and TV shows
- Movies: Comprehensive movie browsing with advanced filters
- TV Shows: TV series discovery and browsing
- Celebrities: Actor, director, and crew information
- Awards: Information about major film awards and ceremonies
- News: Movie industry news and updates
Technical Features
- TMDB API Integration: Full integration with The Movie Database
- Real-time Data: Live data from TMDB's comprehensive database
- Image Optimization: High-quality posters and backdrops
- State Management: Svelte stores for persistent data
- Modern UI/UX: Beautiful, intuitive interface with smooth animations
š ļø Technology Stack
- Frontend: Svelte 3
- Build Tool: Rollup
- API: TMDB (The Movie Database)
- Styling: CSS with CSS Variables for theming
- State Management: Svelte Stores
- Deployment: Static hosting ready
š API Configuration
This application uses the TMDB API. You'll need to configure your API credentials using environment variables:
Required Environment Variables
Create a .env
file in the root directory with the following variables:
TMDB_API_KEY=your_api_key_here
TMDB_ACCESS_TOKEN=your_access_token_here
TMDB_BASE_URL=https://api.themoviedb.org/3
TMDB_IMAGE_BASE_URL=https://image.tmdb.org/t/p
Getting TMDB API Access
- Visit TMDB
- Create an account and request API access
- Get your API key and access token
- Copy
.env.example
to .env
and fill in your credentials
Note: The .env
file is already in .gitignore
to prevent committing sensitive credentials.
š Project Structure
src/
āāā components/ # Reusable UI components
ā āāā Carousel.svelte
ā āāā GenreFilter.svelte
ā āāā Header.svelte
ā āāā MovieGrid.svelte
ā āāā MovieItem.svelte
ā āāā MovieModal.svelte
ā āāā Navigation.svelte
ā āāā SearchBar.svelte
ā āāā Section.svelte
ā āāā SkeletonCard.svelte
ā āāā SortFilter.svelte
ā āāā ThemeToggle.svelte
ā āāā YearFilter.svelte
āāā pages/ # Page components
ā āāā AwardsPage.svelte
ā āāā MoviesPage.svelte
ā āāā NewsPage.svelte
ā āāā PeoplePage.svelte
ā āāā TVShowsPage.svelte
āāā services/ # API and external services
ā āāā tmdb.js # TMDB API integration
āāā stores.js # Svelte stores for state management
āāā App.svelte # Main application component
āāā main.js # Application entry point
š Getting Started
Prerequisites
- Node.js (v14 or higher)
- npm or yarn
Installation
Clone the repository:
git clone <repository-url>
cd IMDB-Clone-Svelte
Install dependencies:
npm install
Configure TMDB API:
- Copy
.env.example
to .env
- Fill in your TMDB API credentials in the
.env
file
Start the development server:
npm run dev
Open your browser and navigate to http://localhost:5000
š± Available Scripts
npm run dev
- Start development server with hot reload
npm run build
- Build for production
npm run start
- Start production server
š TMDB API Features Used
Movies
- Trending movies (daily/weekly)
- Popular movies
- Top-rated movies
- Upcoming movies
- Now playing movies
- Movie discovery with filters
- Movie details with credits, videos, and reviews
TV Shows
- Trending TV shows
- Popular TV series
- Top-rated TV shows
- TV show discovery
- TV show details
People
- Trending people
- Popular celebrities
- People search
- Person details
Search & Discovery
- Multi-search across movies, TV shows, and people
- Advanced filtering by genre, year, rating, etc.
- Sorting by popularity, rating, release date, etc.
šØ Customization
Theming
The application uses CSS variables for easy theming. Key variables include:
--accent-primary
: Primary accent color
--accent-secondary
: Secondary accent color
--surface-1
, --surface-2
, --surface-3
: Surface colors
--text-primary
, --text-secondary
: Text colors
Adding New Features
- New API Endpoints: Add to
src/services/tmdb.js
- New Pages: Create in
src/pages/
and add to navigation
- New Components: Create in
src/components/
for reusability
- New Stores: Add to
src/stores.js
for state management
š Security Considerations
- API keys are stored in environment variables (
.env
file)
- The
.env
file is excluded from version control via .gitignore
- CORS is handled by TMDB API
- No sensitive user data is stored
- Lazy loading of images
- Skeleton loading states
- Efficient pagination
- Optimized API calls
- Responsive image sizes
š Browser Support
- Modern browsers (Chrome, Firefox, Safari, Edge)
- Mobile browsers
- Progressive Web App ready
š¤ Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
š License
This project is licensed under the MIT License - see the LICENSE file for details.
š Acknowledgments
- TMDB for providing the comprehensive movie and TV show database
- Svelte for the amazing reactive framework
- The open-source community for inspiration and tools
š Support
For questions or issues:
- Check the existing issues
- Create a new issue with detailed information
- Include browser and device information
Note: This application is for educational and demonstration purposes. Please respect TMDB's terms of service and rate limits when using their API.