MovieAI is an AI-powered movie discovery application designed to enhance your cinematic experience. With a sleek interface, curated recommendations, and real-time data, MovieAI connects you to trending movies and personal favorites with ease.
-
Discover Movies: Browse trending and top-rated movies using AI recommendations.
-
User Profiles: Manage individual user profiles with Firebase authentication.
-
Interactive UI: Dynamic interface built with React and styled using Tailwind CSS.
-
Real-Time Updates: Fetch now-playing movies using custom hooks (
useNowPlayingMovies.jsx
). -
Video Backgrounds: Enhance the experience with video previews for selected movies.
Follow these steps to set up the project locally:
- Clone the Repository:
git clone https://github.com/your-username/movieAi.git
cd movieAi
- Install Dependencies:
npm install
- Run the Development Server:
npm run dev
- Open your browser at http://localhost:5173.
-
Browse Movies: Use the Browse component to explore trending movies or filter genres.
-
Login: Navigate to the Login page to authenticate using Firebase.
-
Dynamic Components: Experience dynamic loading with components like MainContainer and SecondaryContainer.
-
Firebase Configuration: Update the Firebase project settings in
Firebase.jsx
located in thesrc/utils
directory. -
Tailwind CSS: Customize the styles in
tailwind.config.js
. -
Redux Slices: Modify application state behavior in
moviesSlice.jsx
anduserSlice.jsx
undersrc/utils
.
-
Login/Sign Up
-
Sign in and sign up forms powered by Firebase Authentication.
-
User profiles and data management.
-
Use of
useRef
hook for efficient form handling. -
Form validation for secure user input.
-
Firebase Setup
-
Firebase initialized with proper configuration for user authentication.
-
Ability to create and update user profiles.
-
Bugfixes for updating display names and profile pictures.
-
Routing and Navigation
-
Protected routes with login redirection if the user is not authenticated.
-
Conditional redirects for authenticated users.
-
Movie Data Integration
-
Register TMDB API for fetching movie data, including now playing and top-rated movies.
-
Use custom hooks to manage movie data (
useNowPlayingMovies
,usePopularMovies
). -
Created Redux slices (
moviesSlice
,gptSlice
) to manage movie-related data in the state. -
AI-Powered Movie Suggestions
-
Integrate OpenAI's GPT-3 for movie suggestions.
-
Create a responsive movie suggestion interface using a reusable Movie List and Movie Card components.
-
Responsive UI: TailwindCSS-based styles ensure the app is mobile-friendly and visually appealing.
-
Video Backgrounds: Tailor the movie-watching experience with YouTube trailer videos in the background.
-
Main and Secondary Containers: Use dynamic and engaging containers for movie display and suggestions.
-
Memoization: Ensure performance optimization by memoizing components that render movie data.
-
Efficient State Management: Use Redux for centralized state management and to avoid prop drilling.
Before starting the project, please add the .env
file and add your TMDB and OpenAI API keys into it.
-
Create a
.env
file in the root of your project (same level asvite.config.js
). -
Add the following keys to the
.env
file:
VITE_TMDB_API_KEY=your_tmdb_api_key
VITE_OPENAI_API_KEY=your_openai_api_key
- Vite automatically injects variables starting with
VITE_
into the application, so you can access these values in your code usingimport.meta.env
.
For example:
const tmdbApiKey = import.meta.env.VITE_TMDB_API_KEY;
const openAiApiKey = import.meta.env.VITE_OPENAI_API_KEY;
We welcome contributions! Follow these steps:
-
Fork the repository.
-
Create a feature branch:
git checkout -b feature/your-feature
- Commit your changes:
git commit -m "Add your feature"
- Push to your branch:
git push origin feature/your-feature
- Open a pull request.
- Ensure all dependencies are installed:
npm install
- Run linting to maintain code quality:
npm run lint
- Test the application in the browser by running:
npm run dev
This project is licensed under the MIT License. Feel free to use, modify, and distribute this project as per the terms of the license.
-
React: For providing the foundation of the app's UI.
-
Redux Toolkit: For managing global state seamlessly.
-
Firebase: For authentication and real-time backend services.
-
Tailwind CSS: For modern and responsive styling.