Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
A smart ingredient-based recipe finder that helps you figure out what to cook based on what's already in your kitchen — reducing food waste and saving money.
- Add your ingredients to the Pantry tab (with optional quantity & expiry date)
- Find Recipes — see recipes ranked by match % based on your pantry
- Browse & add recipes in the Recipe Book tab
- 🥫 Pantry tracker — Add/remove ingredients with expiry date tracking
- 🍳 Recipe matching — Set intersection algorithm ranks recipes by how many ingredients you already have
- 📖 Recipe book — Pre-seeded with 12 common recipes; add your own
- ⏰ Expiry alerts — Visual badges for items expiring soon (yellow/orange/red)
- 🔌 REST API — Full CRUD endpoints for pantry & recipes
Rendering mermaid diagram...
index.ts ← Hono server (serves frontend + REST API)
db.ts ← Database schema + seed data
frontend/
index.html ← HTML shell (Twind + React)
index.tsx ← React entrypoint
components/
App.tsx ← Root layout with tab navigation
Pantry.tsx ← Pantry management (add/remove ingredients)
Match.tsx ← Recipe matching results view
AddRecipe.tsx ← Recipe book (browse/add/delete recipes)
| Method | Path | Description |
|---|---|---|
GET | /api/pantry | List all pantry items |
POST | /api/pantry | Add a pantry item {ingredient, quantity, expiry_date} |
DELETE | /api/pantry/:id | Remove a pantry item |
GET | /api/recipes | List all recipes |
POST | /api/recipes | Add a recipe {name, ingredients, instructions, difficulty} |
DELETE | /api/recipes/:id | Delete a recipe |
GET | /api/match | Get all recipes ranked by pantry match % |
match_score = (matched_ingredients / total_recipe_ingredients) × 100
Ingredients are matched using set intersection with fuzzy partial matching (e.g., "tomato" matches "tomatoes"). Results are sorted by match score descending.