vuestorefront / vue-storefront-api

Vue.js storefront for Magento2 (and not only) - data backend
https://www.vuestorefront.io
MIT License
346 stars 337 forks source link

What are the options when you want a simple backend? #167

Open paulvanbladel opened 5 years ago

paulvanbladel commented 5 years ago

Very nice project. Just wondering if I could use vue-storefront just with a very simple backend? Meaning, just a sql or nosql database.

pkarw commented 5 years ago

Thanks :-) yes, you can! You just need to emulate the Vue-storefront-api endpoints - the full spec is in here: https://github.com/DivanteLtd/vue-storefront-integration-boilerplate/blob/master/1.%20Expose%20the%20API%20endpoints%20required%20by%20VS/Required%20API%20specification.md

The simplest way to integrate is probably pushing the data to ElasticSearch and then implement some basic endpoints of your need like shopping cart, order etc

You can find very simple integration in here: https://github.com/DivanteLtd/bigcommerce2vuestorefront

paulvanbladel commented 5 years ago

Hi, thanks a lot for the prompt feedback. So I understand correctly that ElasticSearch is mandatory in the simplest back-end scenario?

pkarw commented 5 years ago

Not necessarily; please do check the graphql (docs) and maybe you could just implement the custom graphql resolver instead of using elastic?

paulvanbladel commented 5 years ago

Piotr, just my cents... Well, my point (and I'm just trying to share some experiences from someone trying to explore vue-storefront, nothing more) is that it is quite cumbersome to get vue-storefront working in debug mode and being able to see your own data moving through the system without first installing something like magento (which gives a huge SAP feeling :) ). I believe it would be beneficial to bring things back to simple proportions. There are databases which require no installation at all (e.g. https://github.com/typicode/lowdb). Probably someone with vue-front-store experience can build such an integration in minutes. It would allow to just npm install things and start working, build up confidence and start extending with 'real' backends. As said, just my 2 cents :) Cheers.

pkarw commented 5 years ago

That's very helpful feedback @paulvanbladel; thanks for that. @kacperknapik is starting some side project of Faker based backend - so it's a pretty similar approach to what You've just described.

I would love to have some more time to write such a lightweight backend/api to show how it exactly work - still haven't found time for it :(

mojo2012 commented 5 years ago

Hi guys,

I have similar problems to understand how everything works together. In java it is all so easy, just set a breakpoint and explore and watch how everyting works. This seems impossible in the javascript world - especially with babel and friends. OK enough ranting ...

I'm currently trying to implement the API without any magento using my own little framework https://spot-next.io. Some stuff like cart manipulation are pretty straight forward. But some calls are more or less useless, like GET /vsbridge/products/index. It seems there are some customized values there, that work for a customized magento apparel store, but are useless for another store, like accessories_type. Some other properties like attribute_set_id are just useless either. What is their meaning?

I have not worked with magento, so maybe for a magento dev this is all easy. But shouldn't it be easy for any developer?

The best approach would be to have some diagrams, showing the data model. This would make it easy to understand what is what. As an alternative, at least provide property-level description.

Also the docs seem outdated for some part, some seem imprecizse. It took me hours to understand how vue-storefront-api integrates with the whole "have your own backend" idea.

So to sum up:

Awesome project btw! Keep up the work.

pkarw commented 5 years ago

Hi! That's awesome :) In fact I'm planning to add a very simple backend (even without the need to have ElasticSearch) to show how easily one can integrate with Vue Storefront. With the minimal set of fields required etc.

How does it sound to You? I plan to start working on that in the upcoming days so maybe I'll just expose the results on Github to let You work right away on the itnegration

ps. Not sure If i got the spot-next right: it's designed to be a kind of replacement for Hybris, correct?

mojo2012 commented 5 years ago

Yes, it tried do take the good parts (orm mapper, API) to the next level, by exposing the entities through a generic restful interface(something hybris cannot). So far it works quite well (we even have a generic entity manipulation backend in the make).

klapperkopp commented 5 years ago

Is anyone else working on the above topics? We are also trying to do a production setup for a marketplace here and bending magento 2 at the moment to do this, but I'd really like to have a much simpler backend setup with less clutter. Also, the elasticsearch is not a preferrable option for us. I'd like to help out if there is some concrete thing that needs to be worked on and if I know if someone has done something already. @pkarw

OnlyC commented 5 years ago

@klapperkopp Spreecommerce has the marketplace use case, go take a look. Other than that, Moltin api is simple.