MovieBox is a sleek, full-stack web application for discovering movies and TV shows, built with the latest MERN stack technologies. Inspired by the user interfaces of popular streaming platforms, this project delivers a rich, interactive, and fully responsive user experience, complete with a custom backend and a robust user authentication system.
Immersive Home Page with a Dynamic Hero Section

Seamless User Authentication

Personalized User Dashboard & Profile

Interactive & Persistent Favorites

Highly Scalable Detail Page with Favorite Functionality

Full-Screen, Real-Time Search

This project implements a collection of modern features and follows best practices for scalability and maintainability.
-
Full-Stack User System (MERN Stack):
- Custom JWT Authentication: A complete authentication system built from scratch with user Registration and Login.
- Secure Password Handling: User passwords are securely hashed using bcrypt.js before being stored in the database.
- Token-Based Sessions: Manages user sessions using JSON Web Tokens (JWT) for secure API communication.
- Personalized User Dashboard: A protected profile page for each user, displaying their username, a randomly assigned profile picture, and their total watch time.
- Persistent Favorites List: Users can add or remove movies/shows from a personal favorites list, which is saved permanently in the MongoDB database.
- Protected Routes: Sensitive routes like the user profile are accessible only to authenticated users.
-
Type-Safe & Maintainable Codebase:
- Fully migrated to TypeScript, ensuring a robust, error-free, and highly maintainable codebase.
- Centralized type definitions for API models, providing a single source of truth.
-
Clean & Scalable Architecture:
- Backend Architecture: The backend follows a clean, MVC-like pattern with a clear separation of Routes, Controllers, Models, and Middleware.
- Reusable Components & Custom Hooks: The frontend leverages reusable UI components and custom hooks like
useFavoriteStatusanduseDebounceto maintain a DRY codebase.
-
Intelligent Backend Logic:
- The server acts as an intelligent proxy, fetching detailed movie information (like accurate runtime) from the external TMDB API before saving it to the local database, ensuring data integrity.
-
Engaging Visual Effects:
- 3D Tilt Effect on movie cards created with
useReffor optimal performance. - Smooth and fluid animations throughout the application using Framer Motion.
- Glassmorphism effect on the navigation bar that appears on scroll.
- 3D Tilt Effect on movie cards created with
- Frontend:
- React.js & TypeScript: For a type-safe, component-based UI.
- Vite: A modern build tool for a blazing-fast development experience.
- Tailwind CSS: A utility-first CSS framework for rapid and professional styling.
- React Router DOM: For client-side routing.
- Framer Motion: For implementing complex and smooth animations.
- Axios: For making HTTP requests to the backend API.
- Backend:
- Node.js: JavaScript runtime for the server.
- Express.js: Web framework for building the REST API.
- MongoDB: NoSQL database for storing user and favorites data.
- Mongoose: Object Data Modeling (ODM) library for MongoDB.
- JSON Web Tokens (JWT): For generating authentication tokens.
- Bcrypt.js: For secure password hashing.
- CORS & Dotenv: For managing cross-origin requests and environment variables.
The project is organized into a monorepo structure with separate directories for the client and server.
movie-box/
βββ client/ # Frontend React App
β βββ src/
β β βββ api/
β β βββ components/
β β β βββ pages/
β β β βββ profile/
β β β βββ UI/
β β βββ context/
β β βββ hooks/
β β βββ types/
β β βββ utils/
β βββ package.json
βββ server/ # Backend Node.js App
β βββ config/
β βββ controllers/
β βββ middleware/
β βββ models/
β βββ routes/
β βββ package.json
βββ package.json # Root (for concurrent script)
To run this project locally, follow these steps:
-
Clone the repository:
git clone [https://github.com/](https://github.com/)<YOUR_USERNAME>/movie-box.git cd movie-box
-
Backend Setup:
- Navigate to the server directory:
cd server - Install dependencies:
npm install - Create a
.envfile in theserverdirectory and add the following variables:PORT=5001 MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_super_secret_key TMDB_API_KEY=your_tmdb_api_key_v3
- Navigate to the server directory:
-
Frontend Setup:
- From the root directory, navigate to the client directory:
cd ../client - Install dependencies:
npm install - Create a
.envfile in theclientdirectory and add the following variables:VITE_TMDB_API_KEY=your_tmdb_api_key_v3 VITE_API_URL=http://localhost:5001/api/v1
- From the root directory, navigate to the client directory:
-
Run the project:
- Return to the root directory of the project (
cd ..). - Run the concurrent script to start both the server and client:
npm run dev
- You can now view the project at
http://localhost:5173(or whatever port your client is running on).
- Return to the root directory of the project (
This project is licensed under the MIT License.
This project uses data and images provided by The Movie Database (TMDB) API.