A modern, responsive movie discovery application built with React, Vite, and Tailwind CSS. Search through thousands of movies, discover trending titles, and explore detailed information powered by The Movie Database (TMDB) API.
- 🔍 Real-time Search - Search through thousands of movies with debounced input
- 🔥 Trending Movies - View the most searched movies based on user activity
- 📊 Movie Information - Display ratings, release dates, and language information
- 🎨 Modern UI - Beautiful gradient design with smooth animations
- 📱 Responsive Design - Fully responsive across all devices
- ⚡ Fast Performance - Built with Vite for lightning-fast development and builds
- 💾 Search Analytics - Track popular searches using Appwrite backend
- Frontend Framework: React 19.2.0
- Build Tool: Vite 7.2.4
- Styling: Tailwind CSS 4.1.18
- Backend/Database: Appwrite 21.5.0
- API: The Movie Database (TMDB) API
- Utilities: react-use (for debouncing)
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- npm or yarn
- A TMDB API key
- An Appwrite account and project
-
Clone the repository
git clone https://github.com/yourusername/react-movie-app.git cd react-movie-app/movie-app -
Install dependencies
npm install
-
Set up environment variables
Create a
.env.localfile in themovie-appdirectory:cp .env.example .env.local
-
Configure your API keys
Edit
.env.localwith your credentials:Get TMDB API Key:
- Visit TMDB
- Create an account and go to Settings → API
- Request an API key (choose "Developer" option)
- Copy your API Read Access Token
Set up Appwrite:
- Visit Appwrite Cloud
- Create a new project
- Create a database and collection with the following attributes:
searchTerm(String, required)count(Integer, required)movie_id(Integer, required)poster_url(String, optional)
- Copy your Project ID, Database ID, and Collection ID
-
Start the development server
npm run dev
-
Open your browser
Navigate to
http://localhost:5173
movie-app/
├── public/ # Static assets
│ ├── hero.png
│ ├── hero-bg.png
│ ├── search.svg
│ └── star.svg
├── src/
│ ├── components/ # React components
│ │ ├── MovieCard.jsx
│ │ ├── Search.jsx
│ │ └── Spinner.jsx
│ ├── App.jsx # Main application component
│ ├── appwrite.js # Appwrite configuration & functions
│ ├── index.css # Global styles & Tailwind config
│ └── main.jsx # Application entry point
├── .env.example # Environment variables template
├── .env.local # Your local environment variables (not tracked)
├── index.html # HTML template
├── package.json # Dependencies and scripts
└── vite.config.js # Vite configuration
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
| Variable | Description | Required |
|---|---|---|
VITE_TMDB_API_KEY |
Your TMDB API Read Access Token | Yes |
VITE_APPWRITE_PROJECT_ID |
Appwrite Project ID | Yes |
VITE_APPWRITE_DATABASE_ID |
Appwrite Database ID | Yes |
VITE_APPWRITE_COLLECTION_ID |
Appwrite Collection ID | Yes |
- Debounced search input (500ms delay) for optimal performance
- Real-time results from TMDB API
- Fallback to popular movies when no search term
- Tracks search frequency using Appwrite
- Displays top 10 most searched movies
- Updates dynamically based on user activity
- Movie poster with fallback image
- Star rating display
- Release year
- Original language indicator
-
Install Vercel CLI:
npm i -g vercel
-
Deploy:
cd movie-app vercel -
Add environment variables in Vercel dashboard
-
Build the project:
npm run build
-
Deploy the
distfolder to Netlify -
Configure environment variables in Netlify dashboard
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.
Peter Njuguna
- GitHub: @pcodesdev
- X (Twitter): @PcodesDev
- Portfolio: pcodesdev.github.io
For questions or feedback, please reach out at pcodesdev@gmail.com
⭐ If you found this project helpful, please consider giving it a star!





