❯ AI · Mobile · 2023
Pantry-Pilot
A mobile-first virtual home kitchen that unifies pantry inventory, meal planning, and recipes, with AI pantry-coverage analysis to cut food waste.
The problem
Food waste starts with not knowing what is in the kitchen. Most apps track pantry inventory, or meal plans, or recipes, but nothing connects a recipe to the ingredients you actually have. Pantry-Pilot unifies the three and adds the missing link: telling you what to cook from what is already there.
The approach
The app is Flutter with BLoC, dio, and go_router, targeting Android, iOS, web, and desktop from one codebase, with AWS Amplify and Cognito auth, local notifications, an audio alarm, and vibration for cooking timers. The backend is FastAPI with SQLModel and Alembic, packaged as a Docker image and deployed as an AWS Lambda behind API Gateway. OpenAI translates recipe ingredients into structured JSON, which powers two analyses: pantry-coverage (how well you can cook this recipe today) and shopping-gap (exactly what a recipe needs that you do not have). Rule-based validation sits between the model and the app, so malformed AI payloads are rejected instead of rendered.
Architecture
- Flutter App
- Cognito PKCE
- FastAPI Lambda
- OpenAI Ingredient Parser
- Aurora PostgreSQL
- Lambda db_migrator
FLOWS
- Flutter AppOAuth PKCECognito PKCE
- Flutter Appinventory + recipesFastAPI Lambda
- FastAPI Lambdaingredient textOpenAI Ingredient Parser
- OpenAI Ingredient Parserstructured JSONFastAPI Lambda
- FastAPI LambdapersistAurora PostgreSQL
- Lambda db_migratorAlembic migrationsAurora PostgreSQL
All infrastructure is Terraform: Aurora PostgreSQL Serverless v2, encrypted
with auto-pause so a home-use product costs almost nothing idle; a Cognito user
pool with PKCE OAuth; Secrets Manager; an ECR lifecycle policy; and a Lambda
db_migrator that runs Alembic migrations at deploy time, so schema and code
ship together. Recipes use a hybrid ownership model: a global catalog,
account-scoped favorites, and user recipes gated to a paid tier. Expiry-aware
inventory is part of the design: use-soon surfacing, low-stock flags, and
leftover tracking, plus guided cooking with per-step timers and substitution
hints.
Key decisions
Rule-based guard on AI output
The model is the ingredient parser, not the source of truth. A JSON schema check plus validation rules keep malformed payloads out of the database.
Serverless database for a consumer product
Auto-pause means a side project has no fixed monthly cost; the tradeoff is a cold start on the first query of the day.
Migrations at deploy time
Running Alembic from a Lambda keeps schema drift out of the picture; every deploy applies exactly the migrations it expects.
Recipe tiers as product, not access control
The paid tier is user recipes, which is a feature people understand and value.
What I'd do differently
The cross-target decision was right for reach but added real time to every notification and timer feature, which behave differently on four platforms. I would ship Android and iOS first and treat web and desktop as a second pass. I would also add a manual stock-adjustment flow before the AI analysis; the analysis is only as good as the inventory it reads.