Member-only story

React project setup — without any boilerplates

Ashan Priyadarshana
7 min readApr 19, 2020

--

There are a ton of great boilerplates (create-react-app, slingshot, etc) that help you save time and kick-start your app. But most of the time using a boilerplate can be more confusing than setting things up yourself. In this post lets see how we will install everything directly from scratch.

first things first, Lets Installing node and npm (following are for centos or amazon linux)

$ sudo yum install -y gcc-c++ make
$ curl -sL https://rpm.nodesource.com/setup_12.x | sudo -E bash -
$ sudo yum install -y nodejs
# Verify installation
$ node -v
$ npm -v

Create the Project Base Directories

Use the following command to create the project directory and then its base subdirectories and the webpack.config.js file that we will be needing.

$ mkdir <Project Name> && cd $_$ mkdir -p src/{components,containers,styles,utils,views} && touch webpack.config.js

In the same directory, let’s create our node project by using the npm init -y (-y for accepting all the defaults and not to answer any questions) command. After this command finishes, we’ll have a package.json in the same directory, which will allow us to define a repeatable process for building our app in future and in…

--

--

Ashan Priyadarshana
Ashan Priyadarshana

Written by Ashan Priyadarshana

Technical Lead | MSc. Artificial Intelligence | BSc. Information Technology | Founder www.fixmynotes.com, www.vehiclehub.lk | GSoC 2017

No responses yet