Inspiration

Growing up in Southern California, we always noticed how much food gets thrown away — not because it's bad, but because it looks a little off. A curved carrot, an oversized zucchini, a slightly bruised bell pepper. Meanwhile, with tariffs driving up grocery prices and inflation hitting everyday families, fresh produce is becoming a luxury. We wanted to build something that solved both problems at once — and do it for Long Beach specifically, the city hosting this hackathon.

The idea was simple: what if you could find the cheapest fresh produce near you, connect directly with local farmers who would otherwise throw it out, and actually see the environmental impact of your choices?

What It Does

Freshy Cheffy is a full-stack web app with six pages built around one mission: make fresh food affordable and reduce waste.

  • Recipe Finder: Shows you recipes that use the whole ingredient so nothing goes to waste.
  • Deals Page: Finds the cheapest ugly produce options near you using a real ML price predictor powered by gradient descent.
  • Local Farmer Connect: Links users directly with Long Beach farmers who have surplus "ugly" items that are perfectly good but would otherwise be discarded.
  • Impact Dashboard: Shows users exactly how much CO₂ they've diverted, money they've saved, and meals they've contributed to the community.
  • Community Page: A recipe-sharing platform where users post their own whole-ingredient recipes and get each other involved in the movement.

How We Built It

We started with the design in Figma and Stitch to nail the coastal Long Beach aesthetic. Then we built the ML model in Python using scikit-learn's SGDRegressor — stochastic gradient descent with a squared error loss function, exactly what we learned in DSC 40A at UCSD.

The math behind the model minimizes the mean squared error:

$$L(w) = \frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y}_i)^2$$

We trained on produce pricing data with features for item type, season, and ugly produce flag, achieving an R² of 0.931. We saved the model with pickle and built a Flask REST API to serve predictions. The HTML/Tailwind frontend makes two fetch() calls on every prediction — one for the regular price, one for the ugly produce price — updating the deal cards dynamically.

Challenges We Ran Into

The trickiest bug was negative price predictions. For very cheap items like bananas, the small training dataset caused the model to over-extrapolate when the ugly produce discount was applied, pushing prices below zero. We fixed this by adding a price floor in the API and expanding the training data with more diverse price points across all three seasons.

Getting the frontend to talk to the Flask API was also tricky at first — the browser was blocking requests because the HTML file was being served from the filesystem rather than through Flask. Routing everything through Flask fixed the CORS issue.

What We Learned

We learned how to take a data science model out of a Jupyter notebook and deploy it as a real API that a live website can talk to. That gap between "we trained a model" and "the model is running in production" is something a lot of DS students never cross — and now we have. We also got much more comfortable with Flask, Git, and building full-stack applications under time pressure.

What's Next for Freshy Cheffy

  • USDA API Integration: Connect to the Agricultural Marketing Service API for real-time produce pricing data.
  • Farmer Onboarding: Build an actual onboarding pipeline so local Long Beach farms can list their surplus ugly produce directly.
  • Mobile App Development: Add a mobile app so users can find deals on the go at the farmers market.
  • Model Expansion: Expand the ML model with more features like weather data, local demand, and historical pricing trends.
Share this project:

Updates