A modern, responsive movie search application built with React, TypeScript, and Vite. Search for movies, discover trending films, and explore a vast collection of movies powered by The Movie Database (TMDB) API.
- 🔍 Real-time Movie Search: Search for movies with debounced input to optimize API calls
- 📊 Trending Movies: View the top 5 most searched movies based on search analytics
- 🎨 Beautiful UI: Modern, dark-themed interface with gradient accents and smooth animations
- 📱 Responsive Design: Fully responsive layout that works on all device sizes
- ⭐ Movie Details: View movie ratings, release year, language, and posters
- ⚡ Fast Performance: Built with Vite for lightning-fast development and optimized builds
- 🔐 Backend Integration: Uses Appwrite for tracking search analytics and trending movies
- Frontend Framework: React 19.2.0
- Language: TypeScript
- Build Tool: Vite 7.2.4
- Styling: Tailwind CSS 4.1.18
- Backend: Appwrite 21.5.0
- API: The Movie Database (TMDB) API
- Utilities: react-use (for debouncing)
Main page showing the hero section and search interface
Movie search results displayed in a responsive grid layout
Top 5 trending movies based on search analytics
Detailed movie cards showing poster, rating, language, and year
Responsive design optimized for mobile devices
- Node.js (v18 or higher)
- npm or yarn
- TMDB API key (Get one here)
- Appwrite account and project (Sign up here)
-
Clone the repository
git clone <repository-url> cd movie-project-react
-
Install dependencies
npm install
-
Set up environment variables
Create a
.envfile in the root directory:VITE_TMBD_API_KEY=your_tmdb_api_key_here VITE_APPWRITE_PROJECT_ID=your_appwrite_project_id VITE_APPWRITE_DATABASE_ID=your_appwrite_database_id VITE_APPWRITE_TABLE_ID=your_appwrite_table_id
-
Set up Appwrite Database
Create a database and collection in Appwrite with the following structure:
- Collection name: Your table ID
- Attributes:
searchTerm(String, required)count(Integer, required)movie_id(Integer, required)poster_url(String, required)
-
Start the development server
npm run dev
-
Open your browser
Navigate to
http://localhost:5173(or the port shown in your terminal)
npm run dev- Start the development servernpm run build- Build the project for productionnpm run preview- Preview the production build locallynpm run lint- Run ESLint to check for code issues
movie-project-react/
├── public/ # Static assets
│ ├── hero.png # Hero banner image
│ ├── hero-bg.png # Background pattern
│ ├── search.svg # Search icon
│ ├── star.svg # Star rating icon
│ └── no-movie.png # Placeholder for missing posters
├── src/
│ ├── components/ # React components
│ │ ├── MovieCard.tsx # Movie card component
│ │ ├── Search.tsx # Search input component
│ │ └── Spinner.tsx # Loading spinner component
│ ├── lib/
│ │ └── appwrite.ts # Appwrite configuration and functions
│ ├── App.tsx # Main application component
│ ├── App.css # Application styles
│ ├── index.css # Global styles and Tailwind config
│ └── main.tsx # Application entry point
├── .env # Environment variables (create this)
├── package.json # Project dependencies
└── README.md # This file
The search functionality uses debouncing to prevent excessive API calls. The app waits 500ms after the user stops typing before making a search request.
The application tracks search queries in Appwrite and displays the top 5 most searched movies, updating in real-time as users search.
Each movie card displays:
- Movie poster
- Title
- Rating (out of 10)
- Original language
- Release year
- Create a new project in Appwrite Cloud
- Create a database
- Create a collection with the following attributes:
searchTerm(String)count(Integer)movie_id(Integer)poster_url(String)
- Update your
.envfile with the project, database, and collection IDs
- Sign up for a free account at TMDB
- Generate an API key from your account settings
- Add the API key to your
.envfile
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
- The Movie Database (TMDB) for providing the movie API
- Appwrite for the backend infrastructure
- Vite for the amazing build tool
- Tailwind CSS for the utility-first CSS framework
Made with ❤️ using React and TypeScript