Recipe management endpoints live underDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanSebasSV/healtyhelp/llms.txt
Use this file to discover all available pages before exploring further.
/api/recipes/. Public routes (GET / and GET /:id) are unauthenticated. All write routes require a valid JWT with role: "admin".
Valid Categories
Thecat field accepts exactly one of:
| Value | Label |
|---|---|
desayuno | Breakfast |
almuerzo | Lunch |
cena | Dinner |
postres-snacks | Desserts & Snacks |
Valid Health Tags (salud)
The salud field is a free-form string array, but the UI exposes these 18 standard values:
diabetes, hipertension, celiaco, intolerancia-lactosa, vegano, vegetariano, bajo-sodio, bajo-carbohidratos, keto, paleo, sin-frutos-secos, sin-mariscos, bajo-grasa, sin-azucar, colesterol-alto, enfermedad-renal, gastritis, sindrome-intestino
Create a Recipe
nombre, desc, catOptional fields:
img, salud, ingredientes, pasos, nutri
The server strips resenas, puntosProm, and totalResenas from the request body before saving. After creation, all users receive a new-recipe notification via crearNotifNuevaReceta.
Complete request body example
Update a Recipe
resenas, puntosProm, and totalResenas are stripped server-side. The update runs with runValidators: true.
Delete a Single Recipe
Notification documents that reference it (recetaId).
Bulk Delete Recipes
Bulk Import Recipes
Upload a JSON array of recipe objects. The import validates that every object hasnombre, desc, and cat before inserting any records.
mode value | Behaviour |
|---|---|
"add" (default) | Inserts new recipes alongside existing ones |
"replace" | Deletes all existing recipes first, then inserts the new batch |
Import JSON format
RecipeImport component (client/src/components/admin/RecipeImport.jsx) provides a drag-and-drop dropzone for .json files, a review step with inline editing, automatic local draft saving (via localStorage), and two import modes selectable via radio buttons.
Export All Recipes
Downloads all recipes as a JSON array, excluding review sub-documents (resenas).
RecipeManagement component triggers a browser download of the response as recetas_YYYY-MM-DD.json.
Recipe Stats
Full Nutritional Schema
All fields default to0 and can be omitted. The nutri object is stored as a sub-document (nutriSchema) with the following fields:
Macros & basics
| Field | Unit | Description |
|---|---|---|
cal | kcal | Total calories |
prot | g | Protein |
carb | g | Total carbohydrates |
carbNetos | g | Net carbohydrates |
gras | g | Total fat |
fiber | g | Dietary fibre |
sodio | mg | Sodium |
colesterol | mg | Cholesterol |
Minerals
calcio, hierro, potasio, magnesio, cobre, fluor, fosforo, manganeso, selenio, zinc
Vitamins
vitA (µg), vitAui (IU), vitB6 (mg), vitB12 (µg), vitC (mg), vitD (µg), vitD2 (µg), vitD3 (µg), vitDui (IU), vitE (mg), vitK (µg), folato (µg), niacina (mg), riboflavina (mg), tiamina (mg), acidoPant (mg)
Carotenoids & compounds
alfaCaroteno (µg), betaCaroteno (µg), licopeno (µg), retinol (µg), colina (mg), cafeina (mg), teobromina (mg)
Sugars
azucar, sacarosa, glucosa, fructosa, lactosa, maltosa, galactosa, almidon — all in grams.
Detailed fats
grasSat, grasMonoins, grasPoliins, grasTrans — all in grams.
Fatty acids
omega3, omega6, ala, dha, epa, dpa — all in grams.
Amino acids
alanina, arginina, acidoAsp, cistina, acidoGlu, glicina, histidina, hidroxiprol, isoleucina, leucina, lisina, metionina, fenilalanina, prolina, serina, treonina, triptofano, tirosina, valina — all in grams.