An end-to-end Movie Recommendation System built with FastAPI, Scikit-learn, and Streamlit that recommends movies based on user input using NLP and machine learning. The system fetches live movie metadata from TMDB API and serves predictions through a REST API and a web UI.
- 🎥 Content-based movie recommendation
- 🧠 NLP using TF-IDF Vectorization
- ⚡ FastAPI backend for recommendations
- 🌐 Streamlit frontend interface
- 🔑 Live movie data from TMDB API
- 🧪 Pre-trained ML model with persistence
- 🔐 Environment variable support using
.env
| Layer | Technology |
|---|---|
| Backend API | FastAPI, Uvicorn |
| ML | Scikit-learn, NumPy, SciPy |
| NLP | TF-IDF |
| Frontend | Streamlit |
| Data | Pandas |
| External API | TMDB API |
End-to-End Movie Recommendation System/
│
├── main.py # FastAPI backend
├── app.py # Streamlit frontend
├── model.pkl # Trained ML model
├── vectorizer.pkl # TF-IDF vectorizer
├── vectorizer.pkl # TF-IDF vectorizer
├── requirements.txt
└── README.md
git clone <repo-url>
cd End-to-End Movie Recommendation Systempy -3.11 -m venv .venv
.venv\Scripts\Activate.ps1
pip install -r requirements.txt
Create a file named .env in the project root:
TMDB_API_KEY=your_tmdb_api_key_here
python -m uvicorn main:app --reload
Visit: http://127.0.0.1:8000
streamlit run app.py
- Go to https://www.themoviedb.org
- Create an account → Settings → API
- Generate an API key (v3 auth)
🧪 Example API Response
{
"recommendations": [
"Inception",
"Interstellar",
"The Matrix"
]
}
- Make sure scikit-learn version matches the one used for training the model.
- Do not commit .env file to GitHub.
- Use Python 3.11 for best compatibility.
- Collaborative filtering support
- User authentication
- Recommendation history
- Cloud deployment
Suyash Singh
- GitHub: https://github.com/suyXcode
- Portfolio: https://suyxcode.netlify.app