# Pérdida de Grasa Avanzada

- URL: https://danicalero.com/en/projects/perdida-de-grasa-avanzada
- markdown: https://danicalero.com/en/projects/perdida-de-grasa-avanzada.md
- Client: Aarón Fernández
- Year: 2026
- Services: Web development
- Technologies: Next.js, React, Payload CMS

A web app that turns body data into calorie and macro targets, then into real meals, weekly diet plans, a shopping list and a PDF.

A diet calculator that does the maths for you. A web app that turns body data into calorie and macro targets, then into real meals, weekly diet plans, a shopping list and a PDF.

All screenshots and videos show demo data: a seeded demo account with its own plan and example client calculators. The Pérdida de Grasa Avanzada (PDGA) brand is shown. Email sending is disabled in the demo recording. The numbers in the public calculator and in the app belong to different profiles on purpose.

## Context and problem

Aarón Fernández is a fitness influencer. He had already sold a fat-loss calculator that he built himself in Google Sheets. He wanted to go further: something interactive, online, easier to use and with a sense of community: a catalog of ingredients and dishes that grows with what the users themselves add. The product is sold as a one-time payment.

A spreadsheet makes people copy formulas and add up every quantity by hand. Here the person types their data, sees their target and builds the diet from real foods, with the maths always in view.

- Image: The calculator editor. Paso 1 shows sex, age, height, weight, body fat, four activity level cards and three goal buttons. Paso 2 shows the weekly loss field, three macro sliders, the basal metabolism and daily calories cards, and a macro table with grams, percentage and calories.

## My role

I designed, built and deployed the whole product, end to end: product and UI design, architecture, development and deployment. The client brought the problem and the reference of his spreadsheet. I turned them into screens, data and calculation rules.

## Solution overview

One calculator holds a whole plan on one page, in four steps: calculate calories, distribute macros, build diets from meals, and assign the diets to the days of up to four weeks. A shopping list and a PDF come out of the same data. The public site offers a free calorie calculator that leads to the paid product.

Stack: Next.js 16 and Payload CMS on PostgreSQL; React Email for the emails; the PDF is generated in the browser.

- Image: Paso 3 of the editor with three diet tabs and Día de descanso active. The Desayuno meal lists a dish with four ingredients and one loose ingredient, a search field, and a totals table with Total actual and difference badges.

## Key features

### 1. Calculate your targets and macros

Paso 1 asks for sex, age, height, weight and body fat %, works out the fat-free mass and offers four activity levels by daily steps and three goals: "Perder grasa", "Mantener" and "Ganar músculo". Paso 2 calculates the "Metabolismo basal" and the "Calorías totales diarias". Protein, fat and carbs are set with sliders in grams per kilo, and the macro table shows grams, percentage and calories for each. Changes save on their own.

The main video walks through these two steps, and the screenshot in "Context and problem" shows another, finished calculator.

### 2. Build diets from dishes and ingredients

A plan holds several diets, for example "Día de entreno", "Día de descanso" and "Fin de semana". Each diet has meals, and each meal mixes dishes (with their ingredients) and loose ingredients. Any quantity is edited in its own row, and the row, the meal and the day update. An ingredient can also be swapped for another, one can be added to a dish, and rows can be reordered or deleted.

One search covers ingredients and dishes and ignores accents: typing "platano" finds "Plátano mediano" and the dishes that use it. A dish arrives with all its ingredients.

- Image: The search field of the Comida meal with platano typed. A dropdown lists two dishes and one ingredient with their calories, and a pink Crear nuevo y añadir button.

The totals tables compare "Total diario pautado" with "Total actual" and mark the difference with colour badges. For calories: green up to 5 %, orange up to 15 %, red above. For macros: green up to 15 %, orange up to 25 %, red above.

- Image: The Comida meal of the Fin de semana diet. The totals table shows Total actual 2623 with an orange +251 badge, and protein, fat and carbs with green badges.

### 3. Create your own dish or ingredient

When the search finds nothing, "Crear nuevo y añadir" opens a form for a new dish or a new ingredient, and the result goes into the meal in the same step. In the video, the search "gachas" returns nothing and the dish "Gachas de avena con cacao" is created from rolled oats, unsweetened cocoa powder and one medium banana; the meal goes from 298 to 661 kcal.

An item a user creates is private to that user at first. When the admin reviews it and publishes it from the Payload panel, it joins the shared catalog and shows up in everyone's search. The catalog grows with the community's contributions and stays verified.

- Image: Screen recording of a meal. A search for gachas returns nothing. The Crear nuevo y añadir button opens a form where a dish is created with three ingredients. The dish appears in the meal and its calories rise.

The ingredient form asks for a name, a unit (gr, ml or uds), a default quantity and the four values per 100 gr. The product and nutrition label images are optional.

- Image: A modal titled Crear nuevo ingrediente over the editor. It has a name field, a unit choice of gr, ml and uds, a default quantity, four values per 100 gr, two image upload slots and the buttons Volver, Cancelar and Crear y añadir ingrediente.

### 4. From diets to weeks

Each day of the week gets a diet. The table shows, per day, calories and macros with their difference, and below it the week totals against the target. A calculator holds up to four weeks, each with its own pattern.

- Image: Screen recording of Paso 4. Diets are chosen for the days of a week in the table, and the daily values and the week totals below update.

- Image: Paso 4 with the tabs Semana 1 and Semana 2, the second active. A table lists the seven days with a diet select, calories, protein, fat and carbs with badges, and below it the rows En esta semana, Total semanal pautado and Total actual.

### 5. Shopping list and PDF

The shopping list comes from the plan, with nothing to type. It has three views: "Por dieta", "Por semana" and "Todo". Each ingredient appears once, in alphabetical order, with the quantity summed over all the days that use it.

- Image: Screen recording of the Lista de la compra section. The ingredient list built from the plan is shown, and its PDF opens in a viewer.

- Image: The Lista de la compra section with the tabs Por dieta, Por semana and Todo, the middle one active. A table lists the ingredients of Semana 1 in alphabetical order with a quantity each.

The "Descargar PDF" button exports the whole plan: a cover with the personal data, the notes, the targets and the weeks, and one page per diet with its meals. The PDF is generated in the browser from the same data as the editor.

- Image: Screen recording of the exported PDF in a viewer. The cover shows the calculator data and targets. The view scrolls to a diet page and zooms in on one meal card.

- Image: Two pages of the exported PDF side by side on a light background. The cover has the PDGA logo, notes, personal data, targets and the weekly diet tables. The second page is the Día de entreno diet with five meals and their ingredients.

### 6. Manage calculators

Each account keeps its calculators in a list. A person can keep their own, and a coach can use one calculator per client: duplicate one as a starting point, rename it and open it. In the demo, the list holds "Mi definición" and three example client calculators: "Laura · Recomposición", "Marcos · Volumen" and "Carmen · Definición". To delete a calculator, the confirmation asks for its typed name.

- Image: Screen recording of the calculators list. A client calculator is duplicated, the copy is renamed, and it is deleted after typing its name in the confirmation dialog.

## The marketing site

The public page is a free calorie calculator. After a short calculating sequence, a dialog asks for an email and for acceptance of the privacy policy. Then the basal metabolism, the daily calorie target and the macros appear, with the button to buy the product. A sales page, /clase, explains the class and the calculator and shows the fixed one-time price.

- Image: Screen recording of the public landing page. The calorie form is filled in, a calculating sequence runs, a dialog asks for an email, and the results card shows the basal metabolism, the daily calories and the macros.

- Image: The landing page dimmed behind a dialog titled ¿A dónde te mando las calorías? It lists what the email contains, has an email field filled in, a ticked privacy policy checkbox and a VER MIS CALORÍAS button.

- Image: The results card of the public calculator on a pink background. It shows basal metabolism and daily calorie target cards, three daily macro cards, a short pitch with three points, a buy button and a Volver a calcular button.

- Image: The top of the /clase sales page. A headline and four paragraphs sit above a pink card with the text 59€ pago unico, acceso vitalicio and a COMPRAR POR 59€ button.

The emails are React Email templates: the welcome email after purchase and the calculator results email, with a five-step mini guide.

- Image: Two emails side by side on a light background. The welcome email has an illustration, a short message and a Completar mi registro button. The results email shows calorie and macro cards, a five-step mini guide and a buy button.

## Responsive

The landing and the editor adapt to phone screens: the public form and the editor, with the header actions rearranged, fit in 390 px of width.

- Image: Two phone-sized screens side by side. The left one is the public calculator form with the fields filled in. The right one is the top of a calculator editor with the header actions wrapped under the title and the Paso 1 form.

## Outcome

I delivered a complete product: a calculator editor with four steps, food search, creation of your own dishes and ingredients, diet weeks, a shopping list and PDF export; a list to manage several calculators; a free public calculator; a sales page with a one-time payment; and the email templates for the purchase and results flows.

- HTML version: [https://danicalero.com/en/projects/perdida-de-grasa-avanzada](https://danicalero.com/en/projects/perdida-de-grasa-avanzada)
- Site index: [llms.txt](https://danicalero.com/en/llms.txt)
