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-appto create a new app
cd my-appto enter your app's directory
npm startto 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 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-appinside 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
buildfolder. 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
You can copy the dependencies defined in
requirefield of your application's
composer.jsonto your Magento server's root
composer.jsonand execute the