A modern, responsive movie discovery application built with React and powered by The Movie Database (TMDB) API. Features real-time search, trending movies based on user search analytics, and a sleek user interface.
- Real-time Movie Search: Debounced search with instant results
- Trending Movies: Dynamic trending section based on search analytics
- Search Analytics: Track popular searches using Appwrite database
- Responsive Design: Optimized for all device sizes
- Fast Performance: Built with Vite for lightning-fast development and builds
- Modern UI: Beautiful gradient designs and smooth animations
- React 19.1.0 - Modern React with hooks and latest features
- Vite 7.0.4 - Next-generation frontend build tool
- Tailwind CSS 4.1.11 - Utility-first CSS framework
- React-Use 17.6.0 - Essential React hooks collection
- TMDB API - The Movie Database for movie data
- Appwrite 18.1.1 - Backend-as-a-Service for search analytics
- ESLint - Code linting and quality assurance
- Vite Plugin React - Fast Refresh and HMR support
React-app/
├── public/ # Static assets
│ ├── hero-bg.png # Background pattern image
│ ├── hero.png # Hero section image
│ ├── logo.png # Application logo
│ ├── no-movie.png # Placeholder for missing posters
│ ├── search.svg # Search icon
│ └── star.svg # Rating star icon
├── src/
│ ├── components/ # Reusable React components
│ │ ├── MovieCard.jsx # Individual movie display component
│ │ ├── Search.jsx # Search input component
│ │ └── Spinner.jsx # Loading spinner component
│ ├── assets/ # Additional assets
│ │ └── react.svg # React logo
│ ├── App.jsx # Main application component
│ ├── main.jsx # Application entry point
│ ├── index.css # Global styles and Tailwind config
│ └── appwrite.js # Appwrite configuration and functions
├── .env.local # Environment variables (not tracked)
├── package.json # Dependencies and scripts
├── vite.config.js # Vite configuration
├── eslint.config.js # ESLint configuration
└── README.md # Project documentation
- Node.js (version 18 or higher)
- npm or yarn
- TMDB API Key (free registration required)
- Appwrite Account (free registration required)
-
Clone the repository
git clone https://github.com/Sainava/Movie-Application.git cd React-app -
Install dependencies
npm install
-
Set up environment variables
Create a
.env.localfile in the root directory:VITE_TMDB_API_KEY=your_tmdb_api_key_here VITE_APPWRITE_PROJECT_ID=your_appwrite_project_id VITE_APPWRITE_DATABASE_ID=your_database_id VITE_APPWRITE_COLLECTION_ID=your_collection_id
- Visit TMDB
- Create a free account
- Go to Settings → API
- Generate an API key (v4 auth / Bearer token recommended)
- Add the Bearer token to your
.env.localfile
- Visit Appwrite Cloud
- Create a free account and new project
- Create a database for search analytics
- Create a collection with the following attributes:
searchTerm(string) - The normalized search termmovie_title(string) - Movie title from TMDBposter_url(string) - Movie poster URLcount(integer) - Number of searches
- Add your Appwrite credentials to
.env.local
-
Development mode
npm run dev
The app will be available at
http://localhost:5173 -
Build for production
npm run build
-
Preview production build
npm run preview
-
Lint code
npm run lint
The project uses Vite with React and Tailwind CSS plugins. Configuration is in vite.config.js.
Custom theme configuration is defined in src/index.css with:
- Custom color palette
- Typography settings
- Component styles
- Utility classes
Code quality is maintained with ESLint configuration in eslint.config.js.
- Debounced Search: Uses
useDebouncehook to prevent excessive API calls - Input Validation: Prevents tracking of typos and invalid searches
- Real-time Results: Instant movie results as you type
- Search Analytics: Tracks successful searches in Appwrite database
- Dynamic Rankings: Updates trending movies based on search frequency
- Smart Counting: Only counts successful searches with valid results
- Mobile-First: Optimized for mobile devices
- Flexible Grid: Responsive movie card layouts
- Smooth Scrolling: Horizontal scroll for trending movies
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source and available under the MIT License.
- The Movie Database (TMDB) for providing the movie data API
- Appwrite for backend services
- Tailwind CSS for the utility-first CSS framework
- Vite for the blazing fast build tool
If you have any questions or need help setting up the project, please open an issue in the repository.
Made with ❤️ by Sainava