I Built My Friend an AI-Powered Allergy-Safe Meal Planner 🍳🤖
Описание и применение
Приложение генерирует безопасные для аллергиков блюда, принимая список аллергенов и доступные ингредиенты, используя Gemini для генерации рецептов, хранит историю в MongoDB Atlas и обрабатывает ошибки API с повторными попытками.
Задача
Meal planning becomes frustrating when you have food allergies, requiring manual checks of ingredients, pantry items, and safety.
Результат
The project delivers a user-friendly allergy-safe meal planner that generates structured meal ideas, handles AI failures with retries, and stores history for future reference.
Рабочий процесс
- 1. User enters allergies and pantry items in the web form.
- 2. Frontend sends data to /api/spin endpoint.
- 3. Backend constructs a request to Gemini, including a system prompt and user context.
- 4. Gemini returns JSON with three meal ideas.
- 5. Backend parses and forwards the JSON to the frontend.
- 6. Frontend displays meal name, ingredients, instructions, and safety info.
- 7. Backend stores the request, response, model used, and timestamp in MongoDB Atlas.
- 8. If the AI service returns 429, 500, 503, or times out, the backend retries with exponential backoff.
Доказательства
Meal planning can become frustrating when you have food allergies.
The application lets a user enter: Allergies or ingredients they need to avoid; Ingredients currently available in their kitchen.
The deployed version currently uses Gemini 3.8 Flash for meal generation.
MongoDB Atlas is used to persist meal history.
I added retry handling for temporary failures. The backend specifically handles: 429, 500, 503, Request timeouts.
- Дата записи: 2026-10-04T19:55:48.038Z