Book Recommender Web Service (Flask and Celery)

Alireza Moosavi
2 min readSep 3, 2020

--

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.

Get recommendation for this book

CELERY

The book recommender engine benefits from celery asynchronous feature, that helps to handle all requests and monitor all process with flower.

celery config
celery rec task

FLASK

The main web application has been built on flask, and it has two resources:

Recommend
Authentication

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.

--

--

Alireza Moosavi
Alireza Moosavi

No responses yet