A fully functional Netflix clone built with Next.js, TypeScript, MongoDB, and custom CSS. This application features user authentication, movie/TV show streaming, and a responsive Netflix-inspired UI.
- 🎬 Movie & TV Show Streaming: Browse and watch movies and TV series
- 🔐 User Authentication: Secure registration, login, and JWT-based authentication
- 📱 Responsive Design: Netflix-inspired UI that works on all devices
- 🎯 Personalized Experience: User watchlists, viewing history, and recommendations
- 🔍 Search & Filter: Find content by title, genre, or other criteria
- 📊 Rich Content Data: Detailed movie information, cast, ratings, and more
- ⚡ Fast Performance: Optimized with Next.js 15 and modern React patterns
- Frontend: Next.js 15, TypeScript, Custom CSS
- Backend: Next.js API Routes, JWT Authentication
- Database: MongoDB with Mongoose ODM
- Authentication: Custom JWT implementation with bcrypt
- UI Components: Lucide React icons, Custom CSS modules
- Deployment: Ready for Vercel deployment
- Node.js 18+
- MongoDB (local or MongoDB Atlas)
- npm or yarn
-
Clone the repository
git clone <your-repo-url> cd netflix-app
-
Install dependencies
npm install
-
Set up environment variables
Copy the
.env.localfile and update the values:# MongoDB Connection MONGODB_URI=mongodb://localhost:27017/netflix-app # For MongoDB Atlas: mongodb+srv://<username>:<password>@<cluster>.mongodb.net/netflix-app # Authentication NEXTAUTH_SECRET=your-secret-key-here NEXTAUTH_URL=http://localhost:3000 JWT_SECRET=your-jwt-secret-here
-
Set up MongoDB
- Local MongoDB: Install and start MongoDB locally
- MongoDB Atlas: Create a cluster and get your connection string
-
Seed the database
npm run seed
This will populate your database with sample movies and TV shows.
-
Start the development server
npm run dev
-
Open the application
Visit http://localhost:3000 in your browser.
- Visit the homepage
- Click "Get Started" or "Sign Up"
- Fill in your details (name, email, password)
- Start browsing movies and TV shows!
- Home: Featured content and personalized recommendations
- Movies: Browse all available movies
- TV Shows: Browse all available series
- My List: Your personal watchlist
- Search: Find content by title or genre
- Click on any movie/show card to view details
- Click the play button to start watching
- Add items to your list for later viewing
- Like content to improve recommendations
nextflix-app/
├── src/
│ ├── app/ # Next.js 13+ app directory
│ │ ├── (auth)/ # Authentication pages
│ │ ├── api/ # API routes
│ │ ├── globals.css # Global styles
│ │ └── layout.tsx # Root layout
│ ├── components/ # Reusable UI components
│ ├── contexts/ # React contexts (Auth, etc.)
│ ├── lib/ # Utility functions
│ ├── models/ # MongoDB/Mongoose models
│ └── data/ # Sample data
├── scripts/ # Database scripts
└── public/ # Static assets
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/me- Get current user
GET /api/movies- Get all movies (with filtering)GET /api/movies/[id]- Get specific moviePOST /api/movies- Create new movie (admin)PUT /api/movies/[id]- Update movie (admin)DELETE /api/movies/[id]- Delete movie (admin)
- JWT-based authentication with secure password hashing
- Persistent login sessions
- Protected routes and API endpoints
- Comprehensive movie/TV show data model
- Support for series with episodes and seasons
- Rich metadata (cast, director, awards, etc.)
- View tracking and analytics
- Netflix-inspired responsive design
- Smooth animations and transitions
- Personalized watchlists and history
- Search and filtering capabilities
# Required
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
NEXTAUTH_SECRET=your_nextauth_secret
NEXTAUTH_URL=http://localhost:3000- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy!
The application can be deployed to any platform that supports Node.js applications:
- Railway
- Heroku
- DigitalOcean App Platform
- AWS Amplify
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Netflix for design inspiration
- The Next.js team for an amazing framework
- MongoDB for the flexible database solution
- All the open source libraries that made this possible
Note: This is a learning project and demo application. It's not affiliated with Netflix Inc.