F.A.T.E.
A pantry tracker that scans barcodes, flags food before it expires, and suggests recipes to use it up
- Role
- Frontend and deployment (4-person hackathon team)
- Stack
- JavaScript, Open Food Facts API, Gemini API, ZXing, Netlify, HTML, CSS
- Team members
- Samuel Olarte, Xavian Martin, CeasarMusk
The pantry dashboard, sorted by what expires first
The idea
A lot of household food waste happens for a simple reason: items get pushed to the back of the pantry and expire before anyone notices. F.A.T.E. (Food Alert and Tracking Engine) is a mobile-first web app that keeps track of what you have and warns you before it goes bad. We built it in 12 hours as a team of four at the Bloom Knights Hackathon, our first hackathon.
What we built
- Barcode scanning with the phone’s camera: tap the floating camera button, scan a product, and the app pulls its name, image, and eco rating from the Open Food Facts API
- Expiration tracking: after scanning, you enter the expiration date and the item joins your pantry
- A pantry that sorts itself by urgency, with color-coded warnings (crimson, orange, and gold) for what needs to be eaten first
- Recipe suggestions powered by Google’s Gemini API, based on the items closest to expiring
- No backend at all: pantry data is saved in the browser, so the app is fast and free to host
My part of the project. I was responsible for the interface (the layout, the floating camera button, and the color-coded pantry cards) and deploying the app to Netlify.
Challenges
Our first hackathon, and a race against the clock. It was the whole team’s first hackathon, so we planned carefully: build the simplest version that worked, then add features only if time allowed. That plan paid off. We finished the core app with a couple of hours to spare and decided to go for recipe suggestions. Cramming in the Gemini integration took right up to the wire, and we submitted just before the deadline, with the feature working.
Reorganizing the project mid-hackathon. Halfway through, we flattened our folder structure so the app would deploy cleanly to Netlify, which broke our file paths and JavaScript module imports and crashed the app in the browser. Git also got stuck on the old paths, so we had to clear its cache and re-index our files manually before everything worked again.
Scanning real grocery barcodes. Most scanning examples are built for square QR codes, but groceries use long, thin barcodes. Getting the ZXing library to read them reliably through a phone camera took a lot of testing and tuning of the scanning area.
Handling an unreliable API. Requests to the Gemini API sometimes failed when the service was busy. Instead of showing an error, I added retry logic with exponential backoff: the app waits a little longer before each retry, so it recovers on its own without hammering the service.
Result
We had a working app deployed and demoed by the end of the 12 hours. Since a live demo depends on venue Wi-Fi, we also built a fallback: if a network request fails, the app looks the product up in a small local dictionary, so the demo works even offline. The biggest lesson was about teamwork: agreeing on exactly what data the frontend and backend would pass to each other early on meant our code merged cleanly when the pieces came together.
