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!





