Inspiration
I noticed a frustrating gap in how we handle surplus food. Hotels and event halls want to donate, and NGOs want to pick it up, but the "Trust Gap" ruins everything. Donors worry their food is being wasted or mishandled, and NGOs need a reliable way to find available food before it expires. I wanted to build a system where accountability isn't just an afterthought—it's baked into the code.
What it does
ShareBite is a transparent logistics engine for food rescue. It allows donors to list surplus food with real-time expiry timers and locations. NGOs can claim these listings, but they are held to a high standard through a Verified Impact Point System.
The system uses a "Double-Photo" verification process:
- The Donor posts a photo of the food.
- The NGO must upload a "Proof of Delivery" photo once the food is served.
I implemented a reputation system where NGOs earn Impact Points (+1) for successful deliveries and lose them (-1) for failures. This score determines their standing in the ecosystem, ensuring that only reliable partners are handling the rescue missions.
How I built it
I built this using Next.js for the frontend and API logic, hosted on Vercel. For the backend, I chose Supabase because I needed a robust relational database with built-in Auth and Storage.
I wrote custom SQL functions (RPCs) to handle the reputation logic safely on the server side. I also utilized Database Views to aggregate average ratings for donors, ensuring that NGOs can also see which donors consistently provide high-quality food.
The math for the reputation system is simple but effective: $$Impact_Score = \max(0, \sum Successes - \sum Failures)$$ By clamping the score at zero, I ensured a "hard floor" for accountability.
Challenges I ran into
This was a solo sprint, so the biggest hurdle was managing the state machine. Moving a post from available → claimed → picked_up → delivered → confirmed without any data leaks was tough.
Halfway through, I almost broke my database while adding the reputation features. This is where I truly learned the value of Git branching. I had to move my work to a fix-and-finish branch to safely repair my SQL migrations and test them on localhost before pushing back to the live site. Managing environment variables and Row Level Security (RLS) while building at speed was definitely a "trial by fire" experience.
Accomplishments that I'm proud of
I’m really proud of the Double-Photo Verification logic. I wrote the code so that the "Confirm" button literally won't appear for the Donor unless the NGO has uploaded a proof image to the Supabase storage bucket. It’s a small detail, but it makes the whole system "cheat-proof." I'm also proud that I managed to deploy a fully functional, mobile-responsive app that works on a phone as well as it does on a laptop.
What I learned
I learned that Next.js + Supabase is a powerhouse for rapid prototyping. More importantly, I learned how to handle database integrity. Using SECURITY DEFINER functions in PostgreSQL taught me how to keep sensitive logic (like points calculation) on the server where a user can't tamper with it. I also gained a much deeper respect for version control—Git branches saved this project from a total crash.
What's next for ShareBite
I want to implement a real-time notification system using WebSockets so NGOs get a ping the second food is listed nearby. I also plan to add a Google Maps integration to calculate the best "Rescue Routes" for NGOs picking up from multiple locations. My ultimate goal is to move the "Blacklist" from a policy description to an automated system that revokes access the moment an NGO's impact drops too low.
Built With
- git
- github
- lucide-react
- next.js
- postgresql
- react
- supabase
- tailwind-css
- typescript
- vercel
Log in or sign up for Devpost to join the conversation.