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:
97
client/lib/shared/models/recipe.g.dart
Normal file
97
client/lib/shared/models/recipe.g.dart
Normal file
@@ -0,0 +1,97 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'recipe.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Recipe _$RecipeFromJson(Map<String, dynamic> json) => Recipe(
|
||||
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? ?? '',
|
||||
imageQuery: json['image_query'] 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>,
|
||||
),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RecipeToJson(Recipe instance) => <String, dynamic>{
|
||||
'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,
|
||||
'image_query': instance.imageQuery,
|
||||
'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(),
|
||||
};
|
||||
|
||||
RecipeIngredient _$RecipeIngredientFromJson(Map<String, dynamic> json) =>
|
||||
RecipeIngredient(
|
||||
name: json['name'] as String,
|
||||
amount: (json['amount'] as num).toDouble(),
|
||||
unit: json['unit'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RecipeIngredientToJson(RecipeIngredient instance) =>
|
||||
<String, dynamic>{
|
||||
'name': instance.name,
|
||||
'amount': instance.amount,
|
||||
'unit': instance.unit,
|
||||
};
|
||||
|
||||
RecipeStep _$RecipeStepFromJson(Map<String, dynamic> json) => RecipeStep(
|
||||
number: (json['number'] as num).toInt(),
|
||||
description: json['description'] as String,
|
||||
timerSeconds: (json['timer_seconds'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RecipeStepToJson(RecipeStep instance) =>
|
||||
<String, dynamic>{
|
||||
'number': instance.number,
|
||||
'description': instance.description,
|
||||
'timer_seconds': instance.timerSeconds,
|
||||
};
|
||||
|
||||
NutritionInfo _$NutritionInfoFromJson(Map<String, dynamic> json) =>
|
||||
NutritionInfo(
|
||||
calories: (json['calories'] as num).toDouble(),
|
||||
proteinG: (json['protein_g'] as num).toDouble(),
|
||||
fatG: (json['fat_g'] as num).toDouble(),
|
||||
carbsG: (json['carbs_g'] as num).toDouble(),
|
||||
approximate: json['approximate'] as bool? ?? true,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$NutritionInfoToJson(NutritionInfo instance) =>
|
||||
<String, dynamic>{
|
||||
'calories': instance.calories,
|
||||
'protein_g': instance.proteinG,
|
||||
'fat_g': instance.fatG,
|
||||
'carbs_g': instance.carbsG,
|
||||
'approximate': instance.approximate,
|
||||
};
|
||||
Reference in New Issue
Block a user