davidhealey / waistline

Libre calorie counter app for Android. Built with Cordova.
560 stars 66 forks source link

A way to add generic foods (like a fruit or an egg) without personal API key for USDA database #799

Open prototyperspective opened 6 months ago

prototyperspective commented 6 months ago

I think currently the biggest shortcoming of the app is that is doesn't support generic foods. This probably puts most users off before they learned the basics of the still-too-unknown app. Prior issues about this: #222 #86 #154

The current way this has been addressed requires the user to somehow learn that and how it's possible and to create and enter a personal API key for the USDA food database. This is not a solution for the following reasons:

Please add a way to add generic foods without a personal API key for the FoodData Central database by the US Departments of Agriculture. These are the potential solutions I have thought of so far (maybe there are more):

davidhealey commented 6 months ago
  • import their data into any a database of yours

There is too much data and most of it isn't relevant to most people.

  • import their data into Open Food Facts

OFF only supports products with barcodes, which is why there isn't a lot of generic products in there already.

use another database that doesn't require a personal API key

This would be good. If you know of one then please let us know.

  • import their data into Wikidata

Interesting idea. I'm not familiar with Wikidata, if someone imports the data and tells us how to access it via an API then I don't see an issue with that. For generic food items the data is unlikely to change so it would require minimal maintenance.

Personally I haven't had any issues just using OFF. If I buy a potato it's usually in a bag of potatoes with nutritional info and a barcode. Same with flour, bread, milk, sugar, eggs, etc. Occasionally I'll buy loose fruit/vegetables, but right next to it in the shop there are some packaged with a barcode, so I can scan those.

prototyperspective commented 6 months ago

There is too much data and most of it isn't relevant to most people.

One could somehow filter for such generic foods

OFF only supports products with barcodes

Thanks for clarifying, I didn't know that! I will probably try to find out if it has ever been proposed to also feature items without barcodes and/or generic foods

I have request such a large-scale bulk import which may require a few more data properties to be created and will come back to this if somebody does this; I've only added a few items manually and am not familiar with bulk imports which should probably be done by somebody experienced. Data access methods are described here.

Occasionally I'll buy loose fruit/vegetables

I only scan it at home but scanning the barcode of loose items in the shop is workaround that I think would be good to mention in the FAQ for example. I think many users already have their generic items for particular foods, the main problem for the adhoc solution to make things a lot easier for most cases would be making these available to others too without requiring workarounds like scanning packages next to loose items in shops. Generic items from online shops even when they have barcodes like various powders such as pea protein are usually not in OFF either. It's easier to simply enter the name of the commons generic food than having to always scan the barcodes even when there is no notable difference between them and often false/missing data for the item.

voronaam commented 2 months ago

I am just starting with the app and this is the issue for me. I think this can be improved in the Search UI by a few tweaks:

EmilJunker commented 2 months ago

@voronaam These are all very good ideas. The only problem is that I can't think of a good/easy way to implement any of them. It's not as easy as it sounds.

Regarding the search sources, it might be helpful for you to know that currently the first (up to) 15 search results are always from USDA, and all results after that are from OFF.

voronaam commented 2 months ago

the first (up to) 15 search results are always from USDA

Thank you, I did not know that! This will help

prototyperspective commented 2 months ago

I think for this app to be competitive to other calorie trackers / appealing to many users this problem needs to be addressed to some extent in some way even if that way is quite suboptimal...what about for now just manually configuring generic items for particular searches that are shown at the top? Nice to see voronaam is engaging with this problem.

One could mark some generic apple as a reference apple and show it at the top when just "apple" is entered (translations can be gathered from some wordbook if they aren't already known to the app) which is better than requiring users to hassle around with developer API keys which even if they could not even close to 1% of users will ever configure or to require them to scroll around pages of "Brandname Crispy Apple pie pudding" for a term as common and generic as that just to use an item for generic apple that actually is a badly named apple juice item. Scanning things in the store is also not a feasible/useful temporary solution, for example because most people scan at home or enter things into the app at home.

davidhealey commented 2 months ago

I think for this app to be competitive to other calorie trackers

This is not a goal of Waistline.

prototyperspective commented 2 months ago

You don't want this app to be used and you and other developers' time spent on it to be meaningful? I don't understand but that's not about the things and may be a bit offtopic to discuss this.

davidhealey commented 2 months ago

You don't want this app to be used and you and other developers' time spent on it to be meaningful?

I made this app for my own use, I didn't expect anyone else to use it, but I'm pleased people are.

prototyperspective commented 2 months ago

This is going offtopic in this issue. That's a lot of time and effort for only something that you made for your personal use. If that was the original motivation and intend, by now it is the most advanced open source food tracking app.

Moreover, EmilJunker has contributed much as well by now (and some others), there's some level of responsibility when a software is the most advanced open source one (better for people to improve it rather than develop the whole thing yet another time), and most importantly (this is not about responsibility – you don't need to develop this yourself, I'm just pointing out the importance of this issue which other people could look at as well) it's just common sense to make things one has spent a lot of time and effort for to be more useful than for usage by n=1 people. People may not want to share everything they eat with some private company with no options for privacy or collaboratively build a basic personal and societal tool. Thanks for what you built but the number of stars, downloads, and rank in sites like alternativeto should make it clear that this is a really important piece of software at this point.

EmilJunker commented 2 months ago

Moreover, EmilJunker has contributed much as well by now

@prototyperspective Thanks for your concern, but I'm good. Waistline is by far and away the most feature-rich open source nutrition tracker app out there. No other open source app comes even close to the amount of features and flexibility it offers. That is, for people who know how to use it 😉.

The only other comparable app I'm aware of is OpenNutriTracker, but it still has a very long way to go before reaching parity with Waistline - although it arguably looks a lot prettier 😄. And note that it uses OpenFoodFacts and Food Data Central as its sources too, so it generally suffers from the same problems with generic food items as Waistline.

Comparing Waistline to commercial food tracking apps is just wrong and misleading. Waistline will never be as user friedly as those apps. But for users who prefer open source, Waistline is the best choice.

Long story short, I don't consider the time I invested into Waistline a waste. I'm proud of this app. In fact, working on Waistline is how I landed my current job as a hybrid app developer.