Inspiration
Having seen the large amount of food a large family goes through and how much is thrown out due to being unsure of when different items were bought or just forgetting about the items of food that are in the back of the fridge, we were concerned that there was such a large amount of wastage, and wanted to find some way to alleviate this.
What it does
BestBefore provides the user with a list of the food items in their pantry and fridge, automatically updating the length of time remaining before each goes out of date. Ultimately, BestBefore acts as a diary for the expiry of all your food products, making sure you use everything before it goes bad, both saving you money and reducing food waste.
How we built it
BestBefore is a progressive web app for mobile, giving it the look and feel of an app for the user, while using serverless technology to provide a speedy experience for the end-user. Built on top of industry standards, like Next JS and React, BestBefore is fast and convenient.
The backend of BestBefore is built in Python, which reads search queries provided through the frontend in order to perform the core functions of the software.
The Python backend interacts with the database, which contains large amounts of data on food expiration times and how these change when the food is stored in the refrigerator or freezer. This database, extrapolated from a pdf file by the Food Marketing Institute and Cornell University, is converted from a .csv file to a .json file to allow for easy and efficient backend searching.
Challenges we ran into
One of the biggest challenges was having only one member of the team who could program the frontend of the site in JavaScript and this meant that while we could create APIs and other backend parts of the program, trying to then implement that into the frontend was difficult. Furthermore as this was the first foray into writing our own APIs for some members of the team there were some challenges in writing them in a way that could be used efficiently.
Accomplishments that we're proud of
We're very proud of the final product and its sleek and modern, yet simple design. The core functionality that we wished to implement is fully functional and solves our initial problem. We're also proud of our use of the APIs as some of us had never used or written APIs before, producing APIs that were functioning is something that we are very happy to have accomplished.
What we learned
Our team learned how to utilise APIs, something we had done very little of in the past. Not only did we use APIs found online, but we also wrote our own APIs, and had APIs running other APIs!!
Outside of this, some members of the team got their first experience working with .json files, while others learnt what a progressive web app is capable of!
And for one of our members it was their first experience with code, so all in all we learnt quite a lot!
What's next for BestBefore
During the Hackathon we experimented with several APIs to add further features beyond what is provided in the present submission. Some of this functionality was near completion but could not make it into the final product due to time constraints. These include:
- Scanning receipts to automatically add food products to your list
- Searching for recipes to use up those nearly-expired tomatoes (with functionality to search with multiple ingredients at once!)
- The addition of mobile notifications to make sure users are aware of their foods expiring without having to constantly check the app.
The receipt-scanning API is within the api folder of the repository and some sample receipts have been provided for testing purposes if the judges wish to test the functionality.
Similarly, the recipe searching code is fully-functional and can be used by setting the stringIngredients variable to the ingredients you wish to search with, (separate different ingredients with a comma, and no spaces. E.g. stringIngredients = 'garlic,onion' )
Built With
- javascript
- mealdb
- nextjs
- ocr.space
- python
- react
- vercel
Log in or sign up for Devpost to join the conversation.