Question

I have and UKFast instance running Magento 2.4.2 with sample data and installed PWA Studio by following directions here:

https://magento.github.io/pwa-studio/venia-pwa-concept/setup/

Everything gets installed following those directions.

But, I cannot find any directions on how to use this on a live server. After following the above instructions all I get is this URL (like below):

https://magento-venia-concept-cksu3.local.pwadev:8488/

And clicking that does not get anything in my browser.

I even tried following:

https://magento.github.io/pwa-studio/tutorials/pwa-studio-fundamentals/project-setup/

But I can't tell if I am supposed to follow those directions instead of the other directions or in addition to those directions. If I follow them in addition to it just installs it in another PWA directory.

I can't find anything that will tell me how to view this live using my domain name. All of the setup to view the site/pwa is not clear at all. Even sites like Nexcess, Webkul and CedCommerce that have PWA articles have been no help and just seem to repeat the same directions.

Can someone offer instructions on how to see this live? There has to be something/someone that has had success and good directions on how to get this implemented and working with a live site.

Thanks in advance.

Was it helpful?

Solution

I found a solution myself. Follow below method-

Let's assume you already have or installed NodeJS >=10.14.1 and Yarn >=1.13.0 in your server. And also you have a running Magento 2 instance. Now follow below step by step.

In your Magento root directory run

git clone https://github.com/magento/pwa-studio.git

After clone complete go to pwa-studio folder

cd pwa-studio

Then run below command one by one

yarn install

yarn buildpack create-custom-origin packages/venia-concept

Now set you backend url (site base url)

MAGENTO_BACKEND_URL="https://mymagentosite.come/" \
CHECKOUT_BRAINTREE_TOKEN="sandbox_8yrzsvtm_s2bg8fs563crhqzk" \
yarn buildpack create-env-file packages/venia-concept

After that run below commands

yarn run build

yarn run watch:venia

Now what you need to do to connect you pwa-studio with your Magento is install Magento_UpwardConnector module

composer require magento/module-upward-connector
php bin/magento setup:upgrade
php bin/magento cache:flush

Now you have to set connection between pwa-studio and magento by below commands. You have to give exact path of the upward.yml file.

bin/magento config:set -e web/upward/path /var/www/vhosts/mymagentosite/htdocs/pwa-studio/packages/venia-concept/dist/upward.yml

Thank you.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top