Inspiration
As the pandemic continues to snowball around us, routinely obtaining groceries is harder than ever. To spare our users a trip to the market and to keep them safe, we decided to create a web application that returns recipes based on ingredients inputted by them. This application can help people cook meals from limited groceries and even leftovers, saving both them from the current global pandemic, and the environment through reduced food waste. This is our way of impacting people and Mother Nature, one life at a time.
What it does
Smart Cookbook is a web application that returns recipes that can be made by ingredients that the user has inputted. Ingredients can be inputted either by selecting from a long list of ingredients that can be searched through, or manually. Then, the user can click on a button that looks for every recipe that can be made using those recipes. The output of this page includes the description of each recipe, the price per serving the respective food, and approximately how long each dish would take to be served. The application also allows users to "favorite" recipes so they can get access to it again later. Every ingredient the user has and every recipe the user favorites is stored in the user's profile, which they can access and see.
How we built it
The technical breakdown of our product includes two components: that which runs on the webpage itself, and the backend.
The application is compromised of scripts that run across all pages, in which many of them have the task of reading and writing data from our Firebase. For instance, the Profile page allows users to add ingredients that they own, which writes data to the array of ingredients in the data specific to the current user. We also have a login and logout authorization system that allows for safe data transfer. A separate type of script we have running is our API calls. We used an API called Spoonacular to get all of our recipe data, so the feature of looking up recipes required API calls to be made. We also wrote an algorithm to suggest some recipe at a higher priority than others depending on how much the ingredients required match the ingredients the user has, as well as the score of the recipe on the Spoonacular API.
When the user updates their ingredients or recipes, the backend user field is updated, ultimately updating information in the user database.
Challenges we ran into
We had a few big challenges we ran into. The first one was figuring out which recipes we'd show first in the case that the users' ingredients matched with a number of different available recipes. This required some sort of weighting system that we eventually figured out after hours and hours of thinking. Another problem we ran into immediately after, however, was the lack of available API's we could use. The one we used was the biggest one out of the seemingly useable API's, but even then, it was an API that was managed by a small group of people. Hence, they capped our API calls to 150 per day (per API key), which was definitely not enough in our testing phase. This made us go through about 3 different email addresses per group member in order to get more API keys from the website. Finally, ingredients didn't have an image in the API, so we had to resort to taking the first image result from Unsplash, which made our website run much slower (due to the additional external call of an entire image search for every ingredient).
Accomplishments that we're proud of
We are proud of the skeletal code/structure we were able to make with this project. If given a better API, this algorithm is bound to work even better which makes us happy to know. In the end, we believe that our project has the potential in reaching people's lives especially considering the current pandemic circumstances we live in. In all, we are proud that we were able to set up some possibly large impacts to people's dietary lives.
What we learned
We were able to learn a lot about the technical aspects of web development including the notion of using databases with keys, accessing API's with keys, etc. In terms of more qualitative learning, we believe we learned to work as a team better and to create a larger societal impact.
What's next for Smart Cookbook
Our next step is to further develop this with a more funded API so that we can retrieve better images and more accurate data. As of now, our data is seemingly off sometimes and the image qualities of each food item is poor. Additionally, running this on more modern, improved technologies can improve the performance of our website.
Log in or sign up for Devpost to join the conversation.