Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with Trefle #71

Open
phiwut opened this issue Jan 23, 2019 · 4 comments
Open

Integration with Trefle #71

phiwut opened this issue Jan 23, 2019 · 4 comments

Comments

@phiwut
Copy link

phiwut commented Jan 23, 2019

Hi, what do you think about the Idea to add integration to https://trefle.io? This way plant information could automatically be added.

@morkro
Copy link
Owner

morkro commented Jan 23, 2019

Interesting, thanks for sharing @phiwut! I was looking for something like this when I started this project but didn't find anything useful back then. This could potentially enable some really cool features, like you suggested automated plant information. :)

I will fiddle around with that API and see what possibilities this brings for HappyPlants!

@phiwut
Copy link
Author

phiwut commented Apr 17, 2019

Hi Moriz,
I tried to implement treffle but I sadly couldn't figure out where you locate the API logic (in the API folder?) and the business logic for loading the data in the Overview component. However, I'm interested to see how you'll implement this feature :)

@morkro
Copy link
Owner

morkro commented Apr 18, 2019

Hey @phiwut,

thanks for giving it a shot! I'm following the development around Trefle and up until today they didn't have any client-side API tokens. With that addition it should be possible to work on some experimental features, e.g. autocompleting data or having an entirely separate plant module. Alternatively, Netlify's Lambda functions could be used to fetch the data. However, the project is still in very early stages and the API might break/change quickly. I am very interested in this API, just not sure about its maturity at this stage.

I don't want to discourage you contributing to this project though, just sharing my thoughts on it. :)

couldn't figure out where you locate the API logic (in the API folder?) and the business logic for loading the data in the Overview component.

Everything in the src/api directory is meant to be a light wrapper around any API used in the application. In this case Firebase, localForage, and sessionStorage. I realise the naming is a bit ambiguous.

The actual business logic of the application can always be found in the store directory of any feature. In your example it would be src/app/overview/store. The actions dispatch and fetch data, while mutations take the input and mutate the state. Since the overview screen doesn't do anything with data, except displaying it, there isn't anything business logic. Take a look into src/app/plant/store/actions to get a better understanding of it.

I should probably write a little bit of documentation on the overall application architecture so it's easier to contribute :)

@phiwut
Copy link
Author

phiwut commented Apr 25, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants