Skip to content

Backend

Jtrep10 edited this page Oct 31, 2024 · 11 revisions

Backend Code: Files and Function Descriptions

login_user()

Generates a JWT token valid for one hour for a user based off the username and password sent via the front-end.

create_user()

Retrieves username and password from data request and stores them in the User object.

get_user_id()

Intercepts the request and extracts, decodes, and returns the decoded user ID token.

test_decoding()

Returns the userID in a JSON format for testing.

landing_page()

Renders the Landing page.

search_page()

Renders the Search page.

get_watchlist()

Retrieves and returns the Watchlist table for the current user.

add_to_watchlist()

Creates a new entry in the Watchlist table for the selected film.

delete_from_watchlist()

Deletes Watchlist entry for the current user and current film.

predict()

Returns movie recommendations and checks whether or not they are already in the Watchlist.

search()

Handles movie search requests.

feedback()

Handles user feedback submission.

send_mail()

Handles user feedback submission and mails the results.

success()

Renders the success page.

Clone this wiki locally