This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend
What I Built
I built Anny’s Local Allergy-Safe Meal Planner — a beautiful, 100% offline Streamlit application that generates safe, delicious, high-protein 7-day meal plans (plus a perfectly categorized shopping list) tailored specifically for my friend Anny.
Anny has severe allergies to Peanuts, Tree Nuts, Shellfish, and Dairy. Every time she tries to plan meals, she lives with constant anxiety — double-checking every ingredient, every recipe, every grocery list. She also loves Indian-inspired food, prefers high-protein meals, and wants quick weeknight dinners under 20 minutes.
So I built her a personal, private, offline chef that lives entirely on her laptop:
- 1-Click Anny Profile that instantly loads her exact allergies + preferences
- Full 7-day Breakfast / Lunch / Dinner plans
- Dual-layer safety system: Local Gemma generates creatively → deterministic Python filter guarantees safety
- Aisle-categorized shopping list (Produce, Proteins, Dairy Alternatives, Grains, Pantry) with checkboxes + PDF & .txt export
- Instant single-day re-rolls
- Gorgeous glassmorphism UI with interactive flip cards
- Completely private — zero data ever leaves her machine
This isn’t a generic meal planner.
It’s hers.
Demo
Live Demo (Render):
👉 https://allergy-meal-planner.onrender.com
YouTube Walkthrough:
👉 https://youtu.be/BPogI6m87Xs?si=FEwp09AYlCy1bG1D
GitHub Repository:
🥗 Anny's Local Allergy-Safe Meal Planner
Help Anny plan safe, tasty meals without constant anxiety about allergies — powered 100% offline by local Gemma.
🎯 Overview
Planning meals with severe food allergies can be stressful and anxiety-inducing. Anny's Local Meal Planner is a lightweight, offline-first application that generates personalized 7-day meal plans and consolidated shopping lists tailored specifically for Anny's dietary requirements.
🔑 Core Features
- 1-Click Anny Profile Preset: Instantly loads Anny's severe allergies (Peanuts, Tree Nuts, Shellfish, Dairy) and preferences (Gluten-Free Friendly, High Protein, Quick Prep < 20 mins).
- 7-Day Safe Meal Plan: Generates complete Breakfast, Lunch, and Dinner schedules.
-
Consolidated Aisle-Categorized Shopping List: Aggregates ingredients across all 7 days into Produce, Protein, Dairy Alternatives, Grains, and Pantry aisles with checkable items and
.txtexport. - Single-Day & Full-Week Regeneration: Re-roll any individual day (e.g., Day 3)…
Quick Local Start
ollama pull gemma3:1b # or gemma2:2b
git clone https://github.com/Anshika66-Gupta/allergy-meal-planner
cd allergy-meal-planner
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
streamlit run app.py
---
### Inspiration
Dietary restrictions and food allergies make meal planning exhausting. Whether managing severe allergies or strict nutritional goals, people spend hours cross-referencing ingredients, checking labels, and modifying recipes. We wanted to build an intelligent, ultra-safe meal planning assistant that combines the creative flexibility of local LLMs with a foolproof safety architecture—ensuring personalized, delicious, and 100% allergen-free meal plans every time.
What it does
- ⚡ Instant Profile Loading: Load strict preset profiles (allergies like peanuts, tree nuts, shellfish, dairy, plus high-protein, Indian-inspired, and <20-minute prep constraints) with a single click.
- 🤖 Hybrid AI Architecture: Automatically checks if local Ollama + Gemma is available. If yes, it leverages local LLMs for creative meal plan generation (JSON); if not, it seamlessly falls back to a Smart Safety Engine with a curated recipe pool.
- 🛡️ Dual-Layer Safety Engine: Scans every meal name, ingredient list, description, and instruction. It uses context-aware keyword matching (protecting safe variations like "sunflower seed butter" or "oat milk"), automatically replaces dangerous ingredients with safe substitutes, and generates a complete audit log of every change.
- 🛒 Smart Shopping & Export: Automatically aggregates, deduplicates, and categorizes shopping lists by grocery aisle.
- ✨ Interactive UI: Renders beautiful interactive flip cards for each meal, one-click day regeneration, and instant PDF/.txt exports.
How we built it
- Frontend & UI: Built with an interactive, responsive interface featuring dynamic flip cards and clean layout styling.
- AI & Logic Layer: Powered by Ollama running Gemma for local, privacy-first generative meal planning.
- Safety Engine: Custom rule-based matching and context-aware keyword parsing to inspect ingredient strings and safeguard against cross-contaminants and allergens.
- Data & Export: Automated PDF and text export generators paired with smart grocery aggregation algorithms.
Challenges we ran into
- Context-Aware Allergen Filtering: Standard string matching often triggers false positives (e.g., flagging "coconut milk" when dairy is restricted, or blocking "sunflower seed butter" due to nut restrictions). Tuning the Dual-Layer Safety Engine to understand context and safely handle substitutes was a rewarding challenge.
- Graceful Fallbacks: Ensuring the app remains fully functional even when local AI models (Ollama/Gemma) aren't running by building a robust rule-based fallback safety engine.
Accomplishments that we're proud of
- Successfully implementing a dual-layer safety scanner that logs every substitution transparently.
- Creating a seamless local AI workflow with Ollama and Gemma that outputs structured JSON for reliable UI rendering.
- Delivering a polished end-to-end user experience—from preset profile loading to categorized shopping lists and PDF exports.
What we learned
- The importance of defensive AI architecture: never trusting raw LLM outputs blindly when dealing with health and safety-critical domains like food allergies.
- How to design resilient fallback mechanisms that switch smoothly between generative AI and deterministic rule engines.
What's next
- Expanding the preset profile library for more dietary types (Keto, Vegan, Low-FODMAP, Halal).
- Adding multi-day meal prep tracking and pantry inventory scanning.
- Enhancing the local LLM prompting strategy for even greater culinary creativity.
Prize Categories
Best Use of Gemma (Featured): Leverages Ollama running Gemma locally for privacy-first, creative, structured JSON meal plan generation.
Best Use of Render (Featured): Hosted and deployed reliably on Render, ensuring fast cloud accessibility and smooth deployment workflows.
Top comments (0)