CineVerse-GPT is a movie browsing web application built with React, Tailwind CSS, and integrated with Firebase authentication and the TMDB (The Movie Database) API. The app allows users to sign up, log in, browse movies, watch trailers, and get movie recommendations powered by GPT.
- Login/Sign Up:
- User registration and login functionality.
- Redirects authenticated users to the Browse page.
- Form validation for secure user authentication.
- Firebase Authentication used for sign-in/sign-up.
- User profile management (including display name).
- Sign out functionality.
- Movie Browsing:
- Displays a list of movies fetched from the TMDB API.
- Each movie card contains movie details with a trailer embedded.
- Movie suggestions displayed in a carousel format.
- Responsive UI design with Tailwind CSS.
- Custom hooks to fetch "Now Playing", "Popular", "Top Rated", and "Upcoming" movie data.
- Movie Search:
- Search bar powered by GPT to suggest movies based on user queries.
- Display of suggested movie cards fetched from GPT responses.
- Suggestions shown with movie posters and titles.
- Integration with Gemini API for GPT-based search suggestions.
- Beautiful UI using Tailwind CSS for styling and layout.
- Responsive Design: Mobile-first design, ensuring the app is usable on any device.
- Smooth Scrolling: Used
tailwind-scrollbar-hide
plugin to hide scrollbars in the movie list for a cleaner look.
- Shimmer Loading: Added a Gemini Shimmer loader for better user experience during data loading.
- Trailer Video: Embedded YouTube trailers for each movie using a custom hook.
- Image Optimization: Utilized TMDB Image CDN URL for fast and optimized loading of movie images.
- Frontend: React, Tailwind CSS, Vite (for faster build performance)
- Backend/Authentication: Firebase
- APIs:
- TMDB API for movie data (now playing, popular, etc.)
- Gemini API for GPT-based search functionality
To get started with CineVerse-GPT, follow these steps:
-
Clone the repository:
git clone https://github.com/surajgharpankar28/CineVerse-GPT.git cd cineverse-gpt
-
Install dependencies:
npm install
-
Firebase Setup:
- Create a Firebase project at Firebase Console.
- Set up Firebase Authentication and Firestore (if needed).
- Replace the Firebase configuration in
src/firebase.js
with your Firebase credentials.
-
TMDB Setup:
- Register for an account at TMDB.
- Get your API key and add it to the environment variables in
.env
.
The project uses environment variables to manage API keys and other sensitive information. Ensure you add the following variables to your .env
file:
-
Google Gemini API Key:
- Add your Google Gemini API key to
.env
as:VITE_GOOGLE_GEMINI_API_KEY=your-google-gemini-api-key
- Accessed in the project via
constants.jsx
.
- Add your Google Gemini API key to
-
TMDB API Key:
- Add your TMDB API key to
.env
as:VITE_TMDB_API_KEY=your-tmdb-api-key
- Accessed in the project via
constants.jsx
.
- Add your TMDB API key to
-
Firebase Configuration:
- Add your Firebase configuration as environment variables in
.env
:VITE_FIREBASE_API_KEY=your-firebase-api-key
- Accessed in the project via
firebase.jsx
.
- Add your Firebase configuration as environment variables in
-
constants.jsx
:- This file imports
VITE_GOOGLE_GEMINI_API_KEY
andVITE_TMDB_API_KEY
from the.env
file to manage external API calls.
- This file imports
-
firebase.jsx
:- This file imports Firebase configuration variables (e.g.,
VITE_FIREBASE_API_KEY
) from the.env
file to initialize Firebase.
- This file imports Firebase configuration variables (e.g.,
Here’s an example .env
setup for reference:
VITE_GOOGLE_GEMINI_API_KEY=your-google-gemini-api-key
VITE_TMDB_API_KEY=your-tmdb-api-key
VITE_FIREBASE_API_KEY=your-firebase-api-key
-
Run the app:
npm start
The app will be running at
http://localhost:3000
. -
Deploy to Firebase:
-
Install Firebase CLI:
npm install -g firebase-tools
-
Login to Firebase:
firebase login
-
Deploy the app:
firebase deploy
-
- Fixed Sign-Up display name issue.
- Implemented redirect from
/browse
to login if the user is not authenticated. - Unsubscribed from the
onAuthStateChanged
callback for better performance.
-
MainContainer:
- Includes the background video (movie trailer).
- Movie title and description.
-
SecondaryContainer:
- Displays movie list with movie cards for suggestions.
- TMDB API for providing movie data.
- Firebase for user authentication.
- Gemini API for GPT-based movie suggestions.