Inspiration

The other day, I opened up a bag of my favorite chips "Andy Capp's Spicy Fries". I was bored, so I started reading the back of the ingredients for fun, and I discovered an ingredient called "TBHQ (for freshness)". It sounded like some barbeque sauce, so I googled it-- only for me to realize it was a preservative that has been linked to cancer in rats and is already banned in several other countries as scientists are still discovering its effects on humans.

This made me realize how often people consume things they don't understand. Lots of ingredients have names that don't make sense to the regular person, but not everybody is going to have the time to google every single ingredient and chemical to make sure it's okay-- the solution? My grocery basket analyzer website, "Is My Food Safe?"

Problem: Cryptic Ingredient Names

What it does

"Is My Food Safe?" identifies allergens, preservatives, and chemicals in food quickly and easily, with just the upload of a screenshot of your grocery cart to the website.

For people with allergies or family shopping for them, this tool makes it way faster to identify which foods they can eat. For people who want to be conscientious about chemicals and preservatives, they can quickly see what's questionable in their foods-- with an optional link to click on to learn more.

"Is My Food Safe?" Website

How we built it

With the Google Cloud Vision AI API, a screenshot of someone's grocery cart is converted into text. Then, I used Selenium for web browser automation with Python to search up the grocery product's ingredients online quickly and efficiently. Afterward, those ingredients are identified by matching them with allergens, preservatives, and chemicals-- to be emailed to the user for their logs as a succinct summary with hyperlinks for more information. Essentially, this automates the entire tedious process of a person googling every single grocery item and ingredient, and turns it into something quickly done in 1 minute.

Then, I designed and built the user experience by creating a website with an embedded TypeForm, integrated with Google Sheets. When that Typeform is submitted, a Google Sheet entry is pushed, and then that triggers the Python script automation that checks for new entries to the Google Sheet every 20 seconds. If there's a new entry, it runs the code to webscrape off ingredient information of every single product to identify the allergens, preservatives, and chemicals so that a summary email with fancy HTML is sent to the user with Python's SMTBLib.

Devlog Progress #1

Devlog Progress #2

Challenges

Some challenges I ran into include payment-blocked services for integrations between services. Though they have trials or limited services, the "free" platforms I wanted to use to integrate everything together included Zapier and Mailchimp, but I had to turn backward from both those routes because they would not let me connect what I needed to for free to trigger the Python script and email send.

Ultimately, I made my way around this by creating an extra step in which my Python script checks a Google Sheet every 20 seconds to see if there's any new entry submitted by the connected Typeform integration. Because of the Zapier and Mailchimp issue, I had to incorporate the Google Sheets API and go through many loopholes to not pay for additional functionalities, so I'm exceptionally proud that it works now and in less than 24 hours, especially since this project solves a real problem I ran into in the world as a person who comes from a family with dietary restrictions.

Solved Problem

Accomplishments

This was honestly my first time using the Google Cloud API, not including the Google Drive API/Google Sheets API. Though I had been intimidated at first since all the YouTube tutorials for Google Cloud Vision seemed really complicated, I'm really happy I got image-to-text working for a practical function. In conjunction with Selenium browser automation which I'm experienced, I feel like I made something really cool this past 24 hours by combining new skills with things that I'm experienced coding. Despite my doubts about whether I'd be able to tackle something of this scope, I'm proud I'm pushed myself to do something new and something meaningful to me.

Tools, APIs, and Packages

What we learned

I learned how to use the Google Cloud Vision API to turn images into text! In addition, this is also the first time I've ever used Domain.com, so I am also glad I know how to hook up a custom domain with DNS records and fix bad certification issues!

What's Next

What's next for Is My Food Safe?

I'd love to add some additional personalization functionality to the entire project so that if a person is only allergic to nuts, it wouldn't still flag the other common allergens down. To make the user experience more streamlined, I'd also love for there to be a mobile app in which a person could just take a picture of their cart on mobile apps, since several people do shopping for groceries on their phones too nowadays.

Appendix

Share this project:

Updates