A full-stack movie discovery application built with React, Node.js, and MongoDB. Users can browse movies, watch trailers, read reviews, get recommendations, and manage their favorite movies.
- Movie Discovery: Browse popular and top-rated movies from The Movie Database (TMDB)
- Movie Details: View comprehensive movie information, ratings, and descriptions
- Trailer Integration: Watch official movie trailers via YouTube integration
- Movie Reviews: Read user reviews and ratings for movies
- Smart Recommendations: Get personalized movie recommendations based on your interests
- Favorites System: Save and manage your favorite movies with local storage
- Search Functionality: Search for movies by title
- User Registration & Login: Secure user authentication with JWT tokens
- Password Reset: Email-based password recovery system
- Protected Routes: Secure access to user-specific features
- Session Management: Persistent login state with localStorage
- Responsive Design: Mobile-first design that works on all devices
- Modern UI: Clean, intuitive interface with smooth animations
- Loading States: User-friendly loading indicators
- Error Handling: Graceful error handling with user feedback
- Navigation: Intuitive navigation with breadcrumbs and back buttons
- Framework: React 19 with Vite for fast development
- Routing: React Router DOM for client-side navigation
- State Management: React Context API for global state
- Styling: Custom CSS with responsive design
- API Integration: TMDB API for movie data
- Framework: Express.js server
- Database: MongoDB with Mongoose ODM
- Authentication: JWT (JSON Web Tokens)
- Email Service: Nodemailer for password reset emails
- Security: bcryptjs for password hashing
- Frontend: Netlify for static site hosting
- Backend: Netlify Functions for serverless API
- Database: MongoDB Atlas (cloud database)
- Node.js (v18 or higher)
- MongoDB (local or Atlas)
- Git
-
Clone the repository
git clone https://github.com/Webziro/movie-app.git cd movie-app -
Install Frontend Dependencies
cd frontend npm install -
Install Backend Dependencies
cd ../backend npm install -
Install Netlify Functions Dependencies
cd ../netlify/functions npm install
Create a .env file in the backend directory:
# JWT Secret for token generation
JWT_SECRET=your-super-secret-jwt-key-here
# Email Configuration (Gmail)
EMAIL_USER=your-email@gmail.com
EMAIL_PASS=your-app-specific-password
# MongoDB Connection
MONGODB_URI=mongodb://localhost:27017/movie_dbCreate a .env file in the frontend directory:
# API Configuration
VITE_API_URL=http://localhost:3000/api
VITE_TMDB_API_KEY=your-tmdb-api-keyImportant: Never commit your .env file to version control. The .env file is already included in .gitignore.
- Enable 2-Factor Authentication on your Gmail account
- Generate an App Password:
- Go to Google Account settings
- Security β 2-Step Verification β App passwords
- Generate a password for "Mail"
- Use this password in
EMAIL_PASS(not your regular Gmail password)
- Visit The Movie Database
- Create an account and request an API key
- Add your API key to the frontend environment variables
-
Start the Backend Server
cd backend npm run devServer runs on
http://localhost:3000 -
Start the Frontend Development Server
cd frontend npm run devFrontend runs on
http://localhost:5173 -
Access the Application
- Open your browser and navigate to
http://localhost:5173 - Register a new account or login with existing credentials
- Open your browser and navigate to
-
Build the Frontend
cd frontend npm run build -
Deploy to Netlify
- Connect your GitHub repository to Netlify
- Set build command:
cd netlify/functions && npm install && cd ../../frontend && npm install && npm run build - Set publish directory:
frontend/dist
movie-app/
βββ frontend/ # React frontend application
β βββ src/
β β βββ components/ # Reusable React components
β β βββ pages/ # Page components
β β βββ contexts/ # React Context providers
β β βββ services/ # API service functions
β β βββ css/ # Stylesheets
β β βββ assets/ # Static assets
β βββ public/ # Public assets
β βββ dist/ # Production build output
βββ backend/ # Node.js backend server
β βββ api/ # API documentation
β βββ server.js # Main server file
βββ netlify/
β βββ functions/ # Netlify serverless functions
βββ netlify.toml # Netlify configuration
βββ README.md # This file
POST /api/register- User registrationPOST /api/login- User loginPOST /api/forgot-password- Request password resetPOST /api/reset-password- Reset password with token
GET /api/user- Get user profilePUT /api/change-password- Change user password
POST /api/contact- Send contact message
- MovieCard: Displays movie information with action buttons
- NavBar: Navigation header with authentication state
- MovieDetails: Detailed movie view with recommendations
- MovieRecommendations: Personalized movie suggestions
- MovieReviews: User reviews and ratings display
- Home: Movie discovery dashboard
- Login/Register: Authentication pages
- MovieDetails: Individual movie information
- Favorites: User's saved movies
- Contact: Contact form
- JWT Authentication: Secure token-based authentication
- Password Hashing: bcryptjs for secure password storage
- Protected Routes: Authentication required for sensitive features
- Email Verification: Secure password reset via email
- Input Validation: Server-side input validation and sanitization
- Connect your GitHub repository to Netlify
- Configure build settings in
netlify.toml - Set environment variables in Netlify dashboard
- Deploy automatically on git push
# Backend
JWT_SECRET=your-production-jwt-secret
EMAIL_USER=your-production-email
EMAIL_PASS=your-production-email-password
MONGODB_URI=your-production-mongodb-uri
# Frontend
VITE_API_URL=your-netlify-functions-url
VITE_TMDB_API_KEY=your-tmdb-api-key- React 19 - UI framework
- React Router DOM - Client-side routing
- Vite - Build tool and development server
- CSS3 - Styling and responsive design
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - Database
- Mongoose - ODM for MongoDB
- JWT - Authentication tokens
- bcryptjs - Password hashing
- Nodemailer - Email service
- Netlify - Frontend hosting and serverless functions
- MongoDB Atlas - Cloud database
- GitHub - Version control and CI/CD
- 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.
- Webziro - Initial work - GitHub
- The Movie Database (TMDB) for movie data
- React for the amazing frontend framework
- Netlify for hosting and serverless functions
- MongoDB for the database solution
If you have any questions or need help with the project, please:
- Open an issue on GitHub
- Contact us through the contact form in the application
- Check the documentation in the
backend/api/directory
Happy Movie Watching! πΏ