As college students who live in apartments, we often have to cook our own meals. Often, with a busy lifestyle, we neglect to pay attention to the nutritional content of the food we buy. We wanted to create a convenient way to analyze the nutritional value of bought grocery items to influence the way we make food choices. All supermarket purchases are recorded in a physical receipt; however, not many people keep track of these hard copies. Thus, we envisioned a product that can easily extract information from receipts and present nutritional value of bought foods items in an app.

What it does

Nutrify streamlines healthy monitoring of your receipts from major supermarkets and grocery stores. You can choose whether to upload your receipt from your camera roll or snap a picture of your receipt. This will keep an automatic visual breakdown of the total nutrients in your food to encourage a balanced diet. Our current nutritional categories are carbohydrates, protein, sugars, fiber, and fats. The values in the pie chart are relative percentages of what nutrients the foods are composed of--all values sum to 100%. The line graph is the nutritional value divided by the ideal amount for a 2,000 calorie diet.

How I built it

Step 1) Use Google Cloud Vision API to turn receipt image into text

Step 2) Parse receipt text into individual grocery items

Step 3) Use USDA Food Composition Databases API to search up the name of the individual grocery item and return its ID number

Step 4) Use above API again to retrieve the food report in JSON format. Return average % composition of each nutritional category for every grocery item.

Step 5) Begin building iOS app by integrating camera

Step 6) Organize data management of past receipts and maintain an organized storyboard

Step 7) Build charts and graphs to analyze overall nutritional data for one or many receipts

Step 8) Prettify app with simple UI designs

Challenges I ran into

1) Text Parsing: Grocery stores often have different formats and labeling methods for items on receipts, including abbreviations. We reasoned that most people shop from only a handful of major supermarkets. Therefore, given the scope of the hackathon, we decided to simplify the problem by focusing first on solely Trader Joe's receipts, which have little to no abbreviations. 2) Using third-party frameworks: We ran into several issues using Carthage to generate our analysis, including graphs. This caused multiple merge errors in git due to inexperience in managing dependencies. 3) Using the APIs: We spent a good amount of time learning how to call the APIs and writing a generalized function for that purpose. 4) Search API: The search API wasn't always accurate with identifying a food item, so we wanted to comb through multiple search results for the most accurate product, but prioritized finishing the rest of the app first 5) Integrating the app with the backend portion: managing receipt data was a challenge, and combining all of our work from front-end to back-end caused many merge conflicts

Accomplishments that I'm proud of

1) Getting the camera feature to work correctly

2) Learning Swift and iOS development

What I learned

1) Swift

2) iOS development

3) how to call APIs

What's next for Nutrify

1) For future improvement, we can extend our analysis to Ralph's and other major supermarkets.

2) We can add an explore page to give recipe recommendations, motivating articles, and promote healthy eating habits

3) We can better parse receipt data to incorporate prices to know how much we are spending per food category

Built With

Share this project: