Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/EstefanoARG/FridgeRadar/llms.txt

Use this file to discover all available pages before exploring further.

FridgeRadar’s recipe system does more than store cooking instructions — it actively helps you reduce food waste. The Tengo Hambre (“I’m hungry”) engine scans your household’s pantry, identifies ingredients that are close to expiry, and ranks every public recipe by how many of those ingredients you already have on hand. The result is a personalised suggestion list that prioritises meals you can cook right now using items that would otherwise go bad.

The Recipe Data Model

Recipes are created with RecetaCreate and returned as RecetaDetalleResponse, which extends the base response with full tag and ingredient lists.

Core Fields (RecetaCreate)

FieldTypeDescription
nombrestrRecipe name
descripcionstr | nullShort summary of the dish
instruccionesstr | nullStep-by-step cooking instructions
tiempo_preparacionint | nullPreparation time in minutes
dificultadstr"facil", "media", or "dificil"
porcionesint | nullNumber of servings
imagenstr | nullURL to a cover image
caloriasint | nullCalories per serving
es_publicaboolWhether the recipe is visible to all users (default true)
tagslist[int]List of tag IDs to attach
ingredienteslist[RecetaIngredienteCreate]List of required ingredients

Ingredient Entry (RecetaIngredienteCreate)

FieldTypeDescription
id_productointProduct catalogue reference
cantidadfloat | nullHow much is needed
unidad_medidastrUnit (default "unidad")
obligatorioboolWhether this ingredient is mandatory (default true)
notastr | nullPreparation note (e.g. “diced finely”)

Creating a Recipe

POST /api/v1/recetas/
Authorization: Bearer <token>
Content-Type: application/json

{
  "nombre": "Tortilla de papas",
  "descripcion": "Clásica tortilla española con papas y cebolla.",
  "instrucciones": "1. Pelar y cortar papas...",
  "tiempo_preparacion": 30,
  "dificultad": "media",
  "porciones": 4,
  "calorias": 320,
  "es_publica": true,
  "tags": [2, 5],
  "ingredientes": [
    { "id_producto": 10, "cantidad": 3, "unidad_medida": "unidad", "obligatorio": true },
    { "id_producto": 22, "cantidad": 1, "unidad_medida": "unidad", "obligatorio": false, "nota": "opcional" }
  ]
}

Detail Response (RecetaDetalleResponse)

RecetaDetalleResponse extends the base RecetaResponse with two populated lists:
{
  "id_receta": 14,
  "id_usuario_creador": 3,
  "nombre": "Tortilla de papas",
  "descripcion": "Clásica tortilla española con papas y cebolla.",
  "tiempo_preparacion": 30,
  "dificultad": "media",
  "porciones": 4,
  "calorias": 320,
  "es_publica": true,
  "fecha_creacion": "2024-10-05T09:00:00",
  "tags": [
    { "id_tag": 2, "nombre": "Vegetariano", "color": "#4CAF50" }
  ],
  "ingredientes": [
    {
      "id_receta_ingrediente": 31,
      "id_receta": 14,
      "id_producto": 10,
      "cantidad": 3.0,
      "unidad_medida": "unidad",
      "obligatorio": true,
      "nota": null
    }
  ]
}

Recipe Tags

Tags are lightweight labels (id_tag, nombre, color) used to categorise recipes. Create and list tags through dedicated endpoints.
MethodPathDescription
POST/api/v1/recetas/tagsCreate a new tag
GET/api/v1/recetas/tagsList all available tags
POST /api/v1/recetas/tags
Authorization: Bearer <token>
Content-Type: application/json

{
  "nombre": "Sin gluten",
  "color": "#FF9800"
}
{
  "id_tag": 7,
  "nombre": "Sin gluten",
  "color": "#FF9800"
}

Recipe Favourites

Users can bookmark any recipe as a personal favourite. Favourites are per-user, not per-household.
MethodPathDescription
POST/api/v1/recetas/{id_receta}/favoritoAdd a recipe to your favourites
DELETE/api/v1/recetas/{id_receta}/favoritoRemove a recipe from your favourites
GET/api/v1/recetas/favoritos/miosList all your favourited recipes

The Tengo Hambre Engine

Calling GET /api/v1/tengo-hambre/{id_hogar} runs the suggestion engine for the specified household. The engine:
1

Loads all public recipes

Fetches every recipe where es_publica = true, along with its full ingredient list.
2

Reads the household inventory

Loads all inventory items for id_hogar and groups them by id_producto.
3

Filters by freshness (solo_criticos)

When solo_criticos = true (the default), only ingredients whose pantry items are in "amarillo" or "rojo" state are counted as available. When false, any stocked ingredient counts.
4

Calculates porcentaje_match

For each recipe: porcentaje_match = (ingredients_found / total_ingredients) × 100, floored to two decimal places. Only recipes with ≥ 70 % match are included.
5

Sorts and trims the list

Results are sorted so recipes that use critical (usa_criticos = true) items appear first, then by porcentaje_match descending. The list is trimmed to limite results.
6

Persists suggestions

The suggestions are saved to the SugerenciaReceta table for the user/household pair (replacing any previous run) before being returned.

Query Parameters

ParameterTypeDefaultDescription
solo_criticosbooltrueOnly match ingredients in amarillo or rojo state
limiteint10Maximum number of suggestions to return

Example Request

GET /api/v1/tengo-hambre/1?solo_criticos=true&limite=5
Authorization: Bearer <token>

Suggestion Response (SugerenciaResponse)

FieldTypeDescription
id_recetaintRecipe identifier
nombrestrRecipe name
descripcionstr | nullShort description
tiempo_preparacionint | nullPrep time in minutes
dificultadstrDifficulty level
porcionesint | nullNumber of servings
imagenstr | nullCover image URL
caloriasint | nullCalories per serving
porcentaje_matchfloatPercentage of recipe ingredients found in pantry
usa_criticosbooltrue if at least one matched ingredient is in amarillo/rojo
[
  {
    "id_receta": 14,
    "nombre": "Tortilla de papas",
    "descripcion": "Clásica tortilla española con papas y cebolla.",
    "tiempo_preparacion": 30,
    "dificultad": "media",
    "porciones": 4,
    "imagen": null,
    "calorias": 320,
    "porcentaje_match": 100.0,
    "usa_criticos": true
  }
]
A recipe only appears in Tengo Hambre results if at least 70 % of its ingredients are present in the pantry (under the active solo_criticos filter). Recipes with fewer matching ingredients are silently excluded to keep suggestions actionable.
Run Tengo Hambre with solo_criticos=false to see every recipe you could cook from your full pantry, not just ones that use items about to expire.

API Overview

MethodPathDescription
POST/api/v1/recetas/Create a recipe
GET/api/v1/recetas/List all public recipes
GET/api/v1/recetas/{id_receta}Get recipe details
PATCH/api/v1/recetas/{id_receta}Update a recipe
DELETE/api/v1/recetas/{id_receta}Delete a recipe
POST/api/v1/recetas/tagsCreate a tag
GET/api/v1/recetas/tagsList all tags
POST/api/v1/recetas/{id_receta}/favoritoFavourite a recipe
DELETE/api/v1/recetas/{id_receta}/favoritoUnfavourite a recipe
GET/api/v1/recetas/favoritos/miosList your favourites
GET/api/v1/tengo-hambre/{id_hogar}Get personalised recipe suggestions

Build docs developers (and LLMs) love