Step by step setup guide for the NERDS stack Node.js Express.js React.js Databases using SQL
-
mkdir boilerplate
thencd boilerplate
-
Create package.json with
npm init -y
-
git init
and make a .gitignore:node_modules bundle.js bundle.js.map .DS_Store
-
dependencies (npm install): => this will create node_modules and package-lock.json
- express
- sequelize
- body-parser
- morgan
- path
- react
- react-dom
- react-redux
- react-router-dom
- redux
- pg
-
devDependencies (npm install --save-dev):
- webpack
- webpack-cli
- babel-core
- babel-loader
- babel-preset-react
- babel-preset-env
- babel-preset-stage-2
-
Create
webpack.config.js
(see file) -
Create
.babelrc
for the babel-presets that were installed -
Set start script
npm start
command to build your client javascript and run server (see package.json) -
Set build script
npm run build
command to build your bundle.js -
Create file structure:
/server /api => your back-end routes should go here /db /models => separate models into different files /public /index.html /style.css /client /components => React components go here /store => store and redux reducers should go here
-
Go ahead and run
npm start
, open up localhost:1337 to see 'Hello, world!'