Skip to content

Movie discovery and rating application that integrates with OMDB API for movie search, features 5-star rating system, personal watchlist management, statistics tracking, and localStorage persistence for user data.

Notifications You must be signed in to change notification settings

TheArashGhanbari/UsePopCorn

Repository files navigation

usePopCorn - Movie Rating Application

A React-based movie discovery and rating application that allows users to search for movies, view details, rate them, and maintain a personal watchlist with comprehensive movie information.

Overview

usePopCorn is a comprehensive movie application that provides:

  • Movie search and discovery functionality
  • Detailed movie information and ratings
  • Personal movie rating system
  • Watchlist management
  • Movie recommendations
  • Responsive design for all devices

Features

  • Movie Search: Search for movies using the OMDB API
  • Movie Details: View comprehensive movie information including ratings, cast, and plot
  • Personal Ratings: Rate movies with a 5-star system
  • Watchlist: Maintain a personal list of watched movies
  • Statistics: View average ratings and watch statistics
  • Responsive Design: Optimized for desktop, tablet, and mobile
  • Keyboard Navigation: Enhanced accessibility with keyboard shortcuts

Technical Stack

  • Frontend: React 19.0.0
  • API Integration: OMDB API for movie data
  • Build Tool: Vite 6.1.0
  • State Management: React hooks (useState, useEffect)
  • Styling: CSS with modern design patterns
  • Development: ESLint for code quality

Getting Started

Prerequisites

  • Node.js (version 18 or higher)
  • npm or yarn
  • OMDB API key (free at omdbapi.com)

Installation

  1. Clone the repository
  2. Navigate to the project directory:
    cd Websites/usePopCorn/main
  3. Install dependencies:
    npm install
  4. Set up your OMDB API key in the src/App.jsx file:
    const KEY = "your-omdb-api-key-here";
  5. Start the development server:
    npm run dev
  6. Open your browser and visit http://localhost:5173

Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run lint - Run ESLint
  • npm run preview - Preview production build

Project Structure

src/
├── App.jsx                    # Main application component
├── data.js                    # Static data and constants
├── index.css                  # Global styles
├── main.jsx                   # Application entry point
├── StarRating.jsx             # Star rating component
├── useKey.js                  # Custom hook for keyboard events
├── useLocalStorage.js         # Custom hook for localStorage
└── useMovies.js               # Custom hook for movie API

Key Components

Movie Search

  • Search input with real-time results
  • Movie poster and basic information display
  • Click to view detailed movie information

Movie Details

  • Comprehensive movie information
  • Star rating system (1-5 stars)
  • Add to watched list functionality
  • Movie poster and plot summary

Watchlist Management

  • List of rated movies
  • Average rating calculation
  • Remove movies from watchlist
  • Watch statistics

Statistics

  • Total number of watched movies
  • Average rating across all movies
  • Rating distribution

Custom Hooks

useMovies

  • Handles movie search functionality
  • Manages API calls to OMDB
  • Error handling and loading states
  • Movie data management

useLocalStorage

  • Persists watchlist data in localStorage
  • Handles data serialization/deserialization
  • Provides consistent data access

useKey

  • Manages keyboard event listeners
  • Handles Enter key for search focus
  • Enhances accessibility

API Integration

The application integrates with the OMDB API:

  • Search: Find movies by title
  • Details: Get comprehensive movie information
  • Posters: Display movie posters
  • Ratings: Access IMDB and other ratings

Features in Detail

Search Functionality

  • Real-time search results
  • Movie poster thumbnails
  • Basic movie information
  • Click to expand details

Rating System

  • 5-star rating interface
  • Personal rating storage
  • Average rating calculation
  • Rating validation

Watchlist Features

  • Add movies to personal list
  • Remove movies from list
  • Persistent storage
  • Watch statistics

User Experience

  • Responsive design
  • Loading states
  • Error handling
  • Keyboard navigation
  • Smooth animations

Data Persistence

The application uses localStorage to persist:

  • Watched movies list
  • Personal ratings
  • User preferences

Styling

The application features:

  • Clean, modern design
  • Responsive layout
  • Interactive star ratings
  • Movie poster displays
  • Loading and error states

Contributing

This is a comprehensive movie application demonstrating:

  • API integration with external services
  • Custom React hooks
  • Local storage management
  • Component composition
  • State management with hooks
  • Responsive design principles
  • Accessibility features

License

This project is for educational purposes.

About

Movie discovery and rating application that integrates with OMDB API for movie search, features 5-star rating system, personal watchlist management, statistics tracking, and localStorage persistence for user data.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published