Hello, please help me: what is the best way to sync data between VSF and my custom CMS (written on PHP)? Does exists some guides or examples?
If your CMS serves data in the shape that satisfies you. The best way would be creating VSF PWA module with dedicated Vuex module. Then you could easily use vuex actions to fetch data from your CMS inside asyncData / serverPrefetch+mounted. With that you should have all data you need in the SSR mode - which is essential for the SEO
- Create VSF-PWA Module (src/modules) with dedicated Vuex module with actions for fetching pages from CMS and storing them in vuex module state etc.
- Use it in page’s asyncData or component’s serverPrefetch+mounted to make sure it has SSR (for SEO)
- Then you should have access to cms data from server and client via Vuex module state
Does this mean I won’t have to use Elasticsearch?
Yes, for getting data from CMS - you could fetch it directly without using Elasticsearch. Pick up a solution which suits you more.
- Will the SSR work correctly in this case? In particular, updating statically generated pages when updating content
- In what format should I return data from my CMS?
- Yes. SSR is not about Elasticsearch but about fetching data serverside and transforming them to the client. If you will use approach from my first answer - you will get it.
- Rest API that returns JSON should be the easiest option for your first integration
Thanks! Another question: do I need to use the vue-storefront api in my case?
If you want to fetch data from cms you can do it straightly from PWA without vue-storefront-api. Use VSF-API as a proxy if some endpoint needs secret data.