The problems we are facing in the current global pandemic are exposing just how fragile our food supply chains are. Farmers are being forced to destroy their crops and dispose of their livestock, which further contributes to the global food waste problem. In just the USA and Canada alone, about 250,000 tons of food is wasted each day. Not only is this devastating to the environment, but this is also a completely unsustainable way to live. Furthermore, the food must travel very far and go through shipping and a lot of processing before reaching consumers, further polluting the Earth. We seek to close the gap between farmers and consumers and eliminate the food waste problem.

What it does

Public Pantry is a free-to-use web application that allows farmers and users to connect with and directly sell to consumers in their local communities. Individuals can log their food with expiration dates and get notifications that encourage users to either donate soon-to-expire food or compost expired food. If users no longer want an item, they can put the item up for donation as long as it has not expired. Other individuals can then go to the marketplace feed and claim donations as well as buy from local farmers. To draw more users to the platform and gamify food conservation, users can get rewards points for their eco-friendly behavior and exchange it for gift cards from sponsors or donate to charity.

How we built it

Frontend: Public Pantry was built using React, which encompasses HTML, CSS, and Javascript. We used HTML to build the foundation for all the pages of the application and styled them using CSS. We also used a concept called routing in order to tie all of our React Components together.

Backend: Public Pantry gets its data from a real-time database that we built using MongoDB Atlas. Using Node.js, Express, and Mongoose, we were able to build a REST API and connect the database to our front-end application and receive and send data to and from our application. Lastly, we used Heroku to host our web app.

Challenges we ran into

Since we were new to MongoDB, we faced some issues with setting up our backend database and sending and receiving information. React was also a library that we weren't the best at, so there was a slight learning curve when it came to building our front end.

Accomplishments that we're proud of

Public Pantry relies on a lot of collections in the MongoDB database, so we are proud of how we were able to successfully manage the data from all these collections and update the application accordingly. We are also proud that Public Pantry offers a well-constructed, user-friendly way for users to reduce food waste and help local producers. The simple, yet attractive UI of Public Pantry is also an accomplishment we are pleased with.

What we learned

Following our research, we were surprised to find that so much food is being wasted on a daily basis. With food being such a precious and essential community, we knew that we needed to figure out a way to reduce food waste by people. However, we wanted to do this in such a way that whole communities could help each other in reducing food. While researching, we also came across the impact of COVID-19 on farmers and local producers who were forced to dispose of their produce because the food supply chain had broken down. Therefore, we also included a functionality in Public Pantry in order to help these farmers.

In terms of the application, we learned how to connect to a MongoDB database and send and receive information from the database. We also learned how to link React frontend to a MongoDB database using Express, Node.js, and Mongoose. Lastly, we also learned how to create an application that can seamlessly process real-time requests from the user and update both the front and backend.


By connecting the community in this way, not only is the gap in the fragile food supply chain filled, people can participate in food conservation in multiple ways while getting rewarded for it. Furthermore, the massive amounts of energy and emissions that go into the food supply chain can be eliminated through the direct producer to consumer relationships. With everyone's pantry becoming a Public Pantry, we can build a greener future and not have to pass on our burdens to the next generation.

What's next for Public Pantry

We would like to implement more features such as suggestions based on preference and different payment options. Furthermore, we would like to connect and partner with sponsors and charities to make the experience more enjoyable and incentivizing.

How to enjoy Public Pantry

You can go to our Heroku link where we hosted our web app (use "raspgary" for user id):

You can also go to the Github repo below and follow the README for instruction on how to install and run the repository.

For more information:

Share this project: