Inspiration
Dubhacks Blueprint track: natural environment, sustainability, ethical consumption, and CO2 emissions.
What it does
Eco-Eat's mission is to bring awareness and knowledge of sustainable eating to online shopping. We achieve this with one simple Chrome Extension download, showing you the carbon footprint of various Amazon foods in real time, as you shop. Moreover, with any given Amazon food item that matches our database, we display in-depth statistics on different aspects of carbon emission when the user clicks on the link. Agricultural carbon emissions are not just impacted by the tractor that farms the land, but also deforestation, transportation, packaging, and other hidden factors that all contribute to the global carbon footprint. We believe that using Eco-Eats will help every user become more conscious of their own carbon footprint, and empowers us to make more environmental choices in our everyday lives.
How we built it
The extension popup and content script are built using HTML, CSS, and Javascript. The server is built using Python Flask and hosted on PythonAnywhere. Collaboration on the extension was done with github. Collaboration on the server was through PythonAnywhere’s own IDE. Eco-Eats is powered by various libraries such as ntlk, requests, numpy, and more.
Challenges we ran into
We ran into Cross-Origin Source Sharing errors, denying the extension permission to call our server unless a special header is included in the response to the server request. However, adding this header often messed up the format of the response and required restructuring of the get request handling script to format a proper response.
Issues with the JSON string returned from the Flask endpoint led to either a 500 Internal Server Error or unusable data for the extension. For example, the 500 Internal Server Error stemmed from a type error in the python code as well as the relative path in our scripts being insufficient for the code to locate the relevant CSV file on the website host.
HTML, CSS, and JS format and behavior differs for extensions than for websites.
On the backend Python side, we had several issues increasing the robustness of our matching algorithm, especially when combined with a limited dataset to work with. One helpful workaround was to tokenize the searched titles and broadly match any words in the title with foods in our database. Then if there are multiple matches, the algorithm checks the ingredients matching our database to break ties. For titles that had multiple matches (for example, if you search for milk it matched both soy milk and milk) we cross referenced the database of foods with the most frequent ingredients.
Accomplishments that we're proud of
We’re proud that our product is a fully functional browser extension made in under 24 hours that will help an everyday online shopper reduce their carbon footprint. We are especially proud of the way in which we achieved this. To do this, we had to successfully integrate the various strengths of our team. We broke into three groups: one focused on applying JavaScript to create the browser extension itself, another focused on creating the website and using Flask to host the Python web application, and finally another group to write the product matching algorithm. Our approach and teamwork enabled us to rapidly create this product that none of us could have created alone.
What we learned
In addition to educating ourselves on the nuances of food related carbon emissions, we also learned a great deal about the process of building both web extensions and dynamic websites. This was the first time many of our members had ever built web extensions before and so we learned a great deal about the nuances of building them with JavaScript, HTML and CSS. Furthermore, we also learned a great deal about the process of having our extension communicate with a flask server in order to modify the contents of a dynamic webpage, in addition to learning about the process of hosting everything on Google Cloud. Comprehensive, this was an amazing experience that resulted in us learning a great deal while building a viable solution to tackle ethical e-commerce.
What's next for Eco-Eats
Improve the product name and ingredient matching script to increase confidence. Collect and scrape data on carbon emissions to expand our own custom datasets and improve our product matching algorithm. Expand use beyond goods into other consumer products.


Log in or sign up for Devpost to join the conversation.