This is Notflix, a free movie database and recommendation website.
This website is simply a side project, that aims at displaying a fixed dataset of movies and provide recommendations about other movies to watch. I am building it mostly for fun and also to have a nice playground to implement various recommendation algorithms using Machine Learning.
NotFlix is based on data from the following sources:
- OMDB: The Open Movie DataBase
- Grouplens' MovieLens: Datasets behind MovieLens project.
Pre-requisite:
-
Install the following software:
-
Download the movielens data:
- Download the
ml-1m dataset
by clicking here - Unzip it and place it under
datasets/movielens/ml-1m
- Download the
-
To add the movie metadata to the downloaded dataset (such as the actors, ...) I chose to use the OMDb API (the Open Movie Database). Support him on Patreon and get a key that you will place in a text file called
omdb.key
at the root of this repository
Once you have all the pre-requisite set up, follow these steps:
-
Copy the db-credentials.env template and add the credentials you want:
cp -n db-credentials.env.dist db-credentials.env;
-
Create a virtual environment and install the required packages:
virtualenv venv; source venv/bin/activate; pip install -r requirements.txt;
-
Build the Docker images:
docker-compose build;
-
Launch the PostgreSQL database:
docker-compose up -d postgres
-
Use the following flask-cli commands to insert the data into the DB:
export FLASK_APP="src/web"; export POSTGRES_HOST="127.0.0.1"; flask init-db; flask insert-engines; flask insert-pages; flask download-movies; flask insert-movies; flask train-engines; flask upload-engines;
-
Launch the application with
make start
and then visitlocalhost:5000
.
So far, Notflix exposes the following pages:
- A home page, displaying the popular movies, the user browsing history and some personalized recommendations.
- A movie page, displaying basic informations about the selected movie and recommendations on similar movies to watch.
- A genres page, that lets you browse movies by genres.
- A search page, that lets you search the movies.
The configuration for engines and pages is handled with the display.json file. You can use it to change the engines displayed, their names and order on the page.
The repository is organized the following way:
- .circleci: Configuration file for CircleCI
- datasets: Folder containing the datasets (so far only movielens)
- docs: Folder containing the documentation, auto-generated by Sphinx.
- logs: Logs file are saved here
- models: Machine Learning models are saved here.
- notebooks: The exploratory Jupyter notebooks
- src: Source code
- api: Flask API, responsible of computing the recommendations displayed on the web app.
- data_interface: Code for interacting with the cache or the database.
- recommender: Everything related to computing recommendations.
- tracker: Code for tracking the user events.
- utils: Various utility functions
- web: Code for the Flask web application
- tests: Unit test code
- I am deliberately showing multiple engines on a web page to outline the different recommendations results from an algorithm to another.
- I am not removing the movie duplicates from an engine to another for the same reason than above.
- The Machine Learning algorithms are not very well trained yet, I spent some time working on the application to make it easy to add new engines later.
So far, the movie page looks like this: