RightMeal 🍽️
Inspiration 💡
Meal planning sounds simple: What should we eat?
In reality, households have to solve several connected problems at once:
- Which meals fit everyone’s dietary needs and allergies?
- What ingredients are already in the pantry?
- What still needs to be purchased?
- Will the grocery basket stay within budget?
- How can leftovers be reused instead of wasted?
- Does the plan provide reasonable nutritional coverage?
Most existing tools solve only one part of this process. Recipe apps can recommend meals without considering pantry inventory or grocery prices, while shopping-list apps can tell users what to buy without explaining how those ingredients become complete meals.
That inspired us to build RightMeal around one complete food-planning cycle:
Plan meals → use what you already have → buy only what you need → track what you eat → reuse leftovers in the next plan.
Our goal was to create a practical, transparent, and local-first household food-planning assistant rather than another grocery marketplace or checkout service.
What it does 🍽️
RightMeal is a local-first meal, grocery, pantry, leftover, and nutrition-planning application built with Python and Flet.
Users enter their:
- Household size
- Dietary preferences and restrictions
- Food allergies
- Location
- Planning dates
- Grocery budget
- Preferred meal-planning style
RightMeal then creates a breakfast, lunch, and dinner schedule using real recipes.
Once meals are selected, the application:
- Calculates total ingredient demand
- Checks existing pantry inventory
- Uses eligible prepared leftovers first
- Determines which ingredients still need to be purchased
- Converts ingredient shortages into real package combinations
- Estimates the total grocery cost
- Checks the plan against the selected budget
- Reports nutrition and food-group coverage
- Explains why meals and grocery products were selected
Instead of pretending groceries can be purchased in exact quantities such as 173 grams, RightMeal works with whole purchasable packages.
For each ingredient, package selection prioritizes:
- Lowest total cost
- Lowest excess quantity
- Fewest packages
- Stable deterministic ordering
RightMeal also allows users to:
- Add pantry food manually
- Record purchased groceries
- Import product photos
- Import receipt photos
- View recipe ingredients and cooking directions
- Mark meals as eaten
- Track pantry deductions
- Record prepared leftovers
- Carry leftovers into future meal plans
- Browse meals using a calendar
- Compare planned and actually consumed nutrition
Dietary restrictions are treated as hard requirements, not preferences that can be ignored to produce a cheaper plan.
RightMeal also avoids hiding uncertainty. If a required price, ingredient mapping, or nutrition record is missing, the application identifies the problem instead of inventing a value.
How we built it 🛠️
RightMeal was built primarily with Python and Flet.
We separated the project into independent layers for:
- Meal planning
- Recipe processing
- Grocery pricing
- Package optimization
- Pantry management
- Leftover tracking
- Nutrition analysis
- Local persistence
- External services
- User interface
Recipe pipeline
Our source recipes are stored as Markdown files.
A development-time compiler converts them into a structured JSON recipe index containing information such as:
- Recipe names
- Serving sizes
- Meal categories
- Ingredients
- Quantities and units
- Cooking directions
- Images
- Dietary metadata
- Ingredient roles
- Nutrition
- Source provenance
Recipes with unresolved core ingredients or insufficient reviewed nutrition data are excluded from automatic meal planning.
The current project contains:
- 408 compiled recipes
- 99 auto-plannable recipes
- 72 reviewed catalog foods
- 137 bundled finished-dish images
Planning engine
The planner first applies dietary and data-validation gates.
Eligible recipes are then evaluated using factors including:
- Nutrition fit
- Pantry coverage
- Preparation time
- Cuisine variety
- Recipe repetition
- Repeated proteins and carbohydrates
- Package-level grocery cost
RightMeal uses a deterministic, budget-aware bounded beam search to build meal schedules.
That means identical saved inputs produce the same core planning result.
One important challenge is that recipes do not have a fixed grocery cost.
For example, adding one meal may introduce only a small additional ingredient requirement but still force the household to purchase another entire package.
Because of this, RightMeal repeatedly recalculates the cumulative grocery basket while evaluating possible schedules.
Package optimization
For every remaining ingredient requirement, RightMeal searches available package offers and determines the best whole-package combination.
The optimization order is:
- Lowest total cost
- Lowest excess quantity
- Fewest packages
- Stable package ordering
This lets us compare meal plans using realistic grocery purchases instead of idealized per-gram prices.
Pantry and leftover accounting
RightMeal treats raw pantry inventory and prepared leftovers as different resources.
Raw ingredients are deducted when a normal meal is prepared.
Prepared leftovers have already consumed those ingredients, so serving a leftover meal must not deduct the original ingredients again.
Stable identifiers and transaction rules help ensure that:
- Purchases are not added twice
- Meals are not deducted twice
- Leftovers do not recreate raw ingredient demand
- Failed operations do not partially corrupt stored data
Nutrition
RightMeal tracks planned and consumed values for nutrients including:
- Calories
- Protein
- Fiber
- Calcium
- Iron
- Potassium
- Vitamin A
- Vitamin C
- Vitamin D
- Folate
- Magnesium
- Zinc
It also reports coverage across six general food groups.
Optional AI features 🤖
The core meal planner works without an AI API key.
Optional OpenAI-powered features can assist with:
- Product-photo analysis
- Receipt extraction
- Basket explanations
- Leftover-note interpretation
- Fallback cooking directions
However, AI output is treated as unverified input.
It cannot directly bypass dietary restrictions, select the final meal plan, or modify inventory without local validation and user review.
Local-first reliability
Ordinary RightMeal application data is stored locally using JSON-based persistence.
We implemented reliability mechanisms including:
- Atomic file replacement
- Journaled multi-file transactions
- Rollback
- Crash recovery
- Stable operation IDs
- Duplicate-operation protection
- Revision checks
- Stale-request invalidation
The project also includes hundreds of automated tests covering recipe processing, planning, pricing, dietary restrictions, pantry accounting, leftovers, photo imports, transactions, and UI behavior.
Challenges we ran into 🚧
Connecting many systems consistently
Meal planning is not an isolated recommendation problem.
Recipes, grocery prices, nutrition, pantry inventory, purchases, and leftovers all affect one another.
A change in one system can change the result of several others, so maintaining consistent state became one of our largest engineering challenges.
Inconsistent recipe data
Real recipes describe ingredients using different names, units, formats, and preparation instructions.
We needed to normalize that information without changing the original recipe meaning or fabricating missing ingredient and nutrition data.
Real grocery package sizes
A recipe may require 600 grams of an ingredient while stores sell packages of 250 grams, 400 grams, or one pound.
The product with the lowest unit price is not necessarily the cheapest combination that actually satisfies the requirement.
This required package-level optimization instead of a simple price-per-unit comparison.
Budget-aware meal selection
One recipe cannot be assigned one permanent price.
Ingredients may be shared across several recipes, pantry inventory may cover part of the requirement, and a tiny increase in demand may require another full package.
The planner therefore has to evaluate the cumulative grocery basket while searching for meal schedules.
Preventing double counting
Food may come from:
- Existing pantry inventory
- Newly purchased groceries
- Batch cooking
- Previously prepared leftovers
Each source needs different accounting rules.
We had to prevent duplicate purchases, repeated pantry deductions, repeated leftover deductions, and partial updates after failed operations.
Handling uncertainty honestly
Our search algorithm is bounded.
Therefore, failing to find an in-budget solution does not prove that no possible in-budget meal plan exists.
We designed explicit planning outcomes so RightMeal can distinguish among:
- Budget problems
- Missing prices
- Missing ingredient data
- Partial plans
- Search limitations
We believe reporting uncertainty clearly is better than generating a convincing but unsupported answer.
Responsible AI and image processing
Receipts and product photos can contain unclear text, duplicate products, discounts, totals, personal information, and non-food items.
Instead of allowing AI extraction to directly modify inventory, we combine:
structured extraction + local validation + duplicate detection + user confirmation
before saving anything.
Accomplishments that we're proud of 🏆
We are especially proud that RightMeal connects the entire household food-planning workflow rather than stopping after recipe generation.
Some of our biggest accomplishments include:
- Building a deterministic, budget-aware meal-planning engine
- Keeping planned meals traceable to real recipes
- Enforcing dietary restrictions before optimization
- Generating grocery demand directly from selected meals
- Using pantry inventory before recommending purchases
- Optimizing realistic whole-package combinations
- Preserving product, store, price-source, and match-confidence information
- Supporting manual, product-photo, and receipt-based purchases
- Safely tracking meal consumption and pantry deductions
- Carrying prepared leftovers into future meal plans
- Providing explicit outcomes when planning cannot be completed
- Implementing transaction rollback and crash recovery
- Creating a large automated test suite that works without network access
RightMeal currently includes 408 recipes, 99 auto-plannable recipes, 72 reviewed foods, and 137 bundled dish images, along with extensive planning and reliability logic.
What we learned 📚
The biggest lesson was that realistic meal planning is much more than a recipe recommendation problem.
It is simultaneously an:
inventory problem, optimization problem, pricing problem, nutrition problem, and data-integrity problem.
We learned that:
- Grocery packages cannot be treated as infinitely divisible quantities
- Pantry inventory must be considered before new purchases
- Prepared leftovers are fundamentally different from raw ingredients
- Dietary restrictions should be enforced as hard constraints
- Nutrition results are only trustworthy when ingredient mappings are reviewed
- A recipe does not have one fixed grocery cost
- AI output should be treated as unverified input
- Repeated actions must not duplicate purchases or deductions
- Bounded algorithms should clearly communicate their limitations
- Missing information should be reported rather than replaced with guesses
We also learned how important traceability is.
Users should be able to understand where a recipe came from, how an ingredient was matched, why a package was chosen, where a price came from, and why a planning decision was made.
What's next for RightMeal 🚀
Our next goal is to expand RightMeal from a working planning system into something that can support more households and more real-world shopping situations.
Future improvements include:
- Expanding the reviewed food catalog
- Adding more auto-plannable recipes
- Supporting additional dietary patterns
- Expanding retailer and regional price coverage
- Improving ingredient and product matching
- Improving mobile and desktop packaging
- Creating clearer nutrition visualizations
- Strengthening accessibility and onboarding
- Supporting additional household and serving customization
- Improving expiration-date tracking
- Prioritizing ingredients that are likely to expire soon
- Supporting additional countries, currencies, and measurement systems
- Adding optional encrypted credential storage
- Testing with real households
- Measuring estimated grocery savings
- Measuring potential reductions in food waste
Over time, RightMeal could also learn from confirmed household behavior, such as frequently selected meals, disliked ingredients, commonly wasted foods, seasonal prices, and preferred preparation times.
Our long-term goal is to help households answer three connected questions:
- What should we eat?
- What do we actually need to buy?
- How can we stay within budget while wasting less food?
Built With
- flet
- openai
- python
Log in or sign up for Devpost to join the conversation.