Taste Advisor: AI-Powered Recipe Finder
A small web app that takes a list of ingredients and asks Google Gemini for three usable recipes, with a bilingual UI for English and Turkish.

Taste Advisor answers a single question: "What can I cook with what I already have?" You type the ingredients on hand, the app sends them to Google Gemini, and three recipe suggestions come back. No login, no recipe database to scroll, no premium tier. It is a deliberately small app: one React page, a translation table, a language switcher, and one serverless function that holds the API key.
How a request works:
- You type ingredients, not a prompt. The browser posts them, with the interface language, as JSON to /api/recipes
- That path is a Netlify Function. It builds the instruction itself, one per language: these are my ingredients, suggest three recipes that use them, write a short recipe for each, and answer in English or in Turkish. Because the prompt is assembled on the server from two validated fields, the endpoint cannot be used as a general proxy for arbitrary Gemini requests
- The function calls Gemini's REST API with the key read from a server-side environment variable and sent as a request header, so it never reaches the browser bundle. The model is gemini-2.5-flash unless the environment names another
- The answer is shown as plain text with its line breaks preserved. It is not parsed into recipe objects, so the layout of each recipe is whatever the model returns
What the function checks:
- POST only, a JSON content type, and a body of at most 1 KB, checked against both the declared length and the bytes actually received
- The ingredients must be a string. Whitespace is collapsed, and the result must be non-empty, at most 200 characters, and made of letters, digits, spaces and common punctuation. The language must be en or tr
- Gemini gets 20 seconds before the function answers with a timeout. A rate limit from Gemini is passed on as a 429, and any other upstream failure becomes a 502, with the detail kept in the server log
- The function's config declares a limit of ten requests a minute per IP, which Netlify applies before the function runs
In the browser, an empty field is ignored, the input stops at 200 characters, the button is disabled while a request is in flight, and any failure shows a translated error message in place of the result.
Two languages: The interface ships in Turkish and English, with Turkish as the default and a TR / EN switch in the corner. The choice is saved in localStorage. The language switches every label through a translation table typed so that a missing key is a type error, and it decides which version of the instruction the function sends.
History:
- The last five searches are kept in localStorage, newest first, each with the ingredients, the full answer, the time and the language
- Reopening an entry restores the stored answer without a new API call and switches the interface to that entry's language, so you see the same recipes as the first time
- Entries can be removed one at a time, and times are formatted for the active locale
The interface: A translucent card with a backdrop blur over a skewed gradient panel, Framer Motion for the entrance, the result card and a staggered history list, mobile-first Tailwind classes, and Lucide icons.
Stack:
- React 18 with TypeScript, built with Vite
- Tailwind CSS, Framer Motion and Lucide React
- A Netlify Function in plain JavaScript in front of the Gemini API, run locally through Netlify Dev next to Vite
- ESLint, PostCSS and Autoprefixer in the toolchain
Limits: The instruction is a single sentence. It does not ask for a fixed structure, quantities or timings, and it does not tell the model to avoid ingredients you did not list, so those properties depend on the model rather than on the app.

