Jason Moynihan

Dialed

An AI-powered meal planner that turns food preferences and targets into portion-accurate days with dynamic variety

SCROLL

Overview

Dialed is a React/Next.js meal planning app that converts calorie and protein goals into realistic meals, portion-accurate daily plans, and a weekly schedule with recipes and a grocery list. Users first select preferences via a guided questionnaire, approve AI-generated meals, then the app builds optimized day plans that hit targets by scaling ingredient portions. Finally, users arrange their week with dynamic variety and customization

Project Goals

1

Make meal planning fast and amazing with dynamic AI powered meals

2

Hit daily calorie/protein targets precisely via optimization

3

Allow users to easily swap in new meals, auto portioned to fit

4

Give users recipes and a weekly grocery list to remove barriers to following the plan

Problems & Solutions

1

What do I eat?

Most people don’t know what foods are healthy, realistic, or fit their tastes. Nevermind what will help them make progress toward their goals. The result is decision fatigue and never making a solid plan.

Guided Meal Discovery

Dialed starts with a short preference questionnaire, then uses AI to generate a personalized set of meals with images and recipes. Users simply approve or decline cards, so their plan is built only from foods they actually want to eat.

Next.jsOpenAI APIZustand
2

How much should I eat?

Figuring out calories and protein portions is overwhelming. Not only do people not know how much protein or calories to consume, but it's also hard to do the portioning.

Automatic Portioning

Dialed calculates calorie and protein targets upfront, then uses a custom solver to portion meals automatically. Users never touch the math—meals scale to hit targets precisely, every day, with their chosen meals per day.

TypeScriptGLPK.jsLinear Programming
3

I want variety, but repeatability

Nobody wants to eat the same thing every day, but they also don't want cooking and shopping to be a nightmare.

Portion Locking + Unique Days

Once a meal is portioned in a position (e.g., lunch), it stays consistent across the week. Dialed then generates as many unique daily plans as possible using all users approved meals

Solver constraintsZustand store
4

Meal plans get boring fast

Even the best plan wears thin after a few weeks. Most meal planners force you to stick with the same foods or redo the entire process from scratch.

Dynamic Swaps, Zero Effort

With Dialed, variety is built in. Approve a new meal or select from your approved set and swap it in for any existing meal. The solver instantly regenerates complete daily plans with updated recipes and grocery lists—no manual recalculation required.

Next.jsZustandSolver integration

Key Features

Dialed handles the entire meal planning workflow—from targets to recipes—so users don't have to guess or do the math.

Personalized Plans

Dialed calculates maintenance calories for the individual based on provided bio data and activity level using the Mifflin-St Jeor Equation

Calorie + Protein Targets

Dialed calculates personalized daily calorie and protein goals based on users goals. Clarity from the start.

Ingredient Questionnaire

Pick proteins, carbs, veggies, and exclusions. Feeds GPT to generate on-target, realistic meals with recipes.

AI Meal Generation with Images

AI-generated meals arrive as cards with images and recipes. Approve to keep, skip to replace—no clutter, no overwhelm.

Portion-Accurate Day Builder

A custom solver scales meal ingredients to hit calorie and protein targets exactly, respecting fixed vs scalable ingredient items.

Weekly Planner with Drag-and-Drop

Arrange unique days on a weekly grid. Drag to reorder, snap meals to precise times, and assign days in seconds.

Easy Variety Toggles

Dialed keeps plans fresh without chaos. Use simple variety controls to shuffle through all valid daily plans while keeping portions locked and shopping consistent.

Tech Stack

Modern web stack with mathematical optimization, AI integration, and a polished front-end experience.

Frontend

React
Next.js
TypeScript
Zustand
Tailwind CSS
shadcn/ui
@dnd-kit
Framer Motion

Backend & Optimization

Next.js API Routes
OpenAI API
GLPK.js (Linear Programming)
Deviation-based objective

Tools & Services

Vercel
GitHub
ESLint

Development

React Testing Library
Vitest/Jest (planned)
Storybook (planned)

Technical Challenges

Engineering highlights across AI generation, mathematical optimization, randomized ordering search, and high-polish UX.

Context / Constraints

Users begin with a structured ingredient preference questionnaire and then refine via chat. The system must generate new meals, edit existing ones in place, avoid duplicates, and stay snappy for a truly unique adn flexible meal creation system UX.

Approach

  • Prompt builder composes a deterministic system prompt from questionnaire selections (proteins, carbs, veggies, exclusions).
  • Chat intent router classifies inputs as (generate more, or edit) applies append or in-place edit accordingly.
  • Dedup guard using a canonical meal signature (normalized name + top ingredients) to prevent near-duplicates.
  • Async images: render cards instantly with placeholders; enqueue image jobs; patch meals with URLs when ready (more on this below)

Trade-offs

  • Slightly more complex routing and diff logic vs. a single ‘generate’ path.
  • Requires consistent canonicalization to keep dedup reliable across prompts.
  • Eventual consistency for images (brief placeholder state).

Outcome

A responsive creation/edit flow where users can iterate quickly—cards appear immediately, edits are surgical, and visuals catch up without blocking. This creates a truly unique personlized experience.

Technologies

Next.js API RoutesOpenAI APIZustand

Context / Constraints

Hit daily calorie/protein targets while sauces/spices remain fixed, primary ingredients scale, and portions stay consistent per (meal, slot).

Approach

  • Decision variables only for scalable ingredients; fixed items contribute macros but never scale.
  • Deviation-based objective: minimize |calories−target| + |protein−target| with tunable weights.
  • (mealId, slotIndex) portion locking: once solved for a slot, the portion is reused wherever that slot/meal appears.
  • Return precise grams and user-friendly amounts for display; persist locks to state.

Trade-offs

  • LP modeling and debugging is more complex than heuristics.
  • Solver constraints must be curated to avoid infeasible problem setups.

Outcome

Days that actually hit targets without weird micro-adjustments, and that stay consistent across the week for easier prep and shopping.

Technologies

TypeScriptGLPK.jsLinear Programming

Context / Constraints

Given approved meals and meals-per-day, generate as many valid day plans as possible under slot/portion constraints—without exploding combinatorially.

Approach

  • Enumerate candidate day compositions from approved meals under slot locking; bundle into weekly plan candidates.
  • For each weekly plan, sample K random orderings (rather than all permutations).
  • Sequential solve per ordering: optimize Day 1 → lock portions; then Day 2 using the locks; continue until infeasible.
  • Keep the ordering that yields the largest valid-day set for that weekly plan; repeat for all weekly plans.
  • Persist every resulting valid-day set to storage for downstream variety browsing.

Trade-offs

  • Random sampling is non-deterministic; best-found set can vary run-to-run.
  • Sequential locking can cause early commitments that block later days.

Outcome

Produces a rich library of feasible day plans within a predictable runtime budget, enabling meaningful variety without chaos.

Technologies

TypeScriptGLPK.jsRandomized search

Context / Constraints

Plans get boring unless variety is easy. Users should toggle how much variety they want, swipe through precomputed valid day sets, and schedule precisely.

Approach

  • Variety picker selects among stored valid-day sets; can target an ‘X-day’ variety level (e.g., 3, 5, 7 unique days).
  • Swipeable plan browser to review all valid days at the chosen level; portion locks preserve grocery consistency.
  • Weekly grid integrates with the chosen set: drag-to-reorder, vertical snap to 15-minute intervals, persist `mealTime` to state.

Trade-offs

  • Precomputed sets require storage and selection heuristics.

Outcome

A tactile, low-friction planner that keeps meals interesting while keeping prep and shopping predictable.

Technologies

@dnd-kitZustandFramer Motion

Context / Constraints

Realistic AI images massively bosst the UX when choosing meals, but blocking meal cards on image generation hurts perceived speed.

Approach

  • Render meal cards immediately with placeholders; enqueue image jobs per meal (name + ingredients).
  • On completion, patch the meal’s image URL in Zustand; cards update in place with no layout shift.
  • Idempotent writes keyed by mealId to avoid flicker and retry loops.

Trade-offs

  • Requires background job handling and retry policy.
  • Images aren't ready immediately, at the whim of the model API

Outcome

Users get amazing AI geenreated images of the meals, so that they can see what they'll be eating, without the UX slowing down.

Technologies

Next.js API RoutesOpenAI Images (or provider)Zustand

Results & Impact

Dialed was built to explore how AI and optimization can remove friction from healthy eating while keeping plans realistic. While it never launched publicly, the project demonstrates the kind of user value and engineering depth I aim to deliver.

Intended User Value

  • Generate a complete weekly plan in minutes, tailored to calorie/protein targets.
  • Portion locking ensures consistency in shopping and meal prep across days.
  • Drag-and-drop scheduling makes adherence practical and flexible.

Engineering Wins

  • Solver migrated to GLPK.js with a deviation-based optimization objective.
  • Robust JSON streaming pipeline with phase tags and safe parsing.
  • High-polish UI: typewriter streaming, Markdown rendering, smooth drag-and-drop.

What’s Next

  • Add macro ranges (min/max) and fiber/fat constraints to the solver.
  • Export weekly plans to grocery lists and calendars.
  • Recipe import and nutrition parsing directly from URLs.