Section 1.2

1.2 React client & create-react-app

For the purposes of this tutorial I am going to use Facebook’s create-react-app to build the starter project. It is however advisable that at some point you start a new project and learn to build an app from scratch yourself manually using Webpack and Babel. Doing this will mean that in the long run you will understand what is going on better.
I’ve got a post somewhere in which I run through how Babel/Webpack can be manually setup for a React environment - if you click posts on the top right, you’ll find it.

First we will install create-react-app globally, create a folder for our client and cd into the spawned folder and start up npm.

You will now have a skeleton react app created and running on localhost:3000.

We need to clean up some files before continuing. First delete the .gitignore file from our /client folder and then in the root folder /reactnodedemo/ create a new .gitignore file with the following contents to ensure our node_modules folder doesn’t enter the repo

# dependencies
/client/node_modules

The next stage is to setup the folder structure in the client. create-react-app should have spawned a src folder. Within this folder create a folder called components.