## Inspiration

Of all the mammals on Earth, only 4% are wild; the remaining 96% are livestock and humans. For birds only 30% are wild, the rest being chickens and poultry (Bar-On et al., 2018).

Food, Agriculture, and Land Use directly account for 24% of greenhouse gas sources, more than Transportation (14%), Industry (21%), and on par with Electricity Production (25%) (IPCC, 2014).Food accounts for up to 37% of the global greenhouse emissions and 70% of water withdrawals when taking into account all phases of production and distribution (IPCC, 2019).

A global transition towards more sustainable food will be among the most important strategies to reduce human impact on planetary resources. Many people want to do their part to reduce emissions, but they do not know where to start. Here we present the most accurate and up to date database on food carbon footprints to provide knowledge and tools that can support turning ideas into action.

## What it does

Our app informs users about their carbon footprint based on the food products that are bought from stores. Using a revolutionary dataset from Nature scientific data built using 3349 carbon footprint values extrapolated from 841 publications, we calculated the carbon footprint of specific foods based on the quantity consumed and type of food. The application takes in user input to create a shopping list with grocery items. This can be done through manual photo upload or by adding each item to a shopping list. The application automatically tries to look for similar replacement items in a person's shopping list that has a lower carbon footprint.

## How we built it

This project was built using the MERN Stack, with a splash of computer vision using OpenCV and Microsoft Azure Machine Learning and D3 for visualization. The frontend components were built using Material UI. A MongoDB database was used to store shopping lists and client data. D3, a Javascript visualization library was used to create the graph of carbon footprints per food for exploration.

## Challenges we ran into

One of the biggest challenges we ran into was trying to upload an image to be stored into a URL using React. This step was crucial to the development of our project since the use case of scanning receipts for grocery and food items relied heavily on image input and processing. We thought of different ways to try to diagnose and tackle the problem such as uploading the image onto a free image hosting service, reading the image into an array of bytes (metadata was lost), and asking a mentor for help.

Additionally, we believe that coming up with an idea that we were all passionate about was the hardest part. Brainstorming did not come easy to us since most of us did not know each other prior to the hackathon. Our entire team knew that we wanted to do something sustainability-related. We cycled through many ideas before settling on this one. We struggled with narrowing down our priorities since we had so many ideas to branch out upon. Some of the ideas that we wanted to implement (but couldn't get to) are listed in the last section of the README below.

## Accomplishments that we're proud of

We're proud of all we've done so far, from all the time spent on brainstorming to coming up with a prototype for demonstration. Our team is particularly proud of how we were able to combine our steeply different skills to create an application. Our UI was designed by a team member who has never worked on UI in the past. Deploying and running the CV algorithm was also one of the most time-consuming and messy tasks, but we are still glad that our hard work was able to be showcased.

## What we learned

There's no doubt that each of us has learned a lot from this project. Breaking it down individually,
Mei: I learned how to build and design the webpage using Material UI, along with using React to integrate GET and POST requests from the frontend to the backend.

## What's next for The Secret 37%

The first next step is to make our features work flawlessly. We had a difficult time integrating D3 with react. In addition, we want to make sure that the computer vision for converting receipts into carbon footprints works is reliable. We would also like to add more NLP so that the algorithm automatically finds the closest match for any food item (e.g. user types in Special K, the algorithm match cornflakes, the closest match in our database). As another next step, we would like the user to be able to track their monthly emissions from food by compiling all receipts/shopping lists. Finally, we would like to make this an integrated phone app as well.
## Inspiration

Our inspiration came from the growing need for individuals to make more sustainable choices in their daily lives. We recognized that many people were not aware of the environmental impacts of their purchases, so we wanted to build a tool that puts this information at their fingertips. Turning receipts into a way to track and reduce carbon footprints came from the desire to help people connect their shopping habits to carbon impact and the environment. One thing we wanted to add from the start was a game aspect, so we added a leaderboard for people to compete with others.

## What it does

Carbon Foodprint is a web app that calculates the carbon footprint of your shopping receipts, turning your purchases into a way to make more sustainable decisions. A user would upload their receipt to our web app. Our algorithm will take that receipt and give it a score out of 100, 100 being carbon neutral and 0 being not the best. It will also explain why the algorithm gave the user that score, and we put that score on the leaderboard for others to get motivated and try to beat it. Lastly, the user will get recommendations on how to get a higher score (being more carbon-neutral).

## How we built it

We used Mongo for our username/password login system. For front end, we designed it with react and CSS. For backend, we used javascript and Express.

## Challenges we ran into

One challenge we ran into was our algorithm. It did not work with our prompt engineering so we had to develop it differently and figure that out. We also had a challenge with the leaderboard.

## Accomplishments that we're proud of

We're proud of our whole algorithm, from receiving the receipt information to outputting a custom carbon score, adding a leaderboard, and suggesting some tips to the user to decrease their carbon emissions.

## What we learned

We learned how to use databases, retrieve and store information in them, prompt engineer, and perform many functions with several APIs.

## What's next for Carbon Foodprint

Some next steps for Carbon Foodprint include making this a mobile app, which could make it easier for users from the start. We could also add partnerships with retailers, where we collaborate with mass grocery stores to get direct access to the sustainability data. Lastly, we could implement a rewards program where users get badges or other incentives for achieving a specific carbon level.
## 💡 Inspiration 💡

The idea for Foodbox was inspired by the growing problem of food waste in our society. According to the United Nations, one-third of all food produced globally is wasted, which not only has a significant environmental impact but also a social one, as so many people are struggling with food insecurity. We realized that grocery stores often have a surplus of certain products that don't sell well, and we wanted to find a way to help them move this inventory and avoid waste. At the same time, we saw an opportunity for consumers to discover new products at a discounted price.

Another inspiration for Foodbox was the increasing awareness of the environmental impact of our food choices. Food production is a major contributor to greenhouse gas emissions and deforestation, and by reducing food waste, we can also reduce our environmental footprint. We believe that Foodbox is a small but meaningful step in the right direction, and we hope that it will inspire others to think creatively about how they can also make a positive impact on the planet and their communities.

## 🛠️ What it does 🛠️

Foodbox is a platform that helps to reduce food waste and promote sustainability. We partner with local grocery stores to offer a 20% discount on their least popular items and package them in a "food mystery box" for our customers to purchase. This way, grocery stores can move their inventory and avoid waste, while customers can discover new products at discounted prices. The items in the box are drawn randomly, so customers can try new things and experiment with different products. Our platform also has a rating system where customers can rate the products they received and this will help the store to know which products are popular among customers. With Foodbox, we hope to create a win-win situation for both the stores and customers, while also making a positive impact on the environment.

## 🏗️ How we built it 🏗️

Our team built the Foodbox web application using Next.js, a framework for building server-rendered React applications. We used Tailwind CSS for styling and Supabase PostgreSQL as our database management system. The final application was deployed using Vercel, a platform for hosting and deploying web applications. With these technologies, we were able to create a fast, responsive, and visually appealing application that is easy to use and navigate. The combination of these technologies allowed us to quickly and efficiently build the application, allowing us to focus on the core functionality of the project.

## 🧗‍♂️ Challenges we ran into 🧗‍♂️

Upon meeting initially on the morning of the hackathon, we quickly put together a really good digital receipt app idea! But after doing some research and realizing our great new original idea wasn’t so original after all, we ended up thinking of a food loot box idea in the line for lunch! The best ideas really do come from the strangest places.

## 🏆 Accomplishments that we're proud of 🏆

Kelly: I’d had experience using Adobe XD for mockups at my job as a part-time web designer, but I’d never really used Figma to do the same thing! I’m proud that I managed to learn how to use new software proficiently in one night which allowed me to easily cooperate with my front-end teammates!

Abraham: I’m familiar with React and front-end development in general but I have not used many of the frameworks we used in this project. I was excited to learn and implement Next.js and Tailwind CSS and I am proud of the pages I’ve created using them. I’m also proud of our adaptability to change when we had to accept that our old idea was no longer viable and come up with a new one, throwing away all our previous planning.

Amir: I'm really proud of the idea my team came up with for Foodbox and how we made it happen. I also had a blast playing around with Framer motion and Tailwind, it helped me level up my CSS and React animation skills. It was a great hackathon experience!

Calder: I got to work with 2 new technologies: FastAPI and Beautifulsoup. I learned a ton about parsing HTML and creating an API! Expanding my skills on the server side and working with my awesome teammates made this hackathon a special one.

## 📕 What we learned 📕

During this hackathon, my team and I faced a lot of challenges, but we also had a lot of fun. We learned that it's important to take breaks and have fun to stay motivated and refreshed. We also made some awesome connections with sponsors and other teams. We were able to learn from other participants and sponsors about their experiences and ideas. This helped us to have different perspectives on the problem we were trying to solve and helped us to come up with more creative solutions. And let me tell you, we totally crushed the cup-stacking competition thanks to the strategy we learned. Overall, it was a great learning experience for all of us. We walked away with new skills, new connections, and a sense of accomplishment.

## ⏭️ What's next for Foodbox ⏭️

The next step for Foodbox is to continue to expand our partnerships with local grocery stores. By working with more stores, we can offer a wider variety of products to our customers and help even more stores avoid food waste. We also plan to continue to improve the customer experience by gathering feedback and using it to make our platform more user-friendly. We also plan to expand our efforts to educate our customers about food waste and the environmental impact of their food choices. Finally, we will be looking at other ways to leverage technology, such as artificial intelligence, to further personalize the experience for our customers and make even better recommendations based on their preferences.