Buy Potato Bake Potato Project Overview
The Buy Potato Bake Potato project aimed to create a website that suggests recipes to users based on a survey that they can fill out.
Requirements
- Login: Users need to be able to create an account with a username, and secure password
- Survey: Users need some way to input their preferences so the application can recommend recipes.
- Search: Users should be able to search the database of recipes to find recipes that fit certain criteria or find recipes by name.
- Like/Dislike: Users need to be able to give feedback on the recipes that they enjoyed or disliked.
- Recipe Card: Users should be able to see all the information they need to successfully replicate a recipe including ingredients, steps, and nutritional information.
- Recommender system: Users should be presented with recipes that are tailored to them based on the results of the survey.
Login
The Buy Potato Bake Potato team implemented user authentication in the Buy Potato Bake Potato project using FastAPI and JSON Web Tokens (JWT) for secure account access and personalized recipe recommendations. Passwords are hashed using secure methods, user credentials are authenticated through hashed comparison, and JWT-based tokens are generated post-authentication. Extracted token data is used for personalized interactions and recommendations, enhancing user experience and security.
Survey and Storing Survey Data
Users can take a survey once they are logged in that will allow them to view recipes recommended to them by the application. The survey asks about the user's calorie goal, cooking experience, and physical characteristics. This information is sent to the database and retrieved later for the suggestion function.
Search Function
The application includes a search function that allows users to search for recipes either by the title, or tags associated with the recipe. This allows visitors to easily explore recipes that match their interests. When users search by title, the system retrieves recipes that contain the entered keywords in their titles. Similarly, when users search by tags, the system displays recipes associated with those specific tags. The information displayed includes essential recipe details, such as title, steps, nutrition information, servings, and more. Additionally, user engagement data like likes and dislikes are also presented. This feature enables visitors to find and discover recipes that align with their preferences.
Like and Dislike
Users have the ability to like and dislike recipes. When a recipe is disliked, it won't be considered for future recommendations, ensuring tailored suggestions. Conversely, liked recipes are conveniently accessible through the dedicated 'Liked Recipes' page. Interactions such as liking or disliking a recipe result in the creation of entries in corresponding tables. These tables are linked with the main recipe table, enabling us to provide personalized recommendations and populate the 'Liked Recipes' section effectively.
Recipe Cards
To make viewing recipes easy, the website utilizes templates to present recipe information. The recipe list template offers a concise view with key elements: an image, name, and indication of the user's preference (like or dislike) for each recipe. Additionally, a recipe detail template provides comprehensive insights. This includes an ingredient list, step-by-step instructions, nutritional information, and a recipe image.
Recommendations
The application’s main feature is to generate recipe recommendations based on user data. The most significant piece of data that determines which recipes are recommended is the calorie goal field from the user survey. This number is used to determine a range for the acceptable amount of calories per meal. The algorithm also sorts out any meals that the user has disliked from the final result. The number of meals that are given at a time is determined by the number of days attributed to the survey.