Skip to content

Movie Discovery App ,movie platform for discovering, organizing, and tracking films with intelligent search and personal collections. Features: Smart Search - Real-time movie discovery with OMDb API Personal Lists - Watchlist, favorites, and watched movies Analytics - Viewing habits and preferences dashboard Responsive Des

Notifications You must be signed in to change notification settings

zacktam12/cinemacollector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

60 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍿 usePopcorn - Movie Tracker (Vite + Modular Architecture)

React Vite License

A lightning-fast, feature-rich React application for searching, tracking, and managing your movie watchlist. Built with Vite for blazing performance and organized with a modular, feature-based architecture.


⚑ Quick Start

# 1. Install dependencies
npm install

# 2. Create .env.local file
cp .env.local.example .env.local
# Edit .env.local and add your OMDb API key

# 3. Start dev server (< 1 second!)
npm run dev

πŸŽ‰ Done! App runs at http://localhost:3000


✨ Features

🎬 Core

  • ⚑ Lightning Fast - Powered by Vite (<1s dev server startup)
  • πŸ” Movie Search - Real-time search with OMDb API
  • πŸ“„ Pagination - Browse all search results
  • 🎯 Movie Details - Comprehensive information

πŸ“Š Management

  • πŸ“ Watched List - Track with ratings & notes
  • πŸ“Œ To Watch List - Save for later
  • ❀️ Favorites - Quick access to favorites
  • ✏️ Edit Ratings - Update anytime
  • πŸ“Š Statistics - Genre analytics & averages

🎨 User Experience

  • πŸŒ“ Dark/Light Theme - Toggle with persistence
  • πŸ“± Fully Responsive - Mobile, tablet, desktop
  • ⌨️ Keyboard Shortcuts - Enter, Escape
  • πŸ” Search History - Last 10 searches
  • πŸ“₯ Export/Import - Backup as JSON

🎯 Sorting & Filtering

  • Sort by: Date, Title, Your Rating, IMDb Rating, Year
  • Filter by: All, 7+, 8+, 9+ ratings

πŸ“¦ Tech Stack

Technology Purpose
Vite Build tool (30x faster than webpack)
React 18 UI library
Custom Hooks Reusable logic
LocalStorage Data persistence
OMDb API Movie database
CSS Variables Theming

πŸ—οΈ Architecture

Modular Structure

src/
β”œβ”€β”€ main.jsx              # Entry point
β”œβ”€β”€ App.jsx               # Main orchestrator
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ ui/               # Shared UI components
β”‚   β”‚   β”œβ”€β”€ Box, Loader, ErrorMessage
β”‚   β”‚   β”œβ”€β”€ EmptyState, Pagination, Tabs
β”‚   β”‚   └── index.js
β”‚   └── StarRating.jsx    # Rating component
β”œβ”€β”€ features/
β”‚   β”œβ”€β”€ search/           # Search functionality
β”‚   β”œβ”€β”€ movies/           # Movie display
β”‚   β”œβ”€β”€ lists/            # List management
β”‚   └── theme/            # Theming
β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ useKey.js         # Keyboard events
β”‚   β”œβ”€β”€ useLocalStorageState.js
β”‚   └── useMovies.js      # API fetching
β”œβ”€β”€ services/
β”‚   └── omdbApi.js        # API client
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ constants.js      # App constants
β”‚   └── helpers.js        # Utility functions
└── styles/
    └── index.css         # Global styles

Path Aliases

Clean imports, no more ../../../:

import { useMovies } from "@hooks";
import { MovieList } from "@features/movies";
import { Box, Loader } from "@components/ui";

πŸš€ Getting Started

Prerequisites

Installation

  1. Clone repository

    git clone <your-repo-url>
    cd usePopcorn
  2. Install dependencies

    npm install
  3. Environment setup

    # Copy example file
    cp .env.local.example .env.local
    
    # Edit .env.local
    VITE_OMDB_API_KEY=your_actual_api_key
  4. Run development server

    npm run dev
  5. Build for production

    npm run build
    npm run preview

πŸ“– Usage Guide

Search Movies

  • Type 3+ characters β†’ Instant results
  • Use pagination arrows for more results
  • Click search bar when empty β†’ See history

Add to Watched

  1. Search and click a movie
  2. Rate with stars (1-10)
  3. Add personal notes (optional)
  4. Click "Add to Watched"

Manage Lists

  • Tabs: Switch between Watched, To Watch, Favorites
  • Edit: Click ✏️ to update ratings/notes
  • Delete: Click X to remove
  • Favorite: Click ❀️ to toggle

Sort & Filter

  • Use dropdowns in Watched tab
  • Sort: Date, Title, Rating, Year
  • Filter: 7+, 8+, 9+ ratings

Backup Data

  • Export: Download JSON backup
  • Import: Restore from file

Theme

  • Click πŸŒ™/β˜€οΈ button to toggle
  • Preference saved automatically

⌨️ Keyboard Shortcuts

Key Action
Enter Focus search bar
Escape Close movie details

🎯 Key Improvements (v2.0)

Performance

  • ⚑ 30x faster dev server startup
  • πŸš€ Instant HMR - changes reflect immediately
  • πŸ“¦ 30% smaller bundle size

Architecture

  • πŸ“ Modular structure - 40+ organized files
  • 🎯 Feature-based - easy to find code
  • πŸ”„ Reusable components - DRY principle
  • πŸ“¦ Barrel exports - clean imports

Developer Experience

  • πŸ›£οΈ Path aliases - no more ../../../
  • 🎨 Better organization - clear structure
  • πŸ§ͺ Testable - small, focused modules
  • πŸ“š Well documented - inline comments

πŸ“‚ Project Structure

By Feature

Feature Location Description
Search src/features/search/ Search bar, results counter
Movies src/features/movies/ Movie list, details view
Lists src/features/lists/ Watched, To Watch, Favorites
Theme src/features/theme/ Dark/light toggle

By Type

Type Location Description
UI Components src/components/ui/ Shared components
Hooks src/hooks/ Custom React hooks
Services src/services/ API integration
Utils src/utils/ Helper functions
Styles src/styles/ Global CSS

πŸ› οΈ Scripts

# Development
npm run dev          # Start dev server (Vite)
npm run build        # Build for production
npm run preview      # Preview production build

# Code Quality
npm run lint         # Run ESLint

πŸ”§ Configuration Files

  • vite.config.js - Vite configuration
  • jsconfig.json - Path aliases for IDE
  • .eslintrc.cjs - ESLint rules
  • index.html - HTML entry point

πŸ“Š Performance Metrics

Metric Before (CRA) After (Vite) Improvement
Dev Start ~30s <1s 30x faster
HMR ~3s <100ms 30x faster
Build ~60s ~15s 4x faster
Bundle ~500KB ~350KB 30% smaller

πŸŽ“ Learning Resources

Documentation

Inline Comments

Every file has comprehensive comments explaining:

  • Component purpose
  • Function parameters
  • Complex logic
  • Usage examples

🧩 Adding New Features

1. Create Feature Module

mkdir src/features/my-feature

2. Add Components

// src/features/my-feature/MyComponent.jsx
export default function MyComponent() {
  return <div>My Feature</div>;
}

3. Create Barrel Export

// src/features/my-feature/index.js
export { default as MyComponent } from "./MyComponent";

4. Use in App

import { MyComponent } from "@features/my-feature";

🀝 Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing)
  5. Open Pull Request

πŸ“ License

MIT License - See LICENSE file


πŸ™ Acknowledgments


πŸ“§ Contact


πŸŽ‰ What's New in v2.0

✨ Complete Rewrite

  • Migrated from Create React App to Vite
  • Restructured with modular architecture
  • 40+ files instead of 1 monolithic file

⚑ Performance

  • Lightning-fast development experience
  • Instant hot module replacement
  • Smaller production bundles

🎨 Code Quality

  • Feature-based organization
  • Path aliases for clean imports
  • Barrel exports for easy importing
  • Comprehensive inline documentation

πŸ§ͺ Maintainability

  • Small, focused components
  • Single responsibility principle
  • Easy to test and extend
  • Clear folder structure

Enjoy your lightning-fast movie tracker! 🍿⚑

Built with ❀️ using React + Vite

About

Movie Discovery App ,movie platform for discovering, organizing, and tracking films with intelligent search and personal collections. Features: Smart Search - Real-time movie discovery with OMDb API Personal Lists - Watchlist, favorites, and watched movies Analytics - Viewing habits and preferences dashboard Responsive Des

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published