## Inspiration

We love cooking and watching food videos. From the Great British Baking Show to Instagram reels, we are foodies in every way. However, with the 119 billion pounds of food that is wasted annually in the United States, we wanted to create a simple way to reduce waste and try out new recipes.

## What it does

lettuce enables users to create a food inventory using a mobile receipt scanner. It then alerts users when a product approaches its expiration date and prompts them to notify their network if they possess excess food they won't consume in time. In such cases, lettuce notifies fellow users in their network that they can collect the surplus item. Moreover, lettuce offers recipe exploration and automatically checks your pantry and any other food shared by your network's users before suggesting new purchases.

## How we built it

lettuce uses React and Bootstrap for its frontend and uses Firebase for the database, which stores information on all the different foods users have stored in their pantry. We also use a pre-trained image-to-text neural network that enables users to inventory their food by scanning their grocery receipts. We also developed an algorithm to parse receipt text to extract just the food from the receipt.

## Challenges we ran into

One big challenge was finding a way to map the receipt food text to the actual food item. Receipts often use annoying abbreviations for food, and we had to find databases that allow us to map the receipt item to the food item.

## Accomplishments that we're proud of

lettuce has a lot of work ahead of it, but we are proud of our idea and teamwork to create an initial prototype of an app that may contribute to something meaningful to us and the world at large.

## What we learned

We learned that there are many things to account for when it comes to sustainability, as we must balance accessibility and convenience with efficiency and efficacy. Not having food waste would be great, but it's not easy to finish everything in your pantry, and we hope that our app can help find a balance between the two.

## What's next for lettuce

We hope to improve our recipe suggestion algorithm as well as the estimates for when food expires. For example, a green banana will have a different expiration date compared to a ripe banana, and our scanner has a universal deadline for all bananas.
## Inspiration

One of the greatest challenges facing our society today is food waste. From an environmental perspective, Canadians waste about *183 kilograms of solid food* per person, per year. This amounts to more than six million tonnes of food a year, wasted. From an economic perspective, this amounts to *31 billion dollars worth of food wasted* annually.

For our hack, we wanted to tackle this problem and develop an app that would help people across the world do their part in the fight against food waste.

We wanted to work with voice recognition and computer vision - so we used these different tools to develop a user-friendly app to help track and manage food and expiration dates.

## What it does

greenEats is an all in one grocery and food waste management app. With greenEats, logging your groceries is as simple as taking a picture of your receipt or listing out purchases with your voice as you put them away. With this information, greenEats holds an inventory of your current groceries (called My Fridge) and notifies you when your items are about to expire.

Furthermore, greenEats can even make recipe recommendations based off of items you select from your inventory, inspiring creativity while promoting usage of items closer to expiration.

## How we built it

We built an Android app with Java, using Android studio for the front end, and Firebase for the backend. We worked with Microsoft Azure Speech Services to get our speech-to-text software working, and the Firebase MLKit Vision API for our optical character recognition of receipts. We also wrote a custom API with stdlib that takes ingredients as inputs and returns recipe recommendations.

## Challenges we ran into

With all of us being completely new to cloud computing it took us around 4 hours to just get our environments set up and start coding. Once we had our environments set up, we were able to take advantage of the help here and worked our way through.

When it came to reading the receipt, it was difficult to isolate only the desired items. For the custom API, the most painstaking task was managing the HTTP requests. Because we were new to Azure, it took us some time to get comfortable with using it.

To tackle these tasks, we decided to all split up and tackle them one-on-one. Alex worked with scanning the receipt, Sarvan built the custom API, Richard integrated the voice recognition, and Maxwell did most of the app development on Android studio.

## Accomplishments that we're proud of

We're super stoked that we offer 3 completely different grocery input methods: Camera, Speech, and Manual Input. We believe that the UI we created is very engaging and presents the data in a helpful way. Furthermore, we think that the app's ability to provide recipe recommendations really puts us over the edge and shows how we took on a wide variety of tasks in a small amount of time.

## What we learned

For most of us this is the first application that we built - we learned a lot about how to create a UI and how to consider mobile functionality. Furthermore, this was also our first experience with cloud computing and APIs. Creating our Android application introduced us to the impact these technologies can have, and how simple it really is for someone to build a fairly complex application.

## What's next for greenEats

We originally intended this to be an all-purpose grocery-management app, so we wanted to have a feature that could allow the user to easily order groceries online through the app, potentially based off of food that would expire soon.

We also wanted to implement a barcode scanner, using the Barcode Scanner API offered by Google Cloud, thus providing another option to allow for a more user-friendly experience. In addition, we wanted to transition to Firebase Realtime Database to refine the user experience.

These tasks were considered outside of our scope because of time constraints, so we decided to focus our efforts on the fundamental parts of our app.
## Inspiration

At the start of the 2021 school year, we moved away from home, away from all the luxuries of living with our parents. We were thrown into the adult world where we had to manage personal finances and cook for ourselves, all without prior experience. As we budgeted our meals and bought bulk foods, we always had one problem, wasting food. Whether the food spoiled, or we didn’t know what to do with a specific food item, we saw a lot of food wasted and thrown out into the garbage. This however, was not just a problem we had with our household, we saw this problem occur in many of the houses of our friends. This got us curious and we looked up statistics for food waste, and was shocked when we saw the numbers.

National Zero Waste council’s research on household food waste in Canada has revealed that almost 2.3 million tonnes of edible food is wasted each year, costing more than $21 billion.

This costs the average Canadian family $1300 per year.

On Top of the economic implications that food waste has, it also has environmental implications. The 2.3 million tonnes of avoidable food waste is equivalent to about 6.9 million tonnes of CO2 and more than 2 million cars on the road.

We decided that we needed to combat this and decided to come up with our app Chef Buddy, an app that will help you reduce food waste

## What it does

Chef Buddy is a Food/Tech company with an emphasis on zero food waste.

Chef Buddy works by having the user take an image and upload it to our webapp, where it encrypts the image and goes through a machine learning and image recognition algorithm to detect types of foods/ingredients in the picture. It then searches through hundreds of thousands of recipes that can be made with the ingredients, and returns back to the user the top 6 recommendations.

## How we built it

Chef Buddy uses Firebase, Google vision,Spoonacular API,OpenCV, Numpy, Pandas,Python, HTML, CSS and Javascript.

In the backend we utilized Google Firebase realtime database to store our encrypted image string in base64. We then have python retrieve the encrypted base64 string where it decrypts the image string and sends the image to Google Vision, where the image recognition machine learning model will return back to us the foods/ingredients that are within the picture. Javascript will then retrieve the data that was sent back from Google Vision and send it to the spoonacular API, the API searches through hundreds of thousands of recipes that have the food/ingredient that Google Vision gives back. We then show the top 6 recommended recipes onto the front end with HTML and CSS.

## Challenges we ran into

Throughout the development journey we ran into many problems that we were able to pivot from and create effective solutions to our problems.

The first problem that we ran into was with information transferring from JavaScript to Python and vice versa. We realized that the libraries that we wanted to use to transfer data were not secure and inefficient in run time. We then pivoted and decided to create a database where we can store, retrieve and read data from each other. We decided to do this with Firebase, Google’s cloud-hosted database, which solved our problem and allowed us to efficiently transfer data to each other.

The second challenge that we ran into during our development process was food recognition, initially we decided to utilize OpenCV’s object detection and image recognition models, however we soon realize that many of the databases that are offered on kaggle could not meet our demands and after many hours of training our model it could not seem to properly return the food/ingredients from our images. We found that Google Vision would be the answer to our problems, using Google Vision’s model we were able to detect food/ingredients from our uploaded pictures and not only returned an extremely accurate prediction on the food/ingredient it also sent it back fast.

## Accomplishments that we're proud of

Chef Buddy is a project that we are extremely proud of.

This was our first time working with a database and we were able to learn the fundamentals of Firebase in just a matter of hours by learning to read documentation.

Another accomplishment that we are proud of was integrating the API’s that we used and having them work with each other. Specifically being able to connect our Google Vision with the Spoonacular API. As it was our first time working with both API’s and was a problem that took us a while to solve.
Connecting each of our separate parts to create the final product was an extremely relieving, exciting moment for all of us and seeing our code work with one another without any errors is the biggest accomplishment.

## What we learned

* User and client interaction through the firebase Realtime database.
* We learned how to use the backend to create and read entries from the database
* Learned APIs calls using Google’s open-source software called Google vision API and spoonacular to find recipes
* Learned how to interact the front-end with backend with a JavaScript framework.

## What's next for Chef Buddy

* What's next is to further improve this project by adding better features to improve efficiency and convenience..
* We can add features such as live scanning which can scan multiple objects in a short scanned video.
* Another feature we can add is filters which allows the user to change what they want to see.
* We want Chef Buddy to identify what is spoiling first in the photo.