2. Bootstrapping A React Project

2.1. Installing dependencies

First step is to install the correct Node version using nvm:

$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

Then you can install the latest LTS version of node:

$ nvm install v8.11.3

We use the package manager yarn, to install do:

$ npm install -g yarn

And add the create-react-app package:

$ yarn global add create-react-app

2.2. Bootstrapping A Project

To create a new react project type the following:

$ create-react-app my-app

It will create a folder called my-app inside the current folder with the following structure:

my-app
├── README.md
├── node_modules
├── package.json
├── .gitignore
├── public
│   ├── favicon.ico
│   ├── index.html
│   └── manifest.json
└── src
    ├── App.css
    ├── App.js
    ├── App.test.js
    ├── index.css
    ├── index.js
    ├── logo.svg
    └── registerServiceWorker.js

2.3. Running The Project

To run the project you can type:

$ cd my-app
$ yarn start

This will start the server and open up the website in your preferred browser.