AI meal planning app: from a one-server MVP to AI in production.
A US meal-planning app wanted AI-generated meal plans. The backend and every AI feature were built for it: an AWS foundation, a recipe import pipeline, reliable language-model output, and a meal planner where every change is versioned and measured.
Before and after.
| Area | Before | After |
|---|---|---|
| Infrastructure | An MVP on a single server | Distributed on AWS, defined as code with CDK |
| Recipe data | Documents in hundreds of layouts, many split across pages | An import pipeline that turns them into structured data |
| AI output | Early LLM APIs returning broken or invented JSON | Every response validated, retried, and now schema-enforced |
| Meal planner | No way to tell if a change helped | Versioned configurations scored on 20+ metrics; AI cost per plan down 59% |
| AI access | Data only inside the app | An MCP server: ChatGPT, Claude, Gemini and other AI chats can read recipes and meal plans |
| Quality | MVP-stage code | 100% backend test coverage, CI/CD and penetration tests |
A working demo that couldn't grow.
The client is a US-based meal-planning app that builds weekly meal plans and recipes for its users. It started as an MVP running on a single server: good enough for a demo, not for growth.
The owner wanted AI-generated meal plans. That raised problems no off-the-shelf tool solved at the time. Recipes sat in documents with hundreds of different layouts, many spread across several pages. Early language-model APIs often returned broken or invented JSON, which crashes an app. And nobody could say whether a new prompt or model made meal plans better or worse.
One engineer across the backend and the AI.
Efrain Coello, founder of InnovateHub Labs, designed and built the backend and every AI feature: the cloud architecture, the import pipeline, the language-model integration, image generation, the measured meal planner and AI security. Specialists hired by the owner built the apps and design. Cloud, data and AI decisions sat with one engineer, so they fit together.
Eight phases, each one in production.
A production foundation on AWS
One of the first steps was to put two principles on the table: the AWS Well-Architected Framework, with its six pillars of operational excellence, security, reliability, performance efficiency, cost optimization and sustainability, and infrastructure as code. With those agreed, the backend moved from one server to a distributed setup: containers on ECS, a managed database on RDS, files on S3 behind CloudFront, credentials in Secrets Manager and a web application firewall (WAF). All of it is defined as code with AWS CDK, which made the migration off the single server repeatable and means every environment can be rebuilt the same way.
An import pipeline for messy recipe documents
We started with Amazon Textract for text extraction. It struggled with the variety of layouts and with recipes split across pages, so we added a language-model step that reassembles each recipe and maps it into structured fields: ingredients, quantities, steps and nutrition.
Reliable AI output before the APIs offered it
We integrated one of the first versions of the OpenAI API, before structured-output features existed, so we built our own client layer. A validator checks every JSON response against our schema and retries generation when it fails. When the API added native JSON-schema support, we switched with little rework, because the validation contract was already ours.
Generated recipe images
When we started, no image model offered a usable API, so we built a workaround to give every recipe a picture. Today the pipeline uses Google's Gemini image model (Nano Banana).
A meal planner that is measured, not guessed
We built several planners side by side with the strategy pattern, so each can be swapped in and compared. Every AI setting is versioned: prompts, context, parameters and model. A snapshot system records each configuration, and every plan it generates is scored on more than 20 metrics: quality gates (invented recipes, rule violations, duplicates) where any breach rejects the version, plan quality, cost and speed, and user behaviour such as swaps, regenerations and 7-day retention, scored a week after each plan. We can see which change improved plans and roll back any that didn't.
Meal plans inside ChatGPT, Claude and Gemini
An MCP server (Model Context Protocol) connects the app to the AI chat apps people already use, such as ChatGPT, Claude and Gemini. From a chat, users can search recipes they can cook, read their meal plan and open any recipe's ingredients, steps and nutrition.
Security testing
We run penetration tests on the platform and test the AI features against prompt injection and misuse, alongside WAF rules at the edge.
AI-assisted engineering: 100% test coverage and CI/CD
We used AI coding tools to write and maintain the test suite, which took the backend to 100% test coverage. A CI/CD pipeline runs every test on every change before it deploys, so new prompts, models and features ship without breaking what already works.
First planner version vs the current one.
From the planner's own evaluation system: three versions, every AI-generated meal plan scored. Means per plan.
| Metric | First version (v1) | Current version (v3) |
|---|---|---|
| AI cost per plan | $0.135 | $0.055, 59% lower |
| AI time to generate a plan (mean) | 16.2 s | 11.6 s, 29% faster |
| Plans breaking a dietary or plan rule | 5% | 0% |
| Plans repeating a recipe | 14% | 1.9% |
| Meal slots filled | 96.5% | 100% |
| Tool-call errors per plan | 0.095 | 0 |
| Invented recipes | 0 | 0, in every plan scored |
| Trade-off found | 5.4 cuisines per plan | 4.7 cuisines per plan: variety is the next thing to tune |
AI that ships, and keeps shipping.
Own the contract, not the model.
Our JSON validator and our image workaround were both replaced by native model features later. Because our code defined what a good answer looks like, each upgrade was a swap, not a rewrite.
Own the contract, not the model
Define what a valid answer looks like in your own code. Models change every few months; your contract shouldn't.
Measure before you tune
A prompt that reads better is not proof that plans got better. Only a metric tells you that, including the bad news: our cheapest version also gave less cuisine variety, and we saw it the same day.
Version everything
A prompt is code. Give it versioning, snapshots and rollbacks like any other release.
About projects like this one.
Can you add AI to an app we already have?
Yes. That is what this project was: an existing app, rebuilt step by step. Each phase went to production on its own, so the app kept working while the AI was added.
How do you stop AI output from breaking our app?
Every response is checked against a schema before the app uses it, and generation is retried when a check fails. Today most model APIs can enforce a schema natively, and we use that where it exists.
How do you know an AI change is an improvement?
Every prompt, model and parameter is versioned, and each version is scored against the same metrics, with hard gates that reject a version on any breach. On this project that took AI cost per plan down 59% with zero rule violations. You see which change helped and can roll back any that didn't.
Can you work alongside our existing team or other vendors?
Yes. On this project the backend and AI were built alongside other specialists who handled the apps and design.
Do we own the code and the models?
Yes. On full payment, everything we build for you is yours. We keep only our own pre-existing tools and general know-how.