A modern, fully-functional Netflix clone built with React and Firebase, featuring user authentication, dynamic content browsing, and video playback capabilities using The Movie Database (TMDb) API.
- User Sign Up & Sign In - Create new accounts or log in with existing credentials
- Firebase Authentication - Secure email/password authentication
- Protected Routes - Automatic redirection based on authentication state
- Session Management - Persistent login sessions with Firebase
- Dynamic Movie Categories
- Popular on Netflix
- Blockbuster Movies
- Top Rated
- Upcoming Releases
- Now Playing
- TMDb API Integration - Real-time movie data and images
- Horizontal Scrolling - Smooth carousel navigation through movie categories
- Movie Thumbnails - High-quality backdrop images from TMDb
- Embedded YouTube Trailers - Watch movie trailers directly in the app
- Dynamic Video Loading - Automatic trailer fetching based on movie selection
- Player Controls - Full-screen support and standard video controls
- Back Navigation - Easy return to browsing interface
- Netflix-Inspired Design - Authentic Netflix look and feel
- Responsive Layout - Optimized for desktop, tablet, and mobile devices
- Dynamic Navbar - Scroll-triggered background color change
- Hero Banner - Eye-catching hero section with featured content
- Profile Dropdown - Quick access to sign out functionality
- Dark Theme - Comfortable viewing experience
- Toast Notifications - Real-time feedback for user actions
- Loading Spinners - Visual feedback during authentication
- Smooth Animations - Polished transitions and hover effects
- Error Handling - User-friendly error messages
Before you begin, ensure you have the following installed:
- Node.js (v14 or higher)
- npm or yarn
- Git
-
Clone the repository
git clone https://github.com/samdev652/Netflix-Clone.git cd Netflix-Clone -
Install dependencies
npm install
-
Set up Firebase
- Create a Firebase project at Firebase Console
- Enable Email/Password authentication
- Create a Firestore database
- Copy your Firebase configuration
- Update
src/firebase.jswith your credentials:const firebaseConfig = { apiKey: "YOUR_API_KEY", authDomain: "YOUR_AUTH_DOMAIN", projectId: "YOUR_PROJECT_ID", storageBucket: "YOUR_STORAGE_BUCKET", messagingSenderId: "YOUR_MESSAGING_SENDER_ID", appId: "YOUR_APP_ID" };
-
Set up TMDb API
- Get an API key from The Movie Database
- Replace the Bearer token in
src/components/TitleCards/TitleCards.jsxandsrc/pages/Player/Player.jsx
-
Start the development server
npm run dev
-
Open your browser
- Navigate to
http://localhost:5173
- Navigate to
- React 19.1.0 - UI library for building interactive interfaces
- React Router DOM 7.6.3 - Client-side routing
- Vite 6.3.5 - Fast build tool and development server
- CSS3 - Custom styling with responsive design
- Firebase 12.0.0 - Backend-as-a-Service
- Authentication
- Firestore Database
- TMDb API - Movie data and images
- react-firebase-hooks 5.1.1 - React hooks for Firebase
- react-toastify 11.0.5 - Toast notifications
- ESLint - Code linting and quality
Netflix-Clone/
βββ public/ # Static assets
βββ src/
β βββ assets/ # Images, icons, and media files
β β βββ cards/ # Card data
β βββ components/ # Reusable components
β β βββ Footer/ # Footer component
β β βββ Navbar/ # Navigation bar
β β βββ TitleCards/ # Movie cards carousel
β βββ pages/ # Page components
β β βββ Home/ # Home page
β β βββ Login/ # Authentication page
β β βββ Player/ # Video player page
β βββ App.jsx # Main app component with routing
β βββ firebase.js # Firebase configuration and methods
β βββ main.jsx # Application entry point
β βββ index.css # Global styles
βββ index.html # HTML template
βββ package.json # Dependencies and scripts
βββ vite.config.js # Vite configuration
βββ eslint.config.js # ESLint configuration
- Users are redirected to login page if not authenticated
- Firebase
onAuthStateChangedmonitors authentication state - Automatic navigation after successful login/signup
- Now Playing - Currently showing movies
- Top Rated - Highest-rated films
- Popular - Most popular content
- Upcoming - Soon-to-be-released movies
/- Home page (protected)/login- Authentication page/player/:id- Video player with movie trailer
The application is fully responsive with breakpoints:
- Desktop - Full layout with all features
- Tablet (β€1024px) - Optimized spacing and layout
- Mobile (β€800px) - Simplified navigation and compact design
- Small Mobile (β€500px) - Minimal layout for small screens
-
Move sensitive data to environment variables
const apiKey = import.meta.env.VITE_TMDB_API_KEY;
-
Create a
.envfileVITE_FIREBASE_API_KEY=your_api_key VITE_TMDB_API_KEY=your_tmdb_key
-
Add
.envto.gitignore
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint- Hero banner with featured content
- Multiple horizontal scrolling movie categories
- Sticky navigation bar with scroll effects
- Footer with social links
- Toggle between Sign In and Sign Up
- Form validation
- Loading states
- Error handling with toast notifications
- Embedded YouTube trailers
- Movie information display
- Back navigation to previous page
Contributions are welcome! Feel free to:
- 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 created for educational purposes. Netflix and its logo are trademarks of Netflix, Inc.
- Netflix - Design inspiration
- The Movie Database (TMDb) - Movie data and images
- Firebase - Authentication and database
- React - UI framework
- Vite - Build tool
Your Name - @samdev652
Project Link: https://github.com/samdev652/Netflix-Clone
β If you found this project helpful, please give it a star!