From e85e7349792214ec1e7607a396205143a8d3a109 Mon Sep 17 00:00:00 2001 From: Ruidy Nemausat Date: Sat, 25 Apr 2020 12:00:34 +0200 Subject: [PATCH] sample app ready --- README.md | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e6d16c6..ea876ff 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,64 @@ # MERN Stack Demo +Skeleton MERN Stack app with Redux and Firebase. + ## Prequisites - NodeJs - npm -## Installation +## Backend configuration -``` +```zsh npm init -y ``` install dependencies -``` -npm i express mongoose concurrently +```zsh +npm i express mongoose concurrently firebase-admin helmet moment ``` install nodemon for server hot reload and jest for testing -``` +```zsh npm i -D nodemon jest ``` -## Create npm scripts +### Update package.json ```json { + "type": "module", "scripts": { - "start": "node server.js", - "server": "nodemon server.js", + "start": "node --experimental-modules --experimental-json-modules server.js", + "server": "nodemon --experimental-json-modules server.js", + "client": "npm start --prefix client", + "client-install": "npm install --prefix client", + "dev": "concurrently \"npm run server\" \"npm run client\"", + "heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client", "test": "jest", "test:watch": "npm run test -- --watch" } } ``` + +## Frontend configuration + +```zsh +npx create-react-app client --template redux +``` + +Install dependencies + +```zsh +npm i axios firebase prop-types react-router-dom +``` + +### Update package.json + +```json +{ + "proxy": "http://localhost:5000" +} +```