Industry Food & health Client US meal-planning app Scope Backend & AI Services AI & LLMs · Cloud · MLOps

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.

−59%AI cost per meal plan, first planner version to current
−29%AI time per meal plan, 16.2 s to 11.6 s mean
0invented recipes in any AI meal plan scored
−86%plans repeating a recipe, 14% to 1.9%
The case study in 33 seconds
At a glance

Before and after.

AreaBeforeAfter
InfrastructureAn MVP on a single serverDistributed on AWS, defined as code with CDK
Recipe dataDocuments in hundreds of layouts, many split across pagesAn import pipeline that turns them into structured data
AI outputEarly LLM APIs returning broken or invented JSONEvery response validated, retried, and now schema-enforced
Meal plannerNo way to tell if a change helpedVersioned configurations scored on 20+ metrics; AI cost per plan down 59%
AI accessData only inside the appAn MCP server: ChatGPT, Claude, Gemini and other AI chats can read recipes and meal plans
QualityMVP-stage code100% backend test coverage, CI/CD and penetration tests
The client and the challenge

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.

Who built it

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.

The approach

Eight phases, each one in production.

  1. 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.

  2. 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.

  3. 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.

  4. 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).

  5. 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.

  6. 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.

  7. 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.

  8. 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.

The numbers

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.

MetricFirst version (v1)Current version (v3)
AI cost per plan$0.135$0.055, 59% lower
AI time to generate a plan (mean)16.2 s11.6 s, 29% faster
Plans breaking a dietary or plan rule5%0%
Plans repeating a recipe14%1.9%
Meal slots filled96.5%100%
Tool-call errors per plan0.0950
Invented recipes00, in every plan scored
Trade-off found5.4 cuisines per plan4.7 cuisines per plan: variety is the next thing to tune
Results

AI that ships, and keeps shipping.

100%backend test coverage, every change tested in CI/CD
−59%AI cost per meal plan, with 29% faster generation
0%of plans on the current version broke a dietary or plan rule
Pen testedplatform and AI features tested against attacks
What we learned
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.

  1. 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.

  2. 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.

  3. Version everything

    A prompt is code. Give it versioning, snapshots and rollbacks like any other release.

Questions buyers ask us

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.

Stuck between the demo and the product?

Tell us what you're building. In a free 30-minute call you get a written plan, hire us or not.

Book a free strategy call
More work

← All case studies