DEV Community

Cover image for SafePlate
Md Adil Iftekhar
Md Adil Iftekhar

Posted on

SafePlate

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

What I Built

I built SafePlate, an AI-powered meal planning and food-safety companion for a friend who struggles with choosing meals because of food allergies. It helps users plan affordable meals based on their allergies, dietary preferences, budget, cooking time, and available ingredients.

SafePlate includes an AI meal planner, a β€œCan I Eat This?” ingredient checker, pantry-based recipe generation, and smart ingredient substitutions. Its key feature is a safety-first system that checks AI-generated meals against declared allergens instead of blindly trusting AI recommendations.

I designed it around open-weight AI running locally through Ollama, so users can keep their personal food preferences and allergy profiles on their own device, switch models, and reduce dependence on closed cloud AI services.

My goal is to make everyday meal planning easier, more personal, and more accessible for someone I care about. SafePlate combines open-source innovation with practical problem-solving to build technology that makes a real difference in someone's daily life.

Demo

Code

SafePlate Dashboard

πŸ›‘οΈ SafePlate β€” AI Meal Planning Built Around What YOU Can Safely Eat

Local-first Β· Privacy-respecting Β· Allergy-safe Β· Budget-conscious

Features Β· Screenshots Β· Architecture Β· Quick Start Β· Testing Β· Contributing

Python 3.11+ React 19 FastAPI Ollama SQLite Tailwind CSS MIT License


🧠 What is SafePlate?

SafePlate is a local-first, privacy-respecting, allergy-safe meal planning application and instant food safety checker. It is built for anyone managing:

  • πŸ₯œ Serious food allergies (peanuts, tree nuts, sesame, etc.)
  • πŸ₯— Strict dietary preferences (vegetarian, vegan, non-vegetarian)
  • πŸ’° Daily financial constraints (e.g., β‚Ή150/day budget)
  • ⏱️ Busy schedules (under 30-minute cooking time)

Unlike generic chatbots or thin AI wrappers, SafePlate enforces a strict non-negotiable architectural invariant:

πŸ”’ AI GENERATES. RULE ENGINE VALIDATES. APPLICATION DECIDES.

The AI is never trusted as the final authority on food safety. A deterministic, multi-layered rule engine validates every single suggestion before it reaches you.


✨ Key Features

1. πŸ”¬ Deterministic Food Safety Knowledge Engine

  • Classifies every food item into…

How I Built It

I built SafePlate using open-weight AI with Ollama for local inference, along with React, Vite, Tailwind CSS, Python, FastAPI, and SQLite. The AI layer is designed to be configurable, allowing different models to be swapped without rewriting the application's core logic.

The main workflow uses an agent loop: it generates a meal, checks the ingredients, validates allergy restrictions, verifies the budget and cooking time, and attempts to repair the meal if any constraints are violated. A deterministic safety engine performs the final validation, so the AI cannot simply override an allergy conflict.

I also designed a demo mode so the application can demonstrate its core features without requiring a locally running model. The goal is to make open-source AI a functional part of the product, enabling local processing, greater control over personal data, model flexibility, and the potential for offline use.

This approach combines generative AI with rule-based validation to make meal planning more personalized, transparent, and privacy-conscious.

Why Does Open Innovation Matter?

Open innovation matters for SafePlate because food allergies are personal, and users should have more control over where their sensitive information is processed. By building around open-weight AI and local inference with Ollama, SafePlate can generate personalized meal ideas on a user's own device without depending on a closed cloud AI API for its core intelligence.

An open approach also gives me the freedom to switch models, experiment with different prompts, customize the agent loop, and improve the system without being locked into one provider or its pricing. Most importantly, I can combine AI-generated recipes with an independent, rule-based allergy safety engine that checks ingredients before a meal is recommended.

A closed API could provide meal suggestions, but the open approach gives me greater control over the architecture, privacy, and future development. It also creates the potential for offline use once the model and required data are available locally. For me, open innovation means building a tool that I can understand, adapt, and improve for someone I care about.

My Agent Session

Prize Categories

Prize Categories

  • Open Source AI β€” Uses open-weight AI models through Ollama for local inference and customizable meal generation.
  • AI Agents β€” Implements an agent loop that generates meals, validates constraints, and attempts to repair unsafe or over-budget suggestions.
  • Social Impact / Build for a Friend β€” Solves a real everyday problem by helping someone with food allergies plan personalized meals.
  • Privacy & Local AI β€” Prioritizes local processing of personal allergy profiles and reduces dependence on external AI APIs.

Top comments (0)