# Getting Started

## Summary

* [ ] Ensure you have Node v14 (npm v6) on your development machine
* [ ] `npx create-scandipwa-app my-app` to create a new app
* [ ] `cd my-app` to enter your app's directory
* [ ] `npm start` to run the app

These commands will create a new Scandi app, start it up, and open it in your browser.

## Creating an App

**You’ll need to have Node v14 on your local development machine** (but it’s not required on the server). You can use [n](https://www.npmjs.com/package/n) (macOS, Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to switch Node versions between different projects.

You **don’t** need to install or configure tools like Webpack or Babel. They are preconfigured and hidden so that you can focus on the code.

To create a new app, use `create-scandipwa-app`:

### NPX

{% tabs %}
{% tab title="npx" %}

```bash
npx create-scandipwa-app my-app
```

{% endtab %}

{% tab title="npm" %}

```
npm init scandipwa-app my-app
```

{% endtab %}

{% tab title="yarn" %}

```
yarn create scandipwa-app my-app
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
To create an empty template instead of the default Scandi theme, use the `--template blank` option.
{% endhint %}

## Expected Output

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

```bash
📁  my-app
├── 📄  README.md
├── 📄  composer.json
├── 📁  i18n
├── 📁  magento
|  ├── 📁  etc
|  |  └── 📄  view.xml
|  ├── 📄  registration.php
|  └── 📄  theme.xml
├── 📁  node_modules
├── 📄  package.json
├── 📁  public
├── 📁  src
└── 📄  yarn.lock
```

No configuration or complicated folder structures, only the files you need to build your ScandiPWA app.

## Scripts

Inside the newly created project, you can run some built-in commands:

### `npm start` or `yarn start`

Runs the app in development mode. Will open the [http://localhost:3000](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.

### `npm run build` or `yarn build`

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.

### Linking the theme

If you are installing the ScandiPWA theme on a CMA setup, after you build it you should also link your theme to your Create Magento App project:

[Click here for instructions](https://docs.create-magento-app.com/usage-guide/themes).
