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:
dbastrikin
2026-02-21 22:43:29 +02:00
parent 24219b611e
commit e57ff8e06c
41 changed files with 5994 additions and 353 deletions

View File

@@ -0,0 +1,64 @@
import 'package:json_annotation/json_annotation.dart';
import 'recipe.dart';
part 'saved_recipe.g.dart';
@JsonSerializable(explicitToJson: true)
class SavedRecipe {
final String id;
final String title;
final String? description;
final String? cuisine;
final String? difficulty;
@JsonKey(name: 'prep_time_min')
final int? prepTimeMin;
@JsonKey(name: 'cook_time_min')
final int? cookTimeMin;
final int? servings;
@JsonKey(name: 'image_url')
final String? imageUrl;
@JsonKey(defaultValue: [])
final List<RecipeIngredient> ingredients;
@JsonKey(defaultValue: [])
final List<RecipeStep> steps;
@JsonKey(defaultValue: [])
final List<String> tags;
@JsonKey(name: 'nutrition_per_serving')
final NutritionInfo? nutrition;
final String source;
@JsonKey(name: 'saved_at')
final DateTime savedAt;
const SavedRecipe({
required this.id,
required this.title,
this.description,
this.cuisine,
this.difficulty,
this.prepTimeMin,
this.cookTimeMin,
this.servings,
this.imageUrl,
this.ingredients = const [],
this.steps = const [],
this.tags = const [],
this.nutrition,
required this.source,
required this.savedAt,
});
factory SavedRecipe.fromJson(Map<String, dynamic> json) =>
_$SavedRecipeFromJson(json);
Map<String, dynamic> toJson() => _$SavedRecipeToJson(this);
}