Storefront Mode Setup
Run Scandi as an separate app
- Ensure you have Node v12 or newer on your development machine
npx create-scandipwa-app my-app
to create a new appcd my-app
to enter your app's directorynpm start
to run the app
These commands will create a new Scandi app, start it up, and open it in your browser.
You’ll need to have Node >= 12 on your local development machine (but it’s not required on the server). You can use n (macOS, Linux) or nvm-windows to switch Node versions between different projects.
To create a new app, you may choose one of the following methods:
NPX
NPM
Yarn
npx create-scandipwa-app my-app
npm init scandipwa-app my-app
yarn create scandipwa-app my-app
Running any of these commands will create a directory called
my-app
inside the current folder. Inside that directory, it will generate the initial project structure and install the transitive dependencies. More details:Runs the app in development mode. Will open the http://localhost:3000 to preview changes in your default browser.
The page will automatically reload if you make changes to the code. You will see the build errors and lint warnings in the console.
Builds the app for production to the
build
folder. It correctly bundles React in production mode and optimizes the build for the best performance.The build is minified and the filenames include the hashes.Your app is ready to be deployed.
By default, your new application will be fetching data from a remote store. If you want to use your own Magento instance, you can either create a new CMA (by following this guide) or set up a Magento instance manually. After that, you must configure it to include ScandiPWA-specific modules (as described here).
To use Magento 2 as a data source for ScandiPWA, you are required to make sure that it is using the correct Composer dependencies. The list of your application Composer dependencies can be found in your ScandiPWA application's
composer.json
file.You can copy the dependencies defined in
require
field of your application's composer.json
to your Magento server's root composer.json
and execute the composer update
command.Last modified 2yr ago