-
Notifications
You must be signed in to change notification settings - Fork 1
/
Readme.txt
59 lines (34 loc) · 1.34 KB
/
Readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Getting started: mern_shopping_list
$npm init
entry point: server.js
license: MIT
$npm i express body-parser mongoose concurrently
Express.js : helps manages routes, handling requests and views.
Body-parser : extract entire body portion of an incoming request stream and exposes it on req.body
$npm i -D nodemon
Nodemon: will constantly watch backend and reload on save
-D will install on dev dependency, so it's ignored in production
"scripts": {
"start": "node server.js"
}
Scripts will be executed when run on production
How to run scripts: npm run <scripts>
URI is stored in config/keys
API is stored in routes/api
$npm i bcryptjs
================= CLIENT ===================
Run $create-react-app
Since we will be using axios, in package.json add
"proxy": "http://localhost:5000" //Same json level as private, dependencies, and scripts
Add new scripts for running both server and client
"client-install": "npm install --prefix client",
...
"client": "npm start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\""
Add external packages in client
$npm i bootstrap reactstrap uuid react-transition-group
uuid generates unique id
$npm i redux react-redux redux-thunk
store.js : entry point for redux store
$npm i axios
Why postbuild prod config set to false: it's not gonna run build script if it in production