You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wger's nutrition module allows tracking meals and nutritional plans, but doesn't support filtering by dietary preference. Users following plant-based diets cannot easily:
Filter the ingredient database by dietary suitability
Identify which nutritional plans are plant-based compatible
Find plant-based alternatives when building meal plans
Proposed Solution
Dietary flags on ingredients — mark ingredients as vegan, vegetarian, or containing specific allergens. Many ingredient databases (e.g., Open Food Facts) already include this metadata and could be used to bulk-populate flags.
Nutritional plan dietary filter — when creating/browsing nutritional plans, filter by dietary preference
Plant-based alternative suggestions — when viewing an ingredient, suggest plant-based alternatives with similar nutritional profiles
Context
Plant-based diets are one of the fastest-growing dietary trends globally. Fitness tracking apps that support dietary preferences (Cronometer, MyFitnessPal) see high engagement from this demographic. Adding this to wger would serve an underserved user group in the open-source fitness tracking space.
Implementation Notes
The simplest approach would be a dietary category tag on the Ingredient model, with bulk population from Open Food Facts API data. The filtering can then be added to existing API endpoints and UI components.
this is a good idea. I also think adding two flags to the ingredient model is a good solution, the only "difficulty" is the Open Food Facts import, their data model can be sometimes a bit weird with their tag system. The filtering etc can happen later
Thanks @rolandgeider — appreciate the endorsement on the approach. The PR is up at #2218 with the two nullable boolean fields on the Ingredient model, extraction from OFF's ingredients_analysis_tags, API filtering, and test coverage.
You mentioned OFF's data model can be a bit weird with their tag system — the PR currently handles their known tag variants (en:vegan, en:non-vegan, en:maybe-vegan, en:vegan-status-unknown, and the vegetarian equivalents), mapping uncertain states to NULL. Is there anything specific about the OFF import behavior you've seen that you'd want addressed in this PR, or would you prefer to handle edge cases as a follow-up?
Activity
rolandgeider commentedon Feb 25, 2026
hey!
this is a good idea. I also think adding two flags to the ingredient model is a good solution, the only "difficulty" is the Open Food Facts import, their data model can be sometimes a bit weird with their tag system. The filtering etc can happen later
rolandgeider commentedon Feb 25, 2026
oh you had already submitted a pr
samtuckerdavis commentedon Feb 25, 2026
Thanks @rolandgeider — appreciate the endorsement on the approach. The PR is up at #2218 with the two nullable boolean fields on the Ingredient model, extraction from OFF's
ingredients_analysis_tags, API filtering, and test coverage.You mentioned OFF's data model can be a bit weird with their tag system — the PR currently handles their known tag variants (
en:vegan,en:non-vegan,en:maybe-vegan,en:vegan-status-unknown, and the vegetarian equivalents), mapping uncertain states to NULL. Is there anything specific about the OFF import behavior you've seen that you'd want addressed in this PR, or would you prefer to handle edge cases as a follow-up?