TandoorRecipes / recipes

Application for managing recipes, planning meals, building shopping lists and much much more!
https://docs.tandoor.dev
Other
5.33k stars 561 forks source link

Grocy integration #86

Open vabene1111 opened 4 years ago

vabene1111 commented 4 years ago

since grocy has an API it might be possible to integrate grocy and recipes since the internal recipes feature of grocy is ok but not as fully featured as recipes while recipes lacks certain features that grocy offers

https://grocy.info/

vabene1111 commented 3 years ago

it appears that groxy does not offer an exporting feature at the moment and i dont feel like writing a database exporting tool.

If anyone wants to step in here feel free to let me know

darkcloud784 commented 3 years ago

Grocy is built on a Restful API which you can get stock information from grocy. I think that would be a good addition. Use Recipes as your recipe database and add grocy's stock information so you can see what you can/cannot make with current items you have.

https://demo.grocy.info/api

vabene1111 commented 3 years ago

yes thats what i had in mind when planning a grocy integration. The last comment was when i worked on the different importers because grocy does not have an easy to use way to export all the stored recipes (as far as i could find).

As Grocy is very poupular houshould management system i definitely want to add some kind of integration module

tdvantine commented 3 years ago

I love this idea. I currently don't have grocy installed because I have to install it behind https for the camera to work which requires me to be on location of my home webserver (requires hardware key to sudo), but would love to see an integration with grocy. Not sure what all that would look like though, but all for it.

frudolph77 commented 3 years ago

Hey,

I've also seen grocy. The stock/pantry (Speisekammer) feature inside is great but recipes has a much better feature set regarding recipes.

I my opinion, you should implement a stock/pantry feature directly in recipes and do not rely on a third party app. I would have opened a feature request, but them I've seen this issue.

I definitely did not want to install both, because I'm not interested in the other features of grocy.

Regards Frank

vabene1111 commented 3 years ago

thanks for the feedback. I have very limited time and am not sure if opening the whole stock/inventory management topic is something i am ready for just now. I think it could be something to be added in the long future.

Even if i add a feature for it there are still quite a few people who use grocy and thus an integration would be very useful to them. I guess one does not exclude the other option here.

frudolph77 commented 3 years ago

thanks for the feedback. I have very limited time and am not sure if opening the whole stock/inventory management topic is something i am ready for just now. I think it could be something to be added in the long future.

Even if i add a feature for it there are still quite a few people who use grocy and thus an integration would be very useful to them. I guess one does not exclude the other option here.

I totally understand your point, my time is also very limited. Unfortunately I've absolutely no skills in Django/Python and my Javascript skills are very limited, otherwise I could have helped you with such a feature.

vabene1111 commented 3 years ago

no worries, it will get done at some point :)

aidangilmore commented 3 years ago

What would you say some good first steps would be if I were hypothetically interested in implementing such a feature?

frudolph77 commented 3 years ago

Hey @aidangilmore

What would you say some good first steps would be if I were hypothetically interested in implementing such a feature?

What do you meant with 'implement such a feature'?

Integrate grocy into recipes by accessing the API or what i would prefer, implement a pantry inside recipes - this is at least the only feature I'm interested in.

I think as a starting point it would be great to have products in the pantry with the following attributes

User should be able to add own units, categories and locations

and for a later version

and as interaction with the recipes, something like: Do i have all needed products in my pantry to cook it.

But this are just my 2cents, it's totally up to @vabene1111

Regards Frank

vabene1111 commented 3 years ago

it is actually a good question what a grocy integration could do. I guess

I created the issue a while ago but honestly i have not really thought about what should be integrated. I think the search integration would be the most interesting thing.

aidangilmore commented 3 years ago

@frudolph77 Sorry, I was referring to writing something to integrate the Grocy API.

@vabene1111 Are we looking to do bi-directional sync of ingredients between Grocy and Tandoor or only pull ingredients from Grocy?

vabene1111 commented 3 years ago

That is a good questions. I recently added the ability to take a recipe export from Grocy and import it into Tandoor.

I guess there could be a function that syncs the different ingredients between the two instances. For the future i was planning a popup dialog in the recipe view where details about the ingredients would be shown. This would also be a place where grocy information could be present.

I think one would need to evaluate the data model of a grocy "ingredient" and see if it would make sense to have a special model called something like GorcyInformation that is in an optional relation to the already existing Food model

Then there could be a background service or something that syncs all the information present in Tandoor with the one in Grocy.

The search could then reference such a table and show for example only recipes were the ingredients are available.

I guess going back to your original question the starting point would be to closly investigate how grocy works (which tables/information is present) and create a concept on how this data could be relevant to Tandoor. This would for one be a list of functions that could be implemented using grocy data and on the other hand some kind of ERD type diagram on how the data models relate.

vabene1111 commented 3 years ago

Also Feeback on ideas how these two systems can work together is always very welcome. I have only limited information about what grocy is all about and what it can do so if anyone sees features that would be worth integrating feel free.

aidangilmore commented 3 years ago

Here's something I threw together last night showing fields in the current schema that would need to be synchronized. Tandoor Grocy Schema The diagram is a bit of a mess but I think it gets the idea across.

The workflow I'm trying to enable is using Grocy to keep track of ingredients, inventory and meal planning while using Tandoor to keep track of the recipes.

vabene1111 commented 3 years ago

This looks really good!

I guess one could make an API function somewhere or a special integration to simply run a sync between the two databases.

That could then later be integrated when i add a celery or cron system to run certain jobs periodically.

You say grocy also has meal planning ? can you integrate that into the diagram as well ? if you dont understand tandoors site of meal planning (which is a little messy) feel free to just show grocy.

frudolph77 commented 3 years ago

Please keep the meal plan inside Tandoor / recipes. Even if it is a little messy, it would be very sad if you remove this feature.

vabene1111 commented 3 years ago

There is absolutely no plan to remove any features. The grocy integration is only planned to integrate existing features on both sided with data from the other application.

aidangilmore commented 3 years ago

Ok, I threw in everything I think that will be required for adding meal planning integration. Tandoor Grocy Grocy doesn't really have the notion of individual steps in a recipe, instead opting for user specified HTML (with an accompanying WYSIWYG). We could opt to format it as a table, similar to the layout in Modernist Cuisine (see below), but I think HTML export it out of scope for what I'm doing now. Example recipe from Modernist Cuisine

vabene1111 commented 3 years ago

Thanks for the feedback and all the work.

So i guess we could create a special helper function that maps to some kind of api call which simply does a sync for all tables a user specifies.

There will definitly be some logic regarding updated timestamps and partial syncs and maybe we will need some custom fields on the recipe side of things to link data.

Maybe I will also talk to the devs of grocy to get an idea of what they think.

While this is a very cool feature there are some other things first, so feel free to play and prototype around, it will probably be some time before i can work on this

aidangilmore commented 3 years ago

Thanks for the feedback and all the work.

Likewise, thank you for making Tandoor. You've created something truly delightful.

There will definitly be some logic regarding updated timestamps and partial syncs

Grocy makes things difficult by not keeping track of timestamps changes top specific entries, instead having a single last modified timestamp for the entire database. If they wanted to make our life really easy, they could implement Webhooks.

Maybe we will need some custom fields on the recipe side of things to link data.

I was thinking of creating a table on our side that maps rows within our database to an identifier in an external system as well as a timestamp of the last change.

While this is a very cool feature there are some other things first, so feel free to play and prototype around, it will probably be some time before i can work on this

I'll throw up a draft PR when I have something, which will probably be in a little while.

vabene1111 commented 3 years ago

no worries, just play around and we will see where it leads

Seechay commented 2 years ago

Hello! Is this still being worked on? I haven't seen any comments lately about it, so not sure if it was forgotten about or is being silently worked on.

vabene1111 commented 2 years ago

It will at some point maybe :)

webysther commented 1 year ago

In my home we are heavy users of grocy, the grocery mgm is great but recipes not even close to be good, I started using this project and at this point I migrate my recipes and keep only the ingredients list as ref on grocy and link on recipe in this project, works, but I hope to make a integration using n8n to create a webhook to update the items needed for a recipe, any suggestions to make this more simple?

vabene1111 commented 1 year ago

not sure exactly what you want to do, i guess tandoor probably needs a web hook engine to really make this easy for you

webysther commented 1 year ago

I looking to get the items missing to buy in the grocery from a recipe (tandoor) checking in grocy

protonaut commented 8 months ago

Looking for an integration Grocy, too.

vabene1111 commented 8 months ago

There is currently work being done to integrate into home assistant, the same logic can maybe be used for Grocy

webysther commented 8 months ago

There is currently work being done to integrate into home assistant, the same logic can maybe be used for Grocy

Any chance to point the direction?

vabene1111 commented 8 months ago

this is the PR https://github.com/TandoorRecipes/recipes/pull/2874

once that is merged someone can look into grocy integration

webysther commented 8 months ago

this is the PR #2874

once that is merged someone can look into grocy integration

HOLY MOLY, for sure!

redxtech commented 5 months ago

Now that #2874 has been merged, is it possible to revisit this?

smilerz commented 5 months ago

Now that #2874 has been merged, is it possible to revisit this?

PRs are welcome