Application is online in here
-
1 User signs up
-
1.2. main.py writes user's id, name, mail and hashed password to USER table.
-
2 User signs in
-
2.1. main.py checks whether user has selected movies in order to get recommendations.
-
2.2. If logged in user hasn't selected movies yet in order to get recommendation, main.py forwards user to movie selection section (main.html).
-
2.2.1. After user selects movies, main.py obtains corresponding movie ids and adds these movie ids to current user in USER table.
-
2.2.2. Then main.py checks whether quick recommendations are generated for this user
-
2.2.3. If those are generated, main.py forwards user to quick recommendations section (quick_recos.html)
-
2.2.4. Otherwise, main.py generates 12 quick recommendations on the fly, writes this recommendations to QUICK_RECOMMENDATIONS table with corresponding user's id, then directs user to quick recommendations section (quick_recos.html) and show those recommendations. For more detail, See: quick_reco_engine.py and main.py
-
2.3. If logged in user has already selected movies, main.py repeats step 2.2.2, 2.2.3 and 2.2.4 (but doesn't overwrite to QUICK_RECOMMENDATIONS table).
-
2.4. In every 15 minutes Google Cloud Scheduler runs dataproc_manager.py
-
2.4.1.1. After that, run_job function creates cluster and submits engine.py file to this cluster for users who have selected movies and whose spark job hasn't been submited already.
-
2.4.1.2. engine.py file selects users from USER TABLE who have selected movies and whose spark job hasn't been submited to cluster. Then generates 48 recommendations for these users, changes value of "job_submited" column to 'done' for these users in USER table. After generating recommendations process is finished, engine.py writes results to RECOMMENDATION table. For more details, See: engine.py
-
2.4.2. If there is no user whose spark job hasn't been submited to cluster, run_job function does nothing.
-
2.5. While recommendations are under generating process, main.py shows notify.html to users who want to see recommendations. If this process is finished, main.py directs user to recommendations.html and show recommendations.