/flask-sherlock

Movies recommendation engine

Primary LanguagePythonMIT LicenseMIT

Sherlock

Welcome to Sherlock project. Sherlock is a movie recommendation microservice written in Flask.

Below steps can be executed on any unix like system. I will use ubuntu deployed on O'Reilly's sandbox (alternatively you could use Katacoda's playground). Once the sandbox/playground is ready, execute instructions specified in below sections.

Setup SSH key

This step is option and can be omitted.

Create ssh key and add it to GitHub's SSH keys settings.

ssh-keygen
cat ~/.ssh/id_rsa.pub

Installation

# Cloning the source code
git clone https://github.com/ldynia/flask-sherlock.git
cd flask-sherlock

# Building and running docker container
docker build --tag flask-sherlock --build-arg FLASK_DEBUG=True .
docker run --detach --name sherlock --publish 80:8080 --rm flask-sherlock
docker ps

API

Filter up algorithm

curl "http://localhost/api/v1/movies/recommend?title=Kingpin"
curl "http://localhost/api/v1/movies/recommend?title=Lost%20in%20Translation"

Testing

Unit test

docker exec sherlock pytest

Code coverage

docker exec sherlock coverage run -m pytest
docker exec sherlock coverage report

Stop container

docker stop sherlock