vue-storefront-api icon indicating copy to clipboard operation
vue-storefront-api copied to clipboard

What are the options when you want a simple backend?

Open paulvanbladel opened this issue 5 years ago • 10 comments

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

paulvanbladel avatar Jan 05 '19 08:01 paulvanbladel

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

pkarw avatar Jan 05 '19 10:01 pkarw

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

paulvanbladel avatar Jan 05 '19 11:01 paulvanbladel

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

pkarw avatar Jan 05 '19 11:01 pkarw

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.

paulvanbladel avatar Jan 07 '19 08:01 paulvanbladel

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 :(

pkarw avatar Jan 08 '19 13:01 pkarw

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:

  • provide better tools to undestand the system architecture (not just highlevel)
  • provide better tools to watch "data move" aka debugging/IDE facilities
  • provide data model to understand how all the entities are connected so the data returned from a custom backend is consistent

Awesome project btw! Keep up the work.

mojo2012 avatar Jan 21 '19 17:01 mojo2012

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?

pkarw avatar Jan 24 '19 12:01 pkarw

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).

mojo2012 avatar Jan 24 '19 14:01 mojo2012

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

klapperkopp avatar Apr 28 '19 17:04 klapperkopp

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

OnlyC avatar May 19 '19 10:05 OnlyC