diff --git a/src/prediction_scripts/item_based.py b/src/prediction_scripts/item_based.py index 8eac546fc..c4d4b43c0 100644 --- a/src/prediction_scripts/item_based.py +++ b/src/prediction_scripts/item_based.py @@ -49,4 +49,6 @@ def recommend_for_new_user(user_rating): by="recommended", ascending=False, inplace=True ) - return list(join_movies_and_recommendations["title"][:201]) + return list(join_movies_and_recommendations["title"][:201]), \ + list(join_movies_and_recommendations["genres"][:201]), \ + list(join_movies_and_recommendations["imdb_id"][:201]) \ No newline at end of file diff --git a/src/recommenderapp/app.py b/src/recommenderapp/app.py index 59f43f2f5..abb68abe4 100644 --- a/src/recommenderapp/app.py +++ b/src/recommenderapp/app.py @@ -5,7 +5,7 @@ import json import sys -from flask import Flask, jsonify, render_template, request +from flask import Flask, jsonify, redirect, render_template, request, url_for from flask_cors import CORS from search import Search from utils import beautify_feedback_data, send_email_to_user @@ -27,7 +27,23 @@ def landing_page(): """ Renders the landing page. """ - return render_template("landing_page.html") + return render_template("search_page.html") + + +@app.route("/get_started", methods=["POST"]) +def get_started(): + """ + Handle the Get Started button click and redirect to search_page. + """ + return redirect(url_for("search_page.html")) + + +@app.route("/search_page") +def search_page(): + """ + Renders the search page. + """ + return render_template("search_page.html") @app.route("/predict", methods=["POST"]) @@ -42,9 +58,9 @@ def predict(): movie_with_rating = {"title": movie, "rating": 5.0} if movie_with_rating not in training_data: training_data.append(movie_with_rating) - recommendations = recommend_for_new_user(training_data) - recommendations = recommendations[:10] - resp = {"recommendations": recommendations} + recommendations, genres, imdb_id = recommend_for_new_user(training_data) + recommendations, genres, imdb_id = recommendations[:10], genres[:10], imdb_id[:10] + resp = {"recommendations": recommendations, "genres": genres, "imdb_id":imdb_id} return resp diff --git a/src/recommenderapp/static/image.jpg b/src/recommenderapp/static/image.jpg new file mode 100644 index 000000000..04154c555 Binary files /dev/null and b/src/recommenderapp/static/image.jpg differ diff --git a/src/recommenderapp/static/stylesheet.css b/src/recommenderapp/static/stylesheet.css index 37858f2be..7666d2f64 100644 --- a/src/recommenderapp/static/stylesheet.css +++ b/src/recommenderapp/static/stylesheet.css @@ -1,3 +1,9 @@ +.landing-page { + background-image: url("image.jpg"); + background-size: cover; + color: azure !important; +} + body { background-image: url("224299.jpg"); background-size: cover; diff --git a/src/recommenderapp/templates/landing_page.html b/src/recommenderapp/templates/landing_page.html index 7d5718a90..f4a7e8712 100644 --- a/src/recommenderapp/templates/landing_page.html +++ b/src/recommenderapp/templates/landing_page.html @@ -1,18 +1,18 @@ - PopcornPicks🍿 - + - + + +
- -

🎬 Pick a Movie! 🎬

-
+

🎬 PopcornPicks: Pick a Movie! 🎬

+


+ Discover personalized movie recommendations by selecting up to 5 of your favorite films. +
+ Create a watchlist and have it conveniently sent to your email. +
+ Enjoy movies at your own pace, on your terms. +

+ Get Started! - -
-
- -
-
- -

Selected Movie(s):

- -
    -
    -
    - - -
    -
    -
    -
    - -
    -
    - -
    -
    - -

    Recommended Movies:

    -
    -
      -
      -
      -
      -
      -
      - - -
      -
      -
      -
      -
      -
      -
      -
      - - -
      -
      -
      -
      -
      -
      - - -
      +









      + Made with ❤️ by PopcornPicks
      + MIT License Copyright (c) 2023 PopcornPicks

      -


      + + diff --git a/src/recommenderapp/templates/search_page.html b/src/recommenderapp/templates/search_page.html new file mode 100644 index 000000000..7d5718a90 --- /dev/null +++ b/src/recommenderapp/templates/search_page.html @@ -0,0 +1,94 @@ + + + + + + PopcornPicks🍿 + + + + + + + + + + +
      +
      + +

      🎬 Pick a Movie! 🎬

      +
      + + +
      +
      + +
      +
      + +

      Selected Movie(s):

      + +
        +
        +
        + + +
        +
        +
        +
        + +
        +
        + +
        +
        + +

        Recommended Movies:

        +
        +
          +
          +
          +
          +
          +
          + + +
          +
          +
          +
          +
          +
          +
          +
          + + +
          +
          +
          +
          +
          +
          + + +
          +
          +
          +


          + + + + +