Inspiration

After just 3 weeks of fall quarter, all of us have already dealt with moldy food and spoiled drinks, whether it was from us or our housemate's food. This seemed like an issue that would last us the whole school year. We're not able to remember every single expiration date and also track everything the housemates bring in.

What it does

To combat this, we developed ShelfMates, an application for a house to share that can scan the barcode of items and create a card file for any product. This includes the name of the item and the expiration date, and cleanly displays how close the food is to expiring. There's a tab for your own products, the shared products for the household, and a tab to see the items going bad soon. This allows the user to also monitor the items that aren't theirs so they can remind their housemates. Additionally, there's a tab for the user to log the costs of groceries and mark down how much each person in the household owes them.

How we built it

We built ShelfMates by first creating a frontend built with react and TypeScript and utilizing Vite for fast bundling, having the theme and color scheme generated using Loveable. Afterwards we created a user authorization system through Google's Firebase in order to store user data and have people be able to make accounts using their email in order to create and join households. Using Python and FastAPI framework for quick time data-synchronization across the frontend and backend. We implemented a random unique invite code generation in order for users to create a household and invite their housemates. A barcode scanning feature was created using the html5-qrcode library, allowing for barcode recognition with the camera for the user. The data retrieval for items after scanning the barcode is then handled with the Open Food Facts API primarily and if there is no relevant data from that API, we have UPC Database API for a fallback. We also created a function that estimates the expiration date of a food item through a set of rules to determine how perishable a product is. This falls back to the USDA FoodKeeper database for accurate shelf data. We implemented an add item button as well as respective food item cards with applicable filters such as personal or communal items in order to be able to sort and categorize items within the shelf. We then categorized the expiration dates to different statuses such as "Fresh", "Good to go", "Urgent", etc. in order to simplify the perishability of the food item at the current time. Using similar logic for the food items in the shelf, we also implemented a grocery list page for household members to list items that they need and can be referred to when grocery shopping for the whole household. Finally, we have an expenses tracker, keeping record of who bought what food item and if other household members owe money by calculating the amount paid for all expenses for each user as well as what they owe for all expenses they participated in. We then created a "simplified debts" algorithm which takes all individual balances and calculates the minimum number of transactions to settle the debt.

Challenges we ran into

A challenge we ran into was from creating the grocery list page. We found that we would have needed a unique item card and addItem button for the page as when referring to the item card and adding items for the shelf, an expiration date is not needed. We faced another challenge with the Barcode scanner function as we found it took some time for the camera to take a picture of the barcode and required a really steady hand in the meantime while the barcode was being scanned which proved to be troublesome at time. We also experienced a challenge in the Balances page with being able to determine if an item was paid for or not and the balance for that user being update if so.

Accomplishments that we're proud of

The accomplishments we are proud of with Shelfmates are the barcode scanner function being able to pull relevant data from databases to fill in the expiration date and name for scanned food items as well as the balances page to track expenses of housemates.

What we learned

From creating Shelfmates, we learned about the integration of a barcode recognition scanner from html5-qrcode library as it was our first time implementing a barcode scanning function.

What's next for ShelfMates

We plan to make a recipes page for Shelfmates. In that page, we want to be able to generate recipes from food that is recorded to be in the shelf and prioritize foods that are expiring soon. For example, if the household has bananas, apples, and ham expiring soon, the recipes page can show a recipe that can include any and all of those food items, later referring to other food items in the shelf that can be used in the recipe.

Built With

Share this project:

Updates