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.
# 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
- β‘ 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
- π 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
- π 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
- Sort by: Date, Title, Your Rating, IMDb Rating, Year
- Filter by: All, 7+, 8+, 9+ ratings
| 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 |
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
Clean imports, no more ../../../:
import { useMovies } from "@hooks";
import { MovieList } from "@features/movies";
import { Box, Loader } from "@components/ui";- Node.js (v18+)
- npm or yarn
- OMDb API Key (Get free key)
-
Clone repository
git clone <your-repo-url> cd usePopcorn
-
Install dependencies
npm install
-
Environment setup
# Copy example file cp .env.local.example .env.local # Edit .env.local VITE_OMDB_API_KEY=your_actual_api_key
-
Run development server
npm run dev
-
Build for production
npm run build npm run preview
- Type 3+ characters β Instant results
- Use pagination arrows for more results
- Click search bar when empty β See history
- Search and click a movie
- Rate with stars (1-10)
- Add personal notes (optional)
- Click "Add to Watched"
- Tabs: Switch between Watched, To Watch, Favorites
- Edit: Click βοΈ to update ratings/notes
- Delete: Click X to remove
- Favorite: Click β€οΈ to toggle
- Use dropdowns in Watched tab
- Sort: Date, Title, Rating, Year
- Filter: 7+, 8+, 9+ ratings
- Export: Download JSON backup
- Import: Restore from file
- Click π/βοΈ button to toggle
- Preference saved automatically
| Key | Action |
|---|---|
Enter |
Focus search bar |
Escape |
Close movie details |
- β‘ 30x faster dev server startup
- π Instant HMR - changes reflect immediately
- π¦ 30% smaller bundle size
- π Modular structure - 40+ organized files
- π― Feature-based - easy to find code
- π Reusable components - DRY principle
- π¦ Barrel exports - clean imports
- π£οΈ Path aliases - no more
../../../ - π¨ Better organization - clear structure
- π§ͺ Testable - small, focused modules
- π Well documented - inline comments
| 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 |
| 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 |
# 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 ESLintvite.config.js- Vite configurationjsconfig.json- Path aliases for IDE.eslintrc.cjs- ESLint rulesindex.html- HTML entry point
| 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 |
- VITE_MIGRATION.md - Migration details
- FEATURES.md - Complete feature list
- SETUP.md - Detailed setup guide
- CHANGELOG.md - Version history
Every file has comprehensive comments explaining:
- Component purpose
- Function parameters
- Complex logic
- Usage examples
mkdir src/features/my-feature// src/features/my-feature/MyComponent.jsx
export default function MyComponent() {
return <div>My Feature</div>;
}// src/features/my-feature/index.js
export { default as MyComponent } from "./MyComponent";import { MyComponent } from "@features/my-feature";Contributions welcome! Please:
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing) - Open Pull Request
MIT License - See LICENSE file
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Migrated from Create React App to Vite
- Restructured with modular architecture
- 40+ files instead of 1 monolithic file
- Lightning-fast development experience
- Instant hot module replacement
- Smaller production bundles
- Feature-based organization
- Path aliases for clean imports
- Barrel exports for easy importing
- Comprehensive inline documentation
- 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