Chef is an AI-powered meal execution platform.
The product vision is to help people move from food intent to cooked meal:
food idea -> structured recipe -> constraints -> missing ingredients -> real grocery cart -> cooking guidance
The initial wedge is practical: generate or import a meal, edit it to the user's constraints, remove what they already have, and generate an editable retailer grocery cart.
The repo is still named cart-generator, but the internal product/team name is now Chef.
See CHANGELOG.md for recent changes and fixes.
Chef is not meant to be another recipe database, generic grocery list, calorie tracker, or chatbot.
It should become a personal cooking operating system that connects:
- recipe generation
- recipe import/forking from outside sources
- AI recipe editing
- calories and macros
- grocery cart generation
- retailer product matching
- pantry/inventory awareness
- live cooking assistance
- future community recipe/cart forking
The current frontend should be treated as a functional validation harness. Avoid major frontend polish unless it unblocks core product validation. The next durable work should happen in backend contracts, provider/tool boundaries, recipe AI, nutrition, and cart execution.
The backend is well past scaffold stage, and the current web app validates the core recipe-to-cart loop. The current product already has:
- real auth with email/password and Google login
- required onboarding
- account/settings and security
- account checkout profile editing for saved addresses and payment cards
- a planning home
- a weekly meal-planning surface
- a dedicated recipe library
- a dedicated kitchen inventory surface
- draft/cart creation and editing through large overlays
- persisted
CartDraft,Cart, andShoppingCartresources behind the internal/api/v1contract - persisted weekly
MealPlanresources behind the internal/api/v1contract - quantity controls for recipe selections in the planning composer and for line quantities in shopping carts
- a shared ingredient catalog and user kitchen inventory for demoing "already have this" behavior
- an authenticated AI layer for chat, structured recipe generation, import structuring, and ingredient swap suggestions
- a live Kroger retailer path behind a provider boundary
- an Instacart shopping-list handoff path behind a cart-export boundary
The Next.js web app in apps/web now splits product surfaces more explicitly:
/is the authenticated planning home for recent carts and drafts/recipesis the dedicated recipe library surface/shoppingis the dedicated saved shopping-cart library/meal-planis the weekly planning workspace for breakfast/lunch/dinner assignment/inventoryis the kitchen inventory workspace with manual add flow and a camera-assisted capture UI shell/chef-aiis the dedicated AI workspace, while the global Chef chat widget is mounted across authenticated app pages- recipe detail opens as a large overlay
Add to cartfrom recipe detail opens the cart builder preloaded with that recipe- draft creation, cart creation, draft detail, and cart detail all use large overlays instead of being the primary navigation path
- draft/cart detail overlays now support edit and delete flows
- cart detail can now generate a
ShoppingCartand open its retailer-facing detail overlay in place - shopping-cart detail now supports manual editing over the same persisted resource: replace matches, add manual items, delete lines, and save
- saved shopping carts can now be browsed from a dedicated
/shoppingsurface /account/settings/*holds account, preferences, and security/account/settings/paymentnow edits the user's checkout profile with saved addresses and payment cards- onboarding and account preferences now also persist a neutral
shopping_locationblock (manual first, GPS-ready later)
The NestJS API in apps/api currently supports:
- user and admin identities in the database
- real auth endpoints for email/password, Google login, refresh, logout, and
/me /api/v1/me/preferencesfor auth-backed cuisine and tag preferences/api/v1/me/preferencesalso carries a neutralshopping_locationprofile blockshopping_locationnow also supportskroger_location_idso future store reuse can skip repeated location resolution/api/v1/me/checkout-profilefor saved addresses and payment cards used by checkout-oriented UI flows/api/v1/me/onboarding/completefor explicit onboarding completion/api/v1/meal-plansfor user-scoped weekly meal-plan read/upsert byweek_start- a global controlled cuisine catalog exposed at
/api/v1/cuisines - hybrid tags with explicit
/api/v1/tagsendpoints - global system recipes and user-owned recipes
- recipe CRUD for user-owned recipes
- optional
cover_image_urlandnutrition_dataon recipes - explicit dietary badge tags through
Tag.kind = dietary_badge - shared
Ingredientrecords seeded from recipe ingredients - user-scoped kitchen inventory at
/api/v1/me/kitchen-inventory - an explicit fork flow for copying a system recipe into a user-owned editable recipe
- persisted
cart-drafts,carts, andshopping-carts - deterministic conversion from recipe selections into recipe-based carts
- persisted retailer context on drafts and carts
- derived aggregated ingredient overviews on cart reads
- deterministic ingredient aggregation and provider-backed retailer matching behind shopping-cart generation
- a mock retailer provider for local/dev fallback
- a real Kroger provider for live location lookup and product search
- an Instacart cart-export provider that can generate an external shopping-list URL
/api/v1/retailers/capabilitiesto expose which retailer paths are configured, handoff-only, or partner-gated- a Walmart provider boundary that remains available but inactive by default
- retailer product search and shopping-cart editing APIs behind the same shopping-cart boundary
- rule-based grocery matching refinement for produce/plain pantry items and honest no-match handling for specialty ingredients
- authenticated AI endpoints under
/api/v1/aifor Chef chat, structured meal generation, recipe-import structuring, and ingredient swap proposals - internal
/api/v1route families forrecipes,recipe-forks,cart-drafts,carts, andshopping-carts - internal
/api/v1/tagsfor visible system tags and user-owned tags - Swagger UI at
/docs - request tracing via
x-request-id
packages/shared contains the current TypeScript domain contracts for:
- recipes
- cuisines
- selection and cart models
- meal plans
- aggregation
- matching
- users
- checkout profile data
The API uses Prisma + PostgreSQL.
- Prisma schema: apps/api/prisma/schema.prisma
- Migrations: apps/api/prisma/migrations
- Seed data: apps/api/prisma/seed
- Local Docker stack: infra/docker/docker-compose.yml
- Shared Supabase setup: docs/supabase-database.md
The main architecture and design notes live in:
- docs/business.md
- docs/goals.md
- docs/architecture.md
- docs/branching.md
- docs/decisions.md
- docs/llm-mechanism.md
- docs/models.md
Those docs now describe the startup thesis, the implemented v1 direction, the current prototype web state, the agentic product direction, and the next product/backend milestones.
cart-generator/
|-- apps/
| |-- api/
| |-- web/
| |-- mobile/
| |-- vision-lab/
| `-- llm-testing/
|-- docs/
|-- infra/
| `-- docker/
|-- packages/
| `-- shared/
|-- package.json
|-- pnpm-lock.yaml
`-- pnpm-workspace.yaml
This repository is public source, not open source.
The code is published for transparency, demonstration, and evaluation only. No permission is granted to copy, modify, distribute, sublicense, sell, host, operate, or otherwise use the software without prior written permission.
See LICENSE for details.
Full app development requires:
- Node.js and pnpm
- Docker Desktop for the local PostgreSQL stack
- Python 3.11 or newer for the vision sidecar
- a local
.envcopied from.env.example
On Windows, install Python first if python --version or py -3 --version does not work:
winget install Python.Python.3.11Use this path when setting up the full app on a new machine or after a clean clone.
For the shortest current setup guide, prefer local-dev-setup.md.
On Windows PowerShell:
pnpm setup
pnpm buildpnpm setup installs Node dependencies, creates .env from .env.example when missing, starts local PostgreSQL, generates Prisma, applies migrations, seeds data, creates .venv, and installs the vision dependencies.
Notes:
.envis intentionally ignored. Copy.env.examplelocally, then fill in any real secrets or shared database URLs out of band.apps/api/generated/prismais intentionally ignored. Regenerate it withpnpm --filter api prisma:generate; do not commit the generated client.node_modules,.venv,.next,dist, Python caches, local datasets, and model checkpoints are local artifacts. Do not commit them to fix another developer's machine.- Vision checkpoint folders are tracked under
apps/vision-lab/checkpoints/, but checkpoint binaries are intentionally ignored. Download shared checkpoints from the team Drive folder into the documented paths inapps/vision-lab/checkpoints/README.md. - Datasets, imports, previews, and scratch training output under
apps/vision-lab/data/are local artifacts and should stay out of Git.
Install dependencies:
pnpm installRun the full app:
pnpm devRun one app or a reduced stack:
pnpm dev:api
pnpm dev:web
pnpm dev:vision
pnpm dev:mainpnpm dev and pnpm dev:all run web, API, and vision-lab together. pnpm dev:main is only for working on web/API without the vision sidecar.
Build the workspace:
pnpm buildRun workspace checks:
pnpm lint
pnpm test
pnpm typecheckCreate or refresh the repo-local virtual environment and install the base vision dependencies:
pnpm vision:setupFor the optional live webcam path:
pnpm vision:setup:liveRun the FastAPI vision sidecar:
pnpm dev:visionRun the Streamlit lab:
pnpm vision:streamlitThe setup script creates .venv at the repo root. .venv is intentionally ignored and should not be committed.
Check whether shared checkpoint files are present:
pnpm vision:checkpointsShared checkpoint convention:
- Put base YOLO weights in
apps/vision-lab/checkpoints/base/. - Put ingredient classifier checkpoints in
apps/vision-lab/checkpoints/classifiers/ingredient/<run-name>/best_model.pt. - Put FoodSeg103 segmenter checkpoints in
apps/vision-lab/checkpoints/segmenters/foodseg103/<run-name>/weights/best.pt. - Put ingredient detector checkpoints in
apps/vision-lab/checkpoints/detectors/ingredient/<run-name>/weights/best.pt.
The folder tree and manifest template are tracked in Git; the checkpoint binaries are shared separately.
Root shortcuts:
pnpm api:setup
pnpm api:up
pnpm api:resetWhat they do:
-
pnpm api:setupPrepares the local backend without starting the server. Starts Postgres, generates Prisma client, applies existing migrations, and seeds local data. -
pnpm api:upStarts Postgres if needed and then runs the API in dev mode. -
pnpm api:resetDestructive. Resets the local API database, reapplies migrations, and reruns seed through Prisma.
Start PostgreSQL:
docker compose -f infra/docker/docker-compose.yml up -dApply migrations:
cd apps/api
pnpm prisma:migrate:devSeed the database:
pnpm db:seedStart the API:
pnpm start:devRecommended first-time local flow:
pnpm api:setup
pnpm api:upUseful API commands:
pnpm build
pnpm test --runInBand
pnpm test:e2e
pnpm test:e2e:ci
pnpm prisma:generate
pnpm prisma:studioSwagger:
- UI: http://localhost:3001/docs
- OpenAPI JSON: http://localhost:3001/docs/openapi.json
- system recipes are global and immutable
- user-created recipes are private by default
- unauthenticated recipe reads only see global system recipes
- authenticated users see global recipes plus their own recipes
- writes require authentication
/api/v1/meis the authenticated profile boundary- cuisines are now explicit global resources with
kind-based curation - recipe writes now use
cuisine_id, and recipe reads return bothcuisine_idand expandedcuisine - tags are now explicit resources with
systemanduserscope - tags now also carry
kind, so dietary badges likehalal,vegan, andgluten-freeare explicit curated system tags withkind = dietary_badge - recipe writes now use
tag_ids, and recipe reads return bothtag_idsand expandedtags - forking a system recipe creates a user-owned editable copy
- duplicate forks of the same source recipe are prevented per user
CartDraftis editable incomplete intent, not the main product objectCartis the stable recipe-based meal plan snapshot with retailer context and a derived ingredient overviewShoppingCartis the retailer-facing basket derived from aCart- kitchen inventory is a persistent "user says they have it" layer, not exact pantry automation
- cart overviews can mark ingredients as
in_kitchen, and shopping-cart generation skips those lines - aggregation and retailer matching remain deterministic
ShoppingCartcan now be manually corrected without regenerating a new planning artifact- dietary badges should come from tag metadata, not hardcoded booleans on recipes
nutrition_datais optional recipe detail metadata, not something every compact recipe card needs to show- generating a cart from an existing draft should consume that draft so recent work does not duplicate the same planning run
The clean internal v1 contract is now the implemented direction under /api/v1.
Resource families:
recipesrecipe-forkscart-draftscartsshopping-carts
Approved conceptual flow:
Recipe -> CartDraft -> Cart -> ShoppingCart
Interpretation:
CartDraftis editable user intentCartis the stable recipe-based meal plan snapshot with retailer context and derived ingredient overviewShoppingCartis the retailer-facing purchase basket derived from aCart
This separation is intentional:
Cartanswers "what do I want to cook?"ShoppingCartanswers "what do I need to buy?"- retailer matching and purchasable-product state still belong behind
ShoppingCart - real auth and future tags should be built on top of this API shape, not by reshaping it again
/api/v1is now the active internal API contract.- auth persistence now includes
AuthIdentityandRefreshToken. - cuisine persistence now includes a global
Cuisinecatalog. - tags persistence now includes
TagandRecipeTag. /api/v1/auth/register,/login,/google,/refresh,/logout,GET /me, andPATCH /meare implemented./api/v1/cuisinesnow exposes the global cuisine catalog./api/v1/me/preferencesnow supports read/replace for user cuisine and system-tag preferences./api/v1/me/preferencesnow also supportsshopping_location(zip_code,label,latitude,longitude,kroger_location_id) for future store resolution and location reuse./api/v1/me/onboarding/completenow marks onboarding completion independently from preferences./api/v1/tagsnow supports list/create/update/delete./api/v1/tagsnow returnskindso clients can distinguish general taxonomy tags from dietary badge tags./api/v1/ingredientsexposes the shared ingredient catalog./api/v1/me/kitchen-inventorysupports listing, adding, and deleting the current user's kitchen inventory items.Cart.overviewandShoppingCart.overviewcan now markin_kitcheningredients, and shopping-cart generation only matches/exports missing ingredients.POST /api/v1/recipe-forksreplaced the old save-style route.- recipes now require
cuisine_idand return expandedcuisineobjects. - carts now require
retaileron write and return derivedoverviewingredient data on read. cart-drafts,carts, andshopping-cartsare separate resources in API, shared models, and database schema.- Prisma migration
20260319113000_split_cart_and_shopping_cart_v1materializes the newCart/ShoppingCartsplit. - Prisma migration
20260319124500_add_cuisine_catalogmaterializes the controlled cuisine catalog and recipe relation. - Prisma migration
20260321130500_add_cart_retailermaterializes retailer persistence onCart. - the web app dashboard in apps/web now reads the
/api/v1endpoints and reflects the new model vocabulary. - the web app now separates planning home from recipe browsing:
/focuses on planning state and recent work, while/recipesowns the recipe library. /recipesnow has recipe detail overlays with ingredients, steps, andnutrition_data- recipe detail now uses
Add to cartinstead of creating drafts immediately - the cart builder is now the central planning composer, and drafts are treated as secondary persistence for incomplete work
- draft/cart detail overlays now support edit flows by reopening the same composer with hydrated selections, retailer, and name
- draft/cart detail overlays now support delete flows
- generating a cart from an existing draft now deletes that draft after successful cart creation
- cart detail now supports
Generate shopping cart, which opens a retailer-facing shopping-cart detail overlay on top of the same workspace - shopping-cart detail now supports manual correction on the same persisted resource
/api/v1/retailers/:retailer/products/searchnow exposes provider-backed product search behind the shopping-cart editor- the matching module now supports
MockRetailerProductProvider,KrogerRetailerProductProvider, andWalmartRetailerProductProvider - Kroger is now the first live retailer path, using the user's shopping location to resolve a nearby store before product search
- the Kroger provider now deduplicates concurrent token fetches, throttles uncached search bursts, and caches locations/query results to reduce burst traffic
- Instacart is now supported as a shopping-cart handoff path through
CartExportService, storingexternal_urlon the persistedShoppingCart - new API envs:
WALMART_USE_REAL_PROVIDER=true|falseWALMART_CLIENT_IDWALMART_CLIENT_SECRETWALMART_ENV=sandbox|production
- additional API envs:
KROGER_USE_REAL_PROVIDER=true|falseKROGER_CLIENT_IDKROGER_CLIENT_SECRET
- Instacart API envs:
INSTACART_USE_REAL_PROVIDER=true|falseINSTACART_API_KEYINSTACART_ENV=development|productionINSTACART_API_BASE_URLoptional override for sandbox/dev endpoints
PATCH /api/v1/shopping-carts/:idnow persists manual shopping-cart edits- shopping-cart editing now supports manual line items, replacing matches, deleting lines, and changing
selected_quantity - draft/cart editing now supports per-recipe quantities, so the same dish can appear multiple times in one planning run
/api/v1/retailers/capabilitiesnow reports demo-ready retailer capabilities:- Instacart is the preferred cart handoff path when configured
- Kroger is the live product-search and subtotal path
- Walmart remains partner/approval-gated for now
/api/v1/meal-plansnow persists one weekly meal plan per user and Mondayweek_start/api/v1/me/checkout-profilenow persists saved addresses and payment cards for checkout-oriented flows/api/v1/ai/chat,/api/v1/ai/meals/generate,/api/v1/ai/recipe-imports/structure, and/api/v1/ai/recipes/swap-ingredientnow provide the first integrated Chef AI layer- the web app now mounts a global Chef chat widget across authenticated workspace pages through
AppShell - the web app now includes dedicated
/meal-plan,/inventory,/chef-ai, and/account/settings/paymentsurfaces apps/llm-testingnow exists as a separate Streamlit lab for prompt/schema experimentation outside the main app
Use mock AI locally without model calls:
CHEF_LLM_PROVIDER=mockUse OpenAI for real model calls:
CHEF_LLM_PROVIDER=openai
OPENAI_API_KEY=your_key_here
OPENAI_MODEL=gpt-5.4-miniThe next high-signal work is now more product-shaped than before.
The current frontend should be treated as a functional prototype and validation harness. Avoid heavy visual investment there unless it unblocks core flows. A future frontend rebuild can happen once the backend/API contracts are stronger.
- Add meal-idea -> structured recipe generation.
- Persist generated/imported AI recipe previews into the main recipe library after explicit confirmation.
- Add pre-cart ingredient review so users can override inventory per planning run.
- Keep improving Kroger matching quality with more ingredient query planning, synonym maps, and stronger produce/pantry heuristics.
- Wire Instacart credentials into the demo branch and validate real hosted shopping-list creation.
- Add GPS-assisted shopping-location setup and better Kroger store reuse.
- Evaluate open-source MCPs/tools for retailer search, nutrition lookup, cart export, pantry, and recipe import.
- Strengthen the weekly meal-planning and checkout-profile flows so they move beyond prototype UI state.
- recipe variants and AI-assisted adaptation are not implemented yet
- meal-idea recipe generation exists, but generated previews are not yet first-class saved recipes in the core workflow
- recipe import structuring exists, but imported previews are not yet persisted into the main recipe library flow
- kitchen inventory persistence exists, but the user-facing inventory flow is still an early prototype and the camera path is UI-only today
- pre-cart ingredient editing/removal is not implemented as a dedicated per-cart override flow yet
- external recipe import/forking from URLs, screenshots, menus, or creator content is not implemented yet
- the Walmart provider boundary exists, the first live matching path is Kroger, and the first external handoff path is Instacart
- delete flows exist, but recovery/versioning does not
- drafts and carts can now be edited, but there is still no broader history/timeline model for planning runs
- shopping-cart history exists in API and
/shopping, but revisit/history tools are still fairly light - store resolution is still manual-first; GPS capture and explicit saved-store management are not in UX yet
- the current web app is useful for validation, but it is not the intended final frontend
- AI recipe generation is integrated but still incomplete as a persisted product workflow; AI recipe editing, nutrition providers, richer cart export, and contextual cooking assistant flows are still design/runtime work
If you want the current truth of the system:
- Read docs/business.md for the startup thesis, target, and go-to-market.
- Read docs/goals.md for the product and engineering direction.
- Read docs/architecture.md for the layered system and the approved
CartvsShoppingCartsplit. - Read docs/decisions.md for the policy and API-shape decisions.
- Read docs/models.md for the conceptual model vocabulary.
- Read Swagger at
/docsfor the live implemented/api/v1contract.