← All projects

Applied AI & full-stack development

PantryLens, from a kitchen photo to a recipe I can make

An installable cooking app that turns a kitchen photo or a typed pantry list into a recipe with quantities scaled to the portions you need.

Why I built PantryLens

I like cooking, and when I wanted to make the same dish again, I often had two questions. What ingredients went into it, and how much of each did I need for the number of people I was cooking for? I built PantryLens to turn those questions into a recipe I could take into the kitchen.

The app starts with what I have on hand. I can take a photo or type an ingredient list, check what made it into the pantry, and set a time limit and serving count before asking for a recipe.

The homepage offers a skillet recipe to try and a way to start with your own pantry.

Review the pantry before generating a recipe

A photo stays in a local preview until I select Identify ingredients. The vision model returns a list I can edit. Typing ingredients opens the same review, where I can fix names, add preparation details, and choose which staples I have.

Strict pantry mode keeps the recipe within the confirmed list. Allow extras lets me set how many additional ingredients the recipe can call for. When the recipe cannot fit my constraints, the app explains what I could change.

Photo upload and manual entry lead to the same editable pantry.

Scale quantities from the original recipe

With the chickpea and tomato skillet, I can change the serving count and see the new quantities before I start measuring. Every change is calculated from the saved recipe amounts, so going back to the original serving count avoids rounding drift. Timing and equipment stay tied to the recipe instructions.

Serving controls sit above the quantities in the mobile recipe view.

Carry the missing ingredients to the shop

The shopping list combines ingredients across selected recipes when their units are compatible. I can also add something by hand. If I change the servings and a checked quantity changes, the app reopens that item so I can check the new total.

The shopping list combines recipe extras and keeps manually added items separate.

Keep saved recipes available offline

IndexedDB stores recipes, favourites, shopping lists, and settings on the device, with export and import for backups. A service worker caches the app shell after an online visit, so I can reopen a saved recipe or shopping list and adjust portions offline. Photo analysis and recipe generation require a connection.

The mobile homepage puts recipe creation and the sample within reach.

Validate what the models return

SvelteKit serves the cooking interface and the inference endpoints. Google, OpenAI, and Anthropic share a server interface, with separate model choices for ingredient recognition and recipe generation. The vision provider receives the processed photo. The recipe provider receives the confirmed ingredients and cooking constraints.

Zod checks the shape of each response, and application rules check ingredient references, preparation details, time limits, and extras. SQLite tracks request metadata and quotas. Signed sessions enforce request limits, and idempotency keys stop repeat submissions from triggering a second provider call within the retention window.

What I verified

The local build passed 39 deterministic tests and 10 Chromium tests. Browser coverage included pantry editing, offline recipe links, shopping quantities, backup restoration, keyboard navigation, and the PWA manifest. Provider contracts were tested with mocked HTTP responses. Live provider checks and installation on a production HTTPS host are pending.

PantryLens extends Kartik Tiwari’s MIT-licensed Image-to-Recipe prototype.

Technology

SvelteKit · TypeScript · AI SDK · Zod · IndexedDB · SQLite