Inspiration
Our project aims to not only tackle food waste in schools, but aims to tackle hunger at a higher scale. It was inspired by an annual food drive at one of my teammates' schools, in which they donate food to gain points, providing a competitive incentive. That is why we made our Food Waste/Food Donation Points Tracker, for schools to use in order to provide a competitive incentive in helping stop food waste, helping curb hunger and starvation, and helping to make our school lunches better.
What it does
- Aims to address food waste by providing a competitive incentive
- Also aims to tackle hunger/food waste at a higher scale by introducing food donations
- Made an online user interface that students can access and fill out after every lunch period
- Students fill out their name and meal they have eaten
- State whether or not they finished their lunch, earn points for finishing food without wasting any of it
- If students wasted food, they can respond with why they wasted the food, which helps with input and data collection
- Can earn more points through donating different food products (store-bought) or money (thru cash and gift cards)
- Monthly leaderboard: top 5 at the end of each month get a cash prize
How we built it
- Used HTML frontend (w/ JavaScript) for the website, Python backend for Flask (a microframework used for building web applications in Python)
Challenges we ran into
CONFIGURING THE FLASK SYSTEM IN THE PYTHON BACKEND We originally used Google Colab for the Python code. but the syntax we first learned was erroring out in Google Colab. We fixed it through trial and error for over an hour with VS-Code.
DEBUGGING THE PYTHON CODE IN ORDER TO MAKE THE POINTS SYSTEM WORK When we first ran it, the system gave a blank “Not Found” error message, tied to the URL. We misplaced some functions, gave some variables that were not defined first (name errors), and used libraries incorrectly (attribute errors). We debugged this by fixing the names of libraries and variables.
DEBUGGING THE LEADERBOARD SHOWING UP AFTER THE POINTS The leaderboard after the points system showed a “Not Found” error message at first (happened after we fixed the points system). There were duplicate routes which ended up crashing the system, and we got a few other errors while debugging the code. We debugged this by removing the duplicate routes and pathways.
Accomplishments that we're proud of and what we learned
LEARNED HOW TO CODE IN HTML AND JAVASCRIPT (basics, syntax), BASIC WEB DESIGN Most of the group had no prior experience in HTML/JavaScript. The proper syntax we learned helped with displaying inputs and options for the survey.
LEARNED HOW TO CONNECT PYTHON TO HTML USING FLASK, BASIC FLASK SYNTAX Flask was useful to help us access the HTML and calculate the points earned from filling out a form once through if/elif statements in Python. Flask helped us with transitions from one section of the form (filling out food finishing and donations) to the other (showing points tally) to the third (leaderboard).
LEARNED HOW TO ROUTE A URL FROM PYTHON TO HTML The routing syntax’s purpose is to render the form page, the submit button, the message showing how many points you got, and the leaderboard in HTML format. It helps us go through the form more smoothly and efficiently without hassles. We also learned that duplicate routing is what causes errors
What's next for Food Waste & Donation Tracker
- Put the data collected by the website from each student into a permanent database (so data is not lost when website is reloaded)
- Make sure each student has a permanent account in order to not have points/standings reset in the middle of the month
- Make standings reset on the 1st day of each month
- User authentication which allows for all points filled out by one person to go to that person
- Make the website more visually appealing so that it persuades people to donate food and/or money
- Allowing for multiple donations in one fill out of the form (current version only allows one donation per fill out)
Log in or sign up for Devpost to join the conversation.