Book Recommender Web Service (Flask and Celery)
After explaining about ML part and Cassandra data model, in this article the implementation of flask framework with celery is going to be shortly illustrated.
CELERY
The book recommender engine benefits from celery asynchronous feature, that helps to handle all requests and monitor all process with flower.
FLASK
The main web application has been built on flask, and it has two resources:
Build and Run
docker-compose up --build
By this command the web application is going to be build and running.
SING IN
First get token: post request with “username” and “password”
http://0.0.0.0:8000/register
copy the token after registration. Add “api-token” with value of token in header. Get request to get recommendation:
http://0.0.0.0:8000/recommend/the stepford wives/20
To get serach history: Get request:
http://0.0.0.0:8000/
THE RESULT
As it can be seen some results has been recommended and saved into cassandra.