# ๐ŸŽฌ Cineverse | Movie Finder App > A sleek and responsive React app that lets users search for movies and view trending picks using **TMDB API** and **Appwrite** for logging search analytics. ![Hero Banner](public/hero.png) --- ## ๐Ÿ“ฆ Features * ๐Ÿ”Ž **Search Movies**: Search for any movie title using the TMDB API. * ๐Ÿ”ฅ **Trending Movies**: Displays a list of trending movies (fetched from Appwrite DB). * ๐Ÿ“ˆ **Search Logging**: Each search is tracked and logged in Appwrite. * โณ **Debounced Search**: Prevents excessive API calls by waiting for typing to pause. * ๐Ÿ’… Built with **React**, **TailwindCSS**, and **Appwrite**. --- ## ๐Ÿš€ Getting Started ### 1. Clone the Repository ```bash git clone https://github.com/GRACE-wDEV/cineverse.git cd cineverse ``` ### 2. Install Dependencies ```bash npm install ``` ### 3. Environment Variables Create a `.env` file in the root directory and add your TMDB API key: ```env VITE_TMDB_API_KEY=your_tmdb_api_key_here ``` > ๐Ÿ” You can get a free API key from [https://www.themoviedb.org/](https://www.themoviedb.org/) --- ## ๐Ÿง  Project Structure ``` . โ”œโ”€โ”€ public/ โ”‚ โ””โ”€โ”€ hero.png # Banner image โ”œโ”€โ”€ src/ โ”‚ โ”œโ”€โ”€ components/ โ”‚ โ”‚ โ”œโ”€โ”€ Search.jsx # Search bar component โ”‚ โ”‚ โ”œโ”€โ”€ MovieCard.jsx # Card UI for individual movie โ”‚ โ”‚ โ””โ”€โ”€ Spinner.jsx # Loading spinner component โ”‚ โ”œโ”€โ”€ appwrite.js # Appwrite SDK integration for trending + logging โ”‚ โ””โ”€โ”€ App.jsx # Main app logic โ”œโ”€โ”€ .env โ””โ”€โ”€ README.md ``` --- ## โš™๏ธ API & Appwrite Setup ### TMDB API * Used for: * `search/movie`: to search movies by name. * `discover/movie`: to fetch popular movies. ### Appwrite Make sure your Appwrite project: * Stores trending movies (`getTrendingMovies`) * Logs the first search result per query (`updateSearchCount`) --- ## ๐Ÿ–ผ๏ธ UI Overview * `Search`: Controlled input with debounced updates. * `MovieCard`: Displays poster, title, rating, etc. * `Trending Section`: Pulled from Appwrite backend. * Responsive layout powered by TailwindCSS. --- ## ๐Ÿงช How It Works * `useDebounce` waits `1000ms` after typing to fire a search. * If a search term is entered, fetches from `search/movie`, else from `discover/movie`. * Trending movies load only once on initial render (`useEffect`). * Movie data is fetched using `fetch` with a `Bearer` token for security. --- ## ๐Ÿ“ธ Screenshots | Search & Results | Trending Movies | | --------------------------------- | ------------------------------------- | | ![search](screenshots/search.png) | ![trending](screenshots/trending.png) | > Add your screenshots in a `screenshots/` folder. --- ## ๐Ÿ› ๏ธ Tech Stack * **React** โ€“ Frontend library * **Tailwind CSS** โ€“ Utility-first styling * **Appwrite** โ€“ Backend (trending & logging) * **TMDB API** โ€“ Movie data --- ## ๐Ÿง  Future Improvements * ๐ŸŒ™ Dark mode toggle * ๐Ÿ—ณ๏ธ Movie ratings and reviews * ๐Ÿง  Search history analytics * ๐Ÿ“ฑ Progressive Web App (PWA) --- ## ๐Ÿ“„ License MIT ยฉ [Ahmed Emad](https://github.com/GRACE-wDEV/)