Inspiration

Office and factory canteens routinely over-prepare food because they have no reliable signal of who's actually eating the next day — leading to daily waste, and sometimes running short for employees who do want to eat. We wanted a simple way for employees to signal their meal plans a day ahead, in their own words, and have that translate directly into what the kitchen prepares. ...as we usually write... This entire build was also an experiment in AI-native development — GPT-5.6 shaped the system design before a single line was written, and Codex then implemented it feature by feature.

MealFlow

AI-powered meal planning — architected with GPT-5.6, built with Codex.

Built with Codex Planned with GPT--5.6

What it does

MealFlow is a role-based web app for company canteens:

  • Employees get asked every evening what they want for tomorrow's breakfast/lunch/snacks. They can pick from the menu, skip a meal, or just type a reason in plain language — "I'll be on leave tomorrow" — and the AI converts that into a structured skip/preference automatically.
  • Master Chefs publish the next day's menu with item-level capacity limits (e.g. only 100 biryanis), so the kitchen never over- or under-cooks.
  • Main Admins onboard the company, import employees via CSV/XLSX, set free/paid/subsidized meal pricing, and see participation + waste analytics.
  • Chef Helpers verify meal pickup via a signed, single-use QR pass — no personal data stored in the code itself.
  • Head Admin monitors all companies on the platform and handles account recovery, without ever touching a company's day-to-day meal data.

Every confirmed selection generates a QR meal pass; scanning it at pickup marks the meal collected exactly once, preventing double-serving.

How we built it

  • GPT-5.6 for architecture and product planning — designing the normalized database schema, mapping out the five-role workflow (Head Admin, Main Admin, Master Chef, Chef Helper, Employee), and working through edge cases like atomic capacity reservation and AI confidence-tiering before any code was written
  • Codex as the primary coding agent — implemented nearly every feature end-to-end, from auth and admin dashboards to CSV/XLSX employee import, menu publishing, and QR meal-pass generation, built one scoped feature at a time and verified against the live app and database
  • Next.js + TypeScript + Tailwind CSS for the responsive web app
  • Supabase for authentication (passwordless email OTP), Postgres database, and row-level security so each company only sees its own data
  • Resend for invite and reminder emails
  • Gemini API for natural-language meal-preference understanding, using a confidence-tiered approach: high-confidence requests apply automatically, medium-confidence ones ask for one-tap confirmation, and unclear ones prompt a clarifying question
  • Deployed on Vercel

We designed the database around normalization and audit logging from the start — every AI decision, admin edit, and QR scan is logged with the original input preserved, so nothing is silently overwritten.

AI-assisted development

This project leaned heavily on two AI tools, each for a distinct role:

GPT-5.6 — architecture and planning Used before any code was written to design the normalized database schema, define the five-role workflow (Head Admin, Main Admin, Master Chef, Chef Helper, Employee), reason through tricky edge cases like atomic capacity reservation to prevent overselling, and design the confidence-tiered logic for natural-language meal preferences.

Codex — implementation Used as the hands-on coding agent for nearly the entire build — auth, CSV/XLSX import, menu publishing, QR generation, Supabase migrations — one scoped feature per prompt, each verified against the running app and database before moving forward.

Every AI-generated change was reviewed and tested manually; AI accelerated implementation, but design decisions and verification stayed human-driven.

Challenges we ran into

  • Preventing overselling: worked through this with GPT-5.6 to design an atomic database update instead of a check-then-write pattern, then had Codex implement it directly.

  • Free-tier email limits: both Supabase's built-in mailer and Resend's default sending address restrict who you can email during testing, which we worked around with a custom SMTP domain and a safe, clearly labeled demo-login mode for reviewers.

  • Keeping AI answers safe and scoped: making sure the natural-language assistant only ever acts on meal preferences — never guesses silently on low-confidence input, and never touches another employee's data.

  • Data isolation: making sure one company's data is never visible to another, enforced at the database level with row-level security rather than just in the UI.

What we learned

Building this reinforced that the "boring" plumbing — atomic transactions, audit logs, role-based access, rate limits — matters more for a real operational tool than the AI feature itself. We deliberately built the plain forms-and-buttons version of every flow first, and only layered AI on top once the underlying data flow was solid.

Acknowledgments

Built with the assistance of GPT-5.6 (architecture & planning) and Codex (implementation).

What's next

  • Push notifications and WhatsApp reminders alongside email
  • Demand forecasting using historical selection data
  • Native mobile app (React Native/Expo) sharing the same backend and rules
  • Support for factories, schools, and event receptions using the same configurable data model

Built With

  • ai-prediction
  • authentication
  • codex
  • csv
  • food-waste-reduction
  • gemini
  • gpt5.6
  • indexing
  • javascript
  • jwt
  • next.js
  • qr-code
  • rag
  • rbac
  • react
  • resend
  • responsive-web-design
  • rest-api
  • rls
  • smtp
  • supabase
  • supabaseauth
  • typescript
  • vercel
  • xlsx
Share this project:

Updates