A sophisticated content-based movie recommendation platform built with FastAPI and Vite + React + TypeScript, featuring advanced AI algorithms, modern UI design, and comprehensive movie data to deliver personalized film suggestions. π Try it out here: Live Website
- Content-Based Filtering: Advanced similarity matching using TF-IDF vectorization and Nearest Neighbors
- Fuzzy Matching: Intelligent auto-correction for movie titles with typos using
difflib - Similarity Threshold Control: Adjustable precision via interactive slider (0.1-1.0)
- Real-time Processing: Instant recommendations with sub-second response times
- Responsive Design: Seamless experience across desktop, tablet, and mobile devices
- Dark/Light Mode: Elegant theme switching with system preference detection
- Interactive Animations: Smooth transitions and micro-interactions using Framer Motion
- Accessibility: WCAG-compliant design with proper contrast ratios and keyboard navigation
- Loading Experience: Engaging loader screen with team credits and progress indicators
- Comprehensive Database: ~175,000 movies with detailed metadata
- Movie Posters: High-quality images from TMDB API integration
- Detailed Information: Genres, release years, overviews, and ratings
- Smart Filtering: English-language films from 1990-2025 for relevance
- Dual Interface: Both Streamlit web app and React frontend options
- API-First Architecture: RESTful FastAPI backend with comprehensive error handling
- Type Safety: Full TypeScript implementation with strict type checking
- Performance Optimized: Cached model loading and efficient data processing
- UI/UX Design: Zayyad - Creative Vision & User Experience
- AI Model Development: Amir - Machine Learning & Backend Architecture
- Python: 3.8 or higher
- Node.js: 16.0 or higher
- npm: Latest version
- Model Files: Pre-trained pickle files (included in repository)
git clone https://github.com/your-username/movie-recommendation-model.git
cd movie-recommendation-modelcd backend
pip install -r requirements.txt
# Start the FastAPI server
uvicorn main:app --reloadBackend runs on: http://localhost:8000
cd ../frontend
npm install
# Start the development server
npm run devFrontend runs on: http://localhost:5173
cd backend
streamlit run app.pyStreamlit runs on: http://localhost:8501
- Launch the Application: Navigate to
http://localhost:5173 - Enter Movie Title: Type any movie you enjoy (e.g., "Inception", "The Matrix")
- Adjust Similarity: Use the slider to control recommendation precision
- Get Recommendations: Click the button or press Enter
- Explore Results: Browse through personalized movie suggestions with posters and details
- Try Sample Movies: Click the suggested movie buttons for quick testing
- Experiment with Threshold: Lower values (0.1-0.5) for broader suggestions, higher (0.6-1.0) for precise matches
- Dark Mode: Toggle for comfortable viewing in any lighting condition
- Mobile Friendly: Full functionality available on smartphones and tablets
| Range | Behavior | Best For |
|---|---|---|
| 0.1-0.3 | Very lenient matching | Discovering new genres |
| 0.4-0.6 | Balanced recommendations | General use |
| 0.7-1.0 | Strict similarity | Finding very similar films |
# Optional: TMDB API key for enhanced poster quality
TMDB_API_KEY=your_api_key_here
# Backend configuration
FASTAPI_HOST=127.0.0.1
FASTAPI_PORT=8000
# Frontend configuration
VITE_API_URL=http://127.0.0.1:8000Movie Recommendation Model/
βββ backend/
β βββ main.py # FastAPI application
β βββ recommendation.py # Recommendation logic
β βββ requirements.txt # Python dependencies
β βββ Pkled Files/ # Model files
βββ frontend/
β βββ src/
β β βββ App.tsx # React component
β β βββ main.tsx
β βββ vite.config.ts # Vite config
- Loads model components from pickled files
- Receives POST requests with movie title and threshold
- Returns recommended movies and corrected title (if applicable)
- Interactive UI with input field and slider
- Uses Axios to communicate with backend
- Displays movie recommendations in real-time
- Dataset Size: ~175,000 movies
- Vectorization: TF-IDF with ~15,000 features
- Recommendation: 10 most similar movies using cosine similarity
- FastAPI
- Uvicorn
- Pandas
- Scikit-learn
- NumPy
- React
- TypeScript
- Vite
- Axios
- Ensure FastAPI allows origin
http://localhost:5173
- Make sure
dataframe,tfidf_matrix, andindicesare inbackend/Pkled Files/
- Try lowering the similarity threshold
- Ensure input title exists or is close enough
- Fork the repo
- Make your changes on a branch
- Test thoroughly
- Submit a PR
- Kaggle (For the dataset used in the recommendation)
- TMDB (for optional poster API)
- Scikit-learn
- FastAPI
- Vite & React
- Pandas & NumPy
Happy Movie Discovery! π¬β¨