Inspiration Nearly 40% of food in the US goes to waste, and
a big chunk of that is produce people throw out
because they're unsure if it's still good or what to do with it. We wanted to turn "is this
banana too ripe?" from a guessing game into an
instant, actionable answer.

What it does FreshLens lets you snap a photo of your fruit,
scores its ripeness using AI vision, and instantly recommends recipes tailored to exactly how ripe it is. An underripe banana gets savory plantain chip recipes; an overripe
one gets banana bread. Less waste, better meals.

How we built it We built a pnpm monorepo with a Next.js frontend and Express API backend. Google Gemini analyzes the fruit image and returns a structured ripeness score. Spoonacular provides recipe candidates, and DigitalOcean Gradient's serverless LLM (Llama 3.3 70B) reasons about which recipes best match the ripeness state — with a heuristic keyword agent as an automatic fallback. Everything is typed end-to-end with Zod schemas in a shared package.

Challenges we ran into Getting the LLM to reliably return structured JSON instead of conversational text took prompt iteration. Spoonacular's search results
skew heavily toward desserts for common fruits like bananas, so we had to add ripeness-aware query hints and exclude/include
keyword scoring to get diverse, relevant results. Rate limits on multiple APIs also forced us to build robust fallback paths.

Accomplishments that we're proud of The full pipeline — image capture → AI ripeness scoring → LLM-ranked recipes with nutrition data — works end to end. The fallback architecture means the app never fully breaks: if the LLM is down, the heuristic agent takes over transparently. Fruit mismatch detection catches when you select "banana" but photograph an apple.

What we learned We learned how to orchestrate multiple AI services (Gemini for vision, Gradient for reasoning) in a single request pipeline with graceful degradation. We also learned that search APIs aren't neutral — their default results carry biases you have to actively work
around.

What's next for FreshLens Supporting more produce beyond bananas, apples, and tomatoes. Adding a history feature
so users can track their fruit over time and get notified when it's at peak ripeness. Deploying to DigitalOcean App Platform with a persistent database for recipe favorites and waste-reduction stats.

Built With

Share this project:

Updates