A scalable, production-ready content-based movie recommendation app that uses machine learning techniques to provide personalized movie suggestions based on movie content features.
Visit https://app.josephishola.com and search for your favorite films and discover new movies you might love.
- Overview
- Features
- Architecture
- Technical Details
- Screenshots
- Installation
- Deployment
- Future Improvements
- Contributing
- License
This Movie Recommender System uses content-based filtering techniques to suggest movies similar to ones a user already enjoys. Unlike collaborative filtering systems that rely on user behavior patterns, this system analyzes movie features such as:
- Genres
- Plot descriptions
- Collections/series information
- Numerical attributes (budget, revenue, runtime)
The system is designed with scalability and production readiness in mind, featuring a modern web interface, optimized backend with caching, and containerized deployment capabilities.
- Content-based movie recommendations with high accuracy
- Modern web interface with responsive design
- Real-time similarity visualization including similarity charts and wordclouds
- Robust search functionality with partial matching and disambiguation
- Multi-layered caching system using Redis and database storage
- Evaluation metrics for recommendation quality (genre overlap, rating similarity, content relevance)
- Containerized architecture for easy deployment
- API-based design allowing for easy integration with other systems
The system follows a modern microservices architecture:
โโโโโโโโโโโโโโโ
โ Client โ
โโโโโโโโฌโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Web Server โ
โ (Flask) โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ API Service โ
โ (Flask) โ
โโฌโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโฌโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ PostgreSQL โ โ Redis โ โVisualization โ
โ Database โ โ Cache โ โ Storage โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
- Web Frontend: Responsive UI built with Bootstrap and custom JavaScript
- API Layer: RESTful Flask API with caching strategies
- Database: PostgreSQL for storing movie data and similarities
- Caching: Redis for high-performance response caching
- Visualization: Dynamic chart generation with Matplotlib and WordCloud
The recommendation engine uses a sophisticated approach combining multiple features:
- Genre Processing: Uses MultiLabelBinarizer to convert categorical genre data into a numerical format
- Text Analysis: Applies TF-IDF vectorization to movie overviews
- Numerical Features: Standardizes and normalizes budget, revenue, and runtime data
- Collection Information: Applies weight multipliers to movie collection data
- Dimensionality Reduction: Uses TruncatedSVD to reduce feature dimensionality while preserving similarity relationships
- Similarity Computation: Calculates cosine similarity between movie feature vectors
- Pre-computed similarities: Calculates and stores movie similarities in advance
- Multi-level caching: Uses Redis for in-memory caching and database for persistent storage
- Asynchronous image loading: Loads visualizations asynchronously to improve response time
- Optimized visualization generation: Configures matplotlib for fastest rendering with appropriate resolution
The system evaluates recommendations using three key metrics:
- Genre Overlap: Measures the Jaccard similarity between genre sets
- Rating Similarity: Calculates the average rating difference between movies
- Content Relevance: Uses TF-IDF and cosine similarity on genre features
[Screenshot ]
- Python 3.10+
- PostgreSQL
- Redis
- Docker (optional)
- Clone the repository:
git clone https://github.com/joseph-ishola/movie-recommender-app.git
cd movie-recommender-app- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements-dataimport.txt
pip install -r requirements-api.txt
pip install -r requirements-webapp.txt- Set up environment variables:
cp .env.example .env
# Edit .env with your configuration- Initialize the database:
python import_movies.py- Start the services:
# In separate terminals:
python api.py
python app.py- Access the web interface at http://localhost:8080
- Build and start services with Docker Compose:
docker-compose up -d- Access the web interface at http://localhost:8080
The system was deployed to AWS EC2 using the following steps:
- Launch an EC2 t2.micro instance with Amazon Linux 2
- Install Docker and Docker Compose
- Clone the repository and configure environment variables
- Build and start the services with Docker Compose
- Access the application via the EC2 public DNS
- Integration of collaborative filtering methods
- User account system with personalized recommendations
- A/B testing framework for algorithm improvements
- Real-time recommendation updates
- Integration with external movie APIs for up-to-date information
- Mobile application
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Created by Joseph Kehinde Ishola | LinkedIn