feat: implement Iteration 1 — AI recipe recommendations
Backend:
- Add Groq LLM client (llama-3.3-70b) for recipe generation with JSON
retry strategy (retries only on parse errors, not API errors)
- Add Pexels client for parallel photo search per recipe
- Add saved_recipes table (migration 004) with JSONB fields
- Add GET /recommendations endpoint (profile-aware prompt building)
- Add POST/GET/GET{id}/DELETE /saved-recipes CRUD endpoints
- Wire gemini, pexels, recommendation, savedrecipe packages in main.go
Flutter:
- Add Recipe, SavedRecipe models with json_serializable
- Add RecipeService (getRecommendations, getSavedRecipes, save, delete)
- Add RecommendationsNotifier and SavedRecipesNotifier (Riverpod)
- Add RecommendationsScreen with skeleton loading and refresh FAB
- Add RecipeDetailScreen (SliverAppBar, nutrition tooltip, steps with timer)
- Add SavedRecipesScreen with Dismissible swipe-to-delete and empty state
- Update RecipesScreen to TabBar (Recommendations / Saved)
- Add /recipe-detail route outside ShellRoute (no bottom nav)
- Extend ApiClient with getList() and deleteVoid()
Project:
- Add CLAUDE.md with English-only rule for comments and commit messages
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
57
client/lib/shared/models/saved_recipe.g.dart
Normal file
57
client/lib/shared/models/saved_recipe.g.dart
Normal file
@@ -0,0 +1,57 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'saved_recipe.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
SavedRecipe _$SavedRecipeFromJson(Map<String, dynamic> json) => SavedRecipe(
|
||||
id: json['id'] as String,
|
||||
title: json['title'] as String,
|
||||
description: json['description'] as String?,
|
||||
cuisine: json['cuisine'] as String?,
|
||||
difficulty: json['difficulty'] as String?,
|
||||
prepTimeMin: (json['prep_time_min'] as num?)?.toInt(),
|
||||
cookTimeMin: (json['cook_time_min'] as num?)?.toInt(),
|
||||
servings: (json['servings'] as num?)?.toInt(),
|
||||
imageUrl: json['image_url'] as String?,
|
||||
ingredients:
|
||||
(json['ingredients'] as List<dynamic>?)
|
||||
?.map((e) => RecipeIngredient.fromJson(e as Map<String, dynamic>))
|
||||
.toList() ??
|
||||
[],
|
||||
steps:
|
||||
(json['steps'] as List<dynamic>?)
|
||||
?.map((e) => RecipeStep.fromJson(e as Map<String, dynamic>))
|
||||
.toList() ??
|
||||
[],
|
||||
tags:
|
||||
(json['tags'] as List<dynamic>?)?.map((e) => e as String).toList() ?? [],
|
||||
nutrition: json['nutrition_per_serving'] == null
|
||||
? null
|
||||
: NutritionInfo.fromJson(
|
||||
json['nutrition_per_serving'] as Map<String, dynamic>,
|
||||
),
|
||||
source: json['source'] as String,
|
||||
savedAt: DateTime.parse(json['saved_at'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$SavedRecipeToJson(SavedRecipe instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'title': instance.title,
|
||||
'description': instance.description,
|
||||
'cuisine': instance.cuisine,
|
||||
'difficulty': instance.difficulty,
|
||||
'prep_time_min': instance.prepTimeMin,
|
||||
'cook_time_min': instance.cookTimeMin,
|
||||
'servings': instance.servings,
|
||||
'image_url': instance.imageUrl,
|
||||
'ingredients': instance.ingredients.map((e) => e.toJson()).toList(),
|
||||
'steps': instance.steps.map((e) => e.toJson()).toList(),
|
||||
'tags': instance.tags,
|
||||
'nutrition_per_serving': instance.nutrition?.toJson(),
|
||||
'source': instance.source,
|
||||
'saved_at': instance.savedAt.toIso8601String(),
|
||||
};
|
||||
Reference in New Issue
Block a user