DinnerTime is a web application that allows users to upload recipes, and schedule meals for the week. Not only does it display the ingredients and instructions for each recipe, but it creates a shopping list of all the ingredients needed for the week.
The most intricate part of the application was the structure of the database. Each recipe was an object with a list of ingredients, and a list of instructions, along with other metadata about the serving size and cooking time. The ingredients were also objects, with a name, quantity, and unit. I had chosen to omit the price of each ingredient, as I felt that it would be too much work to keep up to date.
The shopping list was created by iterating over each recipe, and adding the ingredients to a list. If the ingredient already existed in the list, it would add the quantity to the existing ingredient. The list was then sorted by the name of the ingredient.
In order to create the recipe objects, I created a recipe form, that allowed the user to add ingredients and instructions with a semi-rigid struture for the format in which the data was added. Originally I had planned to allow the user to upload a link to a recipe website, and the application would scrape the data from the website and format it appropriately. However, I was unable to create a reliable web scraper that would work in conjuntion with Next.js