A modern movie discovery application built with TanStack Router and powered by TMDB API. Browse trending, popular, and top-rated movies with a beautiful, responsive interface.
- Live Movie Data: Real-time trending and popular movies from TMDB
- Multiple Categories: Browse by trending, popular, top-rated, and now playing
- Advanced Search: Search across TMDB's extensive movie database
- Guest Session: No registration required - browse freely
- Responsive Design: Beautiful UI that works on all devices
- Rich Metadata: Ratings, release dates, vote counts, and descriptions
- High-Quality Images: Professional movie posters from TMDB
- Secure API: API key is properly protected using environment variables
- Frontend: React + TypeScript
- Router: TanStack Router
- Styling: Tailwind CSS
- Data Fetching: TanStack Query (React Query)
- Movie Data: TMDB API (Secure implementation)
- Icons: Lucide React
- Node.js (v16 or higher)
- npm, yarn, or pnpm
-
Clone the repository
git clone <repository-url> cd film-vault
-
Install dependencies
npm install # or yarn install # or pnpm install
-
Set up TMDB API Key (Secure Method)
You'll need a TMDB API key to fetch movie data:
- Visit TMDB and create an account
- Go to Settings β API β Request API Key
- Copy your API key
- Create a
.env
file in the root directory - Add:
VITE_TMDB_API_KEY=your-actual-api-key-here
- Restart the development server
-
Start the development server
npm run dev # or yarn dev # or pnpm dev
-
Open your browser
Navigate to
http://localhost:5173
to see the application
src/
βββ components/ # React components
β βββ MovieCard.tsx # Original movie card
β βββ TMDBMovieCard.tsx # Enhanced TMDB movie card
β βββ MoviesGrid.tsx # Movie grid layout
β βββ SearchBar.tsx # Search functionality
βββ hooks/ # Custom React hooks
β βββ useTMDB.ts # TMDB API hooks
βββ lib/ # Utility libraries
β βββ secure-tmdb-api.ts # Secure TMDB API service
β βββ movies-data.ts # Legacy static data
βββ routes/ # TanStack Router routes
β βββ index.tsx # Home page
β βββ movies.tsx # Movies browse page
β βββ search.tsx # Search page
βββ styles/ # Global styles
βββ app.css # Tailwind CSS
The application uses TMDB API for all movie data with secure implementation:
- β API key is protected using environment variables
- β No exposure in browser developer tools
- β Clear error handling for missing API keys
- β Graceful fallbacks for API errors
See TMDB_SETUP.md
for detailed setup instructions.
- Read API: 1,000 requests per day
- Search API: 1,000 requests per day
This is sufficient for development and personal use.
FilmVault implements several security best practices:
- Environment Variables: API key stored securely in
.env
file - No Frontend Exposure: API key never appears in browser code
- Error Handling: Clear messages for configuration issues
- Input Validation: Proper sanitization of user inputs
- CORS Handling: Secure cross-origin requests
FilmVault is designed as a guest session application:
- β No user registration required
- β No login/logout functionality
- β Direct access to TMDB data
- β Perfect for public movie browsing
- β No user-specific features (watchlists, ratings, etc.)
npm run dev
- Start development servernpm run build
- Build for productionnpm run preview
- Preview production buildnpm run lint
- Run ESLintnpm run type-check
- Run TypeScript type checking
Create a .env
file in the root directory:
# TMDB API Configuration
VITE_TMDB_API_KEY=your-actual-tmdb-api-key-here
β οΈ Important: Never commit your.env
file to version control. The.env.example
file shows the required format.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- TMDB for providing the movie data API
- TanStack for the excellent React libraries
- Lucide for the beautiful icons
- Tailwind CSS for the utility-first CSS framework