An open API service indexing awesome lists of open source software.

https://github.com/ucangun/cinewave_movie_app

CineWave is a movie app where users can search for movies, view details, watch trailers, and manage their favorites. It integrates Firebase authentication and TMDB API, built using React, Context API, Tailwind CSS, and Axios for seamless data handling.
https://github.com/ucangun/cinewave_movie_app

Last synced: about 2 months ago
JSON representation

CineWave is a movie app where users can search for movies, view details, watch trailers, and manage their favorites. It integrates Firebase authentication and TMDB API, built using React, Context API, Tailwind CSS, and Axios for seamless data handling.

Awesome Lists containing this project

README

        

# CineWave_Movie_App

https://cine-wave-movie-app.vercel.app/

## 🎯 Project Purpose

**CineWave** is a movie application that allows users `to authenticate using Firebase Auth`, either via email and password or Google authentication. After logging in, users can explore movie data sourced from `The Movie Database (TMDB)`, which is fetched using `Axios` with `async/await` for seamless data handling.

The main objectives of this project are to enhance skills in:

- `React`
- `Context API`
- `Router`
- `Firebase`
- `Tailwind CSS`

while implementing effective user authentication and providing a rich user experience with movie details.

## πŸ” User Authentication and Workflow

CineWave’s user authentication and navigation workflow ensures a seamless and secure experience:

1. **πŸ“ User Registration and Login:**

- Users can sign up or log in using **email/password** or **Google authentication**. This is managed through `Firebase Auth` in `AuthContext`.
- Successful login triggers a `Toastify` πŸŽ‰ **success notification**, while errors (e.g., wrong password, user not found) trigger appropriate ⚠️ **warning notifications**.

2. **πŸ”„ Navigation Bar Update:**

- Once logged in, the **β€œLogin” button** in the navigation bar changes to display the user’s **profile photo** fetched from Google or Firebase.

3. **πŸŽ₯ Accessing Movie Details:**

- Users can navigate to the **movie details page** by clicking on a movie image. If the user is not logged in, they will be **redirected** to the login page with a ⚠️ **warning notification**.
- Upon successful login, users can view **movie details**, watch **trailers**, and add movies to their **favorites list** ❀️.

4. **πŸ”’ Private Route Protection:**

- The application uses a `PrivateRoute` component to protect sensitive pages like **movie details**. If a user attempts to access these pages without being authenticated, they are **redirected** to the login page.

5. **🌐 Movie API Integration:**

- Movie data, including details and trailers, is fetched using `Axios` in an **asynchronous** manner, ensuring the application remains responsive. Custom API functions defined in `MovieApi.js` handle the requests and data formatting.

6. **πŸ”‘ Password Reset:**
- Users can reset their passwords via a **password reset page**. This is managed through Firebase’s password reset functionality, and notifications are provided through `Toastify` πŸ“§.

## Outcome

![CineWave Movie App](https://github.com/user-attachments/assets/f5b2d64b-5083-440d-8003-ec2fb261e8f1)

## Project Structure

```
|--CineWave_Movie_App(folder)
|
β”œβ”€β”€ public
β”‚ └── index.html
β”œβ”€β”€ src
β”‚ β”œβ”€β”€ assets
β”‚ β”‚ └── [images]
β”‚ β”œβ”€β”€ auth
β”‚ β”‚ └── firebase-config.js
β”‚ β”œβ”€β”€ components
β”‚ β”‚ β”œβ”€β”€ Button.jsx
β”‚ β”‚ β”œβ”€β”€ Header.jsx
β”‚ β”‚ β”œβ”€β”€ InputField.jsx
β”‚ β”‚ β”œβ”€β”€ LoginForm.jsx
β”‚ β”‚ β”œβ”€β”€ Logo.jsx
β”‚ β”‚ β”œβ”€β”€ MovieCard.jsx
β”‚ β”‚ β”œβ”€β”€ MovieCard.jsx
β”‚ β”‚ β”œβ”€β”€ Navbar.jsx
β”‚ β”‚ β”œβ”€β”€ ResetForm.jsx
β”‚ β”‚ β”œβ”€β”€ Search.jsx
β”‚ β”‚ β”œβ”€β”€ SignUpForm.jsx
β”‚ β”‚ β”œβ”€β”€ Slider.jsx
β”‚ β”‚ β”œβ”€β”€ Switch.jsx
β”‚ β”‚ └── Spinner.jsx
β”‚ β”œβ”€β”€ contexts
β”‚ β”‚ └── AuthProvider.jsx
β”‚ β”œβ”€β”€ helpers
β”‚ β”‚ └── ToastNotify.js
β”‚ β”œβ”€β”€ pages
β”‚ β”‚ β”œβ”€β”€ Home.jsx
β”‚ β”‚ β”œβ”€β”€ Login.jsx
β”‚ β”‚ β”œβ”€β”€ MovieDetails.jsx
β”‚ β”‚ β”œβ”€β”€ Movies.jsx
β”‚ β”‚ β”œβ”€β”€ NotFound.jsx
β”‚ β”‚ β”œβ”€β”€ Reset.jsx
β”‚ β”‚ └── SignUp.jsx
β”‚ β”œβ”€β”€ router
β”‚ β”‚ β”œβ”€β”€ AppRouter.jsx
β”‚ β”‚ └── PrivateRouter.jsx
β”‚ β”œβ”€β”€ services
β”‚ β”‚ └── MovieApi.js
β”‚ β”œβ”€β”€ App.js
β”‚ β”œβ”€β”€ index.css
β”‚ └── index.js
β”‚
β”œβ”€β”€ .gitignore
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ package.json
└── README.md
```

## ✨ Project Features

- **πŸ” User Authentication**: Users can sign up and log in using `Firebase Auth via email/password or Google authentication`. All authentication functions are managed through `AuthContext using Context API`, making them accessible across the application. `Successful or failed login/logout actions trigger Toastify notifications (success, warning, error) to keep the user informed`.

- **πŸ”„ Dynamic Navbar**: Upon successful login, the "Login" button in the navbar is replaced with the user's profile photo, enhancing the user experience.

- **πŸŽ₯ Movie Data Integration**: The movie data is sourced from `The Movie Database (TMDB) API`. Data is fetched using `Axios with async/await`, ensuring smooth and efficient data retrieval. `Custom API functions are defined in MovieApi.js within the services directory, making it easy to reuse and maintain API calls across the application`.

- **πŸ”’ Protected Routes**: Users can browse the homepage freely, but attempting to view movie details without being logged in will trigger a Toastify warning, and they will be redirected to the login page. Once authenticated, they can view detailed movie information, trailers, and add movies to their favorites.

- **♻️ Reusable Components**: The project follows the `DRY (Don’t Repeat Yourself) principle` by using reusable components like `InputField.jsx` for form inputs and `Button.jsx` for buttons. These components accept props for customization, allowing for consistent and maintainable UI elements throughout the application.

- **🌐 Routing**: `React Router` is used for navigation between different pages. `useNavigate` and `useParams` are used for programmatic navigation and accessing route information.

- **πŸ—ƒοΈ State Management**: The application’s state, including authentication and movie data, is managed through `Context API`, ensuring a global and consistent state across the app.

- **🎨 Styling**: The entire application is styled using `Tailwind CSS`, providing a `responsive, modern, and visually appealing design`.

- **πŸ” Search Functionality**: Users can search for movies by title through a search bar. The search results are dynamically fetched and displayed, allowing users to explore various movies.

- **πŸŒ— Dark Mode Toggle**: The application includes a dark mode toggle feature accessible via a button in the navbar, allowing users to switch between light and dark themes for a personalized viewing experience.

## πŸš€ Technologies Used

- **ReactJS**: For building the user interface and managing the component structure.
- **Firebase Auth**: For secure user authentication via email/password and Google authentication.
- **Context API**: For global state management, particularly for user authentication and movie data.
- **Axios with async/await**: For handling HTTP requests to `The Movie Database (TMDB)` API.
- **Tailwind CSS**: For styling the application, providing a responsive and modern design.
- **React Router**: For managing page navigation, including private routes that protect sensitive pages.
- **Toastify**: For providing user feedback through notifications during authentication and data operations.
- **Local Storage**: To save and persist favorite movies locally, allowing users to access their favorite list even after page refreshes.
- **API**: Movie data is fetched from [The Movie Database (TMDB) API](https://www.themoviedb.org/documentation/api) using the following endpoint:
- `https://api.themoviedb.org/3/movie/{movie_id}?api_key=YOUR_API_KEY`

### πŸ“š At the end of the project, will be able to;

By completing the **CineWave** project, you will have gained valuable experience and will be able to:

- **Implement user authentication** using Firebase Auth, including email/password and Google authentication.
- **Manage global state** effectively with Context API, ensuring consistent state management across the application.
- **Fetch and handle data** from external APIs using Axios with async/await, ensuring smooth and efficient data retrieval.
- **Protect routes** using PrivateRoute components to ensure that only authenticated users can access sensitive information.
- **Utilize Local Storage** to persist user preferences, such as saving favorite movies, across sessions.
- **Apply Tailwind CSS** to create responsive, modern, and visually appealing web applications.
- **Create reusable components** in React to adhere to the DRY principle, improving code maintainability and reusability.
- **Provide user feedback** using Toastify, enhancing the user experience by displaying success, warning, and error notifications.
- **Navigate between pages** effectively using React Router, including handling private and dynamic routes.

These skills are essential for developing complex and feature-rich React applications and will serve as a solid foundation for future projects.

🍿 Enjoy Your Movie Time with CineWave! 🎬