DEV Community

Cover image for MealBuddy
Krishna Bharadwaj
Krishna Bharadwaj

Posted on

MealBuddy

This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend

What I Built

Meal Buddy is a local AI meal planner designed around one specific person's needs: someone with food allergies, a tight weekly budget, and a small kitchen who keeps asking "what can I cook with what's left?"

I built it around a realistic persona rather than a tested user, so I haven't been able to hand it to a real person yet. That's the main thing I'd do next.

What it does:

  • Stores a profile (allergies, diet, budget, kitchen setup) in one editable JSON file
  • Takes a free-text pantry list like "rice, dal, onions, tomatoes"
  • Generates a 3-day meal plan that uses pantry items first
  • Runs a hard allergy check on every plan: a keyword scan plus a second AI pass, and it regenerates the plan if anything looks unsafe
  • Produces a grocery list of only the missing items, grouped by category, with cost estimates
  • Has a "swap this meal" button that regenerates one meal without touching the rest

Demo

It runs locally at http://127.0.0.1:8000 once Ollama and the model are set up. The setup steps are in the README.

Code

πŸ› Meal Buddy

A local AI meal planner built for one specific person β€” my roommate.

Built for the DEV Hacktoberfest Weekend Challenge: "Build for a Friend".

Meal Buddy uses Gemma (open-weight model) via Ollama β€” everything runs on your laptop, offline, with zero paid APIs.

Meal Buddy screenshot


Why open-source AI?

My roommate's allergies and food preferences are personal health data. With Gemma running locally through Ollama, none of that ever leaves the laptop β€” no cloud, no API keys, no accounts, no cost. It works fully offline (great for hostel Wi-Fi), and if you want a different model you swap one line of config Open-weight means anyone can audit exactly what's running.


What it does

  • πŸ“‹ Stores your profile (allergies, diet, budget, kitchen setup) in an editable JSON file
  • πŸ§… Takes free-text pantry input ("rice, dal, onions, tomatoes…")
  • πŸ€– Generates a 3-day meal plan using Gemma, prioritising pantry ingredients
  • πŸ›‘οΈβ€¦

How I Built It

  • Model: Gemma 3 running locally through Ollama
  • Backend: Python + FastAPI
  • Frontend: plain HTML/CSS/JS, no build step
  • Data: one JSON profile file; the real one is gitignored and a sample profile ships with the repo

The part I cared about most is the allergy check. A language model can confidently suggest something unsafe, so I don't trust a single pass. Every plan goes through a keyword scan and a second model review, and the plan is regenerated if either flags a problem.

During early testing with a nut allergy profile, Gemma confidently suggested an almond garnish because it treated it as an optional topping rather than an ingredient. The keyword scan immediately flagged it and triggered an automatic regeneration before the plan ever reached the UI. That single moment proved why having both layers of safety is completely necessary.

Why Open-Source AI Matters Here

  • Health data stays on the laptop. Allergies and diet details are personal, and nothing is sent to a server I don't control.
  • It costs nothing to run. No API keys, accounts, or bills.
  • It works offline. It only needs internet once, to download the model.
  • Models are swappable. Changing one line (MODEL_NAME) lets me try gemma3:4b, Mistral, or Llama.
  • It's auditable. Open weights mean anyone can inspect what's running.

What's Next

Try it with a real user and collect their feedback, support weekly plans, and let people save favorite meals.

Meal Buddy is a helper, not medical or nutritional advice. Always double-check ingredients if you have severe allergies.

Top comments (0)