Nutritionist Bot: how I built an AI nutrition app from A to Z
Of all the projects I've built, Nutritionist Bot is the one people ask me about most. Not because it's the flashiest, but because it started from a simple question: could an app give someone a real, personalized nutrition plan in seconds — the way a dietitian would, but available any time? This is the honest story of how it went from an idea to a SaaS that people pay for.
This article is the full story: why I built it, how it actually works under the hood, the technical decisions I'm proud of, and the traps that cost me sleep. I'm writing it the way I'd tell it over a coffee — no needless jargon, and no pretending it was all easy.
Why build yet another nutrition app?
Honestly, the market is crowded. But when I looked closely, most apps do one of two things: either they hand you a disguised spreadsheet where you enter everything yourself, or they throw a generic copy-paste plan at you that accounts for nothing. Neither feels like what a real professional does: listen to you, calculate for your specific body, and explain it. That gap is what I wanted to fill.
The real problem with classic diet apps
The core issue is trust. A nutrition app deals with numbers that touch people's health. If it gets calories wrong, that's not a cosmetic bug — it can push someone to eat far too little for weeks. A lot of the "AI" apps that shipped recently just ask a chatbot "make me an 1,800-calorie plan" and copy the answer. That terrified me. A language model is great at writing, not at doing reliable math every single time.
What Nutritionist Bot actually does
From the user's side, it's simple. You answer a short questionnaire — age, weight, height, activity level, goal (weight loss, muscle gain, maintenance), preferred diet, allergies and foods to avoid. A few seconds later you get a personalized, multi-day meal plan with your calories and macros (protein, carbs, fat), concrete meals, and a clean PDF you can download and follow.
- Automatic calorie and macro calculation tuned to your body and goal.
- A multi-day meal plan with real dishes, not "100g of chicken" on repeat.
- Respects allergies, disliked foods and your diet type.
- A polished PDF export, in English or Arabic, to keep on your phone.
- A personal space to track your weight and find your past plans.
How the app calculates your calories and macros
This is where the seriousness lives. The app starts from your basal metabolic rate (BMR) with a well-known formula, then adjusts it for your activity level to get your total daily energy expenditure (TDEE). From there it applies your goal: a sensible deficit to lose, a slight surplus to gain. Only then does it split those calories into macros based on your chosen diet. All of it is computed in code, step by step, exactly like a nutritionist with a calculator — not "guessed" by an AI.
The idea, and why it scared me
From the outside, a nutrition platform sounds simple: enter your data, get a plan. But the moment you care about getting it right, it gets hard. A plan has to account for someone's weight, goals, allergies and habits — and stay safe even for someone who's pregnant, breastfeeding or managing a health condition. I wasn't going to ship an app that spits out random numbers. That meant combining real nutritional logic with AI, not just wrapping a chatbot.
Building it, piece by piece
I built it with Next.js, React and TypeScript. But the part I'm proudest of isn't visible from the outside — early on I decided the system would be hybrid: every number is computed deterministically in code, and the AI never decides a calorie or a macro. Its only job is to turn those fixed numbers into a readable, personalized meal plan.
- All the math — calories from BMR and TDEE, macros, medical limits — is computed in TypeScript, not guessed by the model.
- A database of around a thousand recipes, hard-filtered by each person's diet and health profile before anything is generated.
- Accounts with JWT authentication, Stripe and PayPal billing, and a polished PDF export rendered with Puppeteer.
- Full Arabic support, including right-to-left text shaping inside the PDF.
The moment it almost broke
The hardest part was trusting what the AI returns. A model can produce something that looks perfect but is subtly wrong — or malformed JSON that breaks the whole request. So I validate every response against a strict schema, and if it fails, a deterministic fallback still builds a valid plan. The app never shows a broken or made-up result. That mindset — assume the AI will fail, and design so it doesn't matter — is what turned a clever demo into something I'd feel safe charging money for.
A demo impresses people for five minutes. A product has to be right every single time — that's a completely different bar.
How the AI actually personalizes your plan
Once the numbers are locked, the AI gets a rich context: your profile, your exclusions, the diet type, and a pre-selected shortlist of compatible recipes. Its job is to assemble all of that into a coherent program, varying meals, respecting your restrictions, and keeping a clear tone. The result isn't vague "eat balanced" text — it's a real day-by-day program you can start at your next meal.
Diets and restrictions it supports
Not everyone eats the same way, and a nutrition app that ignores that is useless. Nutritionist Bot handles different diet types and, crucially, respects exclusions: allergies, foods you can't tolerate, personal or religious restrictions. If a food is excluded, it never reappears anywhere in the plan — it's not a "best effort" filter, it's a hard rule applied before the AI writes a word.
Safety first: pregnancy, breastfeeding, conditions
This is the part where I took no shortcuts. A pregnant or breastfeeding woman doesn't have the same needs, and some health conditions impose specific limits. The app applies these medical constraints to calories and macros before generating anything, and clearly states it remains a wellness tool, not medical advice. An app that's honest about its limits beats one that pretends to replace a doctor.
Teaching it from real nutrition knowledge
A generic chatbot doesn't know your situation — it knows the average of the internet. I wanted plans grounded in real nutrition material, so I built an ingestion pipeline: feed in proper nutrition references, break them into searchable chunks, and let the system pull the relevant passages when it builds a plan. Before any meal is even chosen, the engine also shortlists from a database of around a thousand recipes, filtered against the person's diet and health profile. The AI writes on top of that foundation — it doesn't invent it.
Built with a clinical nutritionist — not alone
Here's the part that matters most, and the part I can't take full credit for: the nutrition side wasn't my work. From the start, the project was supervised by Manal Abu Khalaf, a specialist nutrition doctor of Palestinian origin. She's the one who provided the clinical material — the reference files, the medical guidelines, the rules for different health conditions — and she followed the plans the app produced, checking the results and correcting course. I built the software; she made sure the nutrition behind it was sound. That partnership is the real reason I'm comfortable calling the logic trustworthy: it isn't a developer guessing at nutrition, it's a developer turning a professional's knowledge into a reliable product.
More than a generator — a whole product
A one-off plan is a feature, not a business. To make it something people come back to, I built the rest of the product around it:
- A personal dashboard with macro cards and a weight-trend chart.
- An AI Coach the user can actually chat with about their plan.
- Weight logging and history, so progress is visible over time.
- Saved plans they can re-download as a PDF any time.
- A full admin console — users, orders, subscriptions, analytics — plus a live panel to tune the AI without touching code.
Building it in two languages, including Arabic
Most tools treat Arabic as an afterthought. I didn't want that. The trickiest part was the PDF: Arabic reads right-to-left and its letters change shape depending on where they sit in a word, and most PDF tools render it broken and reversed. Getting a clean, properly shaped Arabic plan out of the export took real work — but it's exactly the kind of detail that tells a user the product was built for them, not translated at the last minute.
Keeping the AI fast and cheap
Because the heavy lifting happens in code, the AI call itself stays small and inexpensive — and I cache results so the same profile doesn't pay for the same work twice. That's the unsexy side of building with AI: the goal isn't to use the biggest model everywhere, it's to use it exactly where it adds value and nowhere else. That's the difference between a product that's affordable to run and one that quietly burns money.
Payments, subscriptions and scaling
A product has to pay for itself. I integrated payments and subscriptions (Stripe and PayPal), with account management and secure authentication. The architecture is built to grow: adding users breaks nothing, and the AI part is isolated so it can be tuned or swapped without touching the rest.
How long it took, and what it taught me
It didn't happen in a weekend. Between the nutrition logic, the AI integration, payments, the Arabic PDF and every screen, the project was built layer by layer, with plenty of back-and-forth. The biggest lesson: with AI, the demo is easy — reliability is hard. Anyone can build an app that "works once." Making it work every time, for real paying users, is a different craft.
Frequently asked questions
Does Nutritionist Bot replace a nutritionist? — No, and it doesn't claim to. It's a wellness tool that gives a serious, personalized starting point. For a medical condition, always see a professional.
Is the app available in Arabic? — Yes. The interface and the plans (PDF included) are available in Arabic, with correct right-to-left rendering.
Does it calculate calories and macros automatically? — Yes. You don't need to know your numbers: the app computes them from your profile and goal.
Can it be used for both weight loss and muscle gain? — Both. You pick your goal and the app adjusts the calories accordingly.
What I took from it
Nutritionist Bot taught me that AI is the easy part to show off and the hard part to get right. Today it's live, people sign up and pay, and it runs on its own. If you have an idea for an AI-powered product and you're wondering whether it's realistic, that's exactly the kind of conversation I enjoy — tell me what you have in mind and I'll be honest about what it takes.
Tell me what you're building and I'll tell you how to ship it.
Start a conversation