-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtodo-list.txt
143 lines (107 loc) · 5.71 KB
/
todo-list.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
Geoclusters API Deployment Checklist
[x] Create the following in the root dir >
[ ] Create server.js
[ ] Create app.js <= this calls the "routes"
[ ] Load the routes => eg., const PARCELIZED_AGC_ROUTES = require('./routes/parcelized-agc-routes.js');
[ ] Mount the router => eg., EXPRESS_APP.use('/api/v1/parcelized-agcs', PARCELIZED_AGC_ROUTES);
[ ] Create "routes/routers" folder <= this calls the "controllers"
[ ] Create "controllers" folder <= this calls the "models"
[ ] Create "models" folder
[ ] Install npm VALIDATOR package to validate email addresses in user-model.js
[ ] SERVER SIDE RENDERING
[ ] Create a "views" folder
[ ] Set the express app templating engine to "pug" in app.js
[ ] Point to the "views" directory > EXPRESS_APP.set('views', path.join(__dirname, 'views'));
[ ] Create middleware to serve static files from "public" folder
[ ] Create view-controller.js
[ ] Create the functions that render the .pug files in the 'views' folder
[ ] Get parcelized-agc data from Atlas DB collection
[ ] Render the returned parcelized-agc data to the 'agc-render.pug' template
[ ] Create view-routes.js
[ ] Import the render functions from view-controller.js
[ ] Export the ROUTER as viewsRouter
[ ] Mount the viewRouter on the base url in app.js
[ ] Upload data from local .geojson file to Atlas DB
[ ] Update and save the "parcelized-agcs.geojson" file
[ ] Upload the file to database > RUN: npm run exportdb
[x] Install server response (JSON / HTML) compression => npm i compression
[x] Add { "start": "node server.js" } script to package.json in order for Heroku to work
[x] Add latest node version to "engines" in package.json
[ ] Remove all the console.logs
[ ] Push to GitHub { ** OPTIONAL ** }
[ ] Create a project repo. on GitHub.com
[ ] Initialize git on local working directory: "git init"
[ ] Stage and commit the files in the local repo: git add -A && git commit -m 'Initial commit'
[ ] Copy the remote repo's URL from GitHub.com
[ ] Connect the remote repo: "git remote add origin https://github.com/monolithgoon/avg-dashboard.git
[ ] To remove origin from git repo: "git remote rm origin"
[ ] Push to the remote repo: "git push -u origin master"
{ ** 2021 UPDATE ** }
git init
gh repo create avg-dashboard --private
git remote add origin https://github.com/monolithgoon/avg-dashboard.git
git branch -M main
git pull origin main --allow-unrelated-histories
git add .
git commit -m "initial commit"
git push -u origin main
IMPORTANT > DEPLOY NODE JS APP TO HEROKU
[ ] Create a 'start' script in packgage.json > "start": "node server.js"
[ ] If app entry-point (server.js) is not in root dir, create a Procfile at app root dir. containing:
[ ] web: node server/server.js
[x] Create a new Heroku project > RUN: "heroku create [app name]"
[..] To change default name of Heroku app > RUN: heroku apps:rename [newname]
[x] Connect to GitHub repo > On Heroku dashboard, select "Deploy" && click on "Connect to GitHub"
[x] Upload files from "master" repository to Heroku >
[x] RUN: "git push heroku master"
[x] Verify this works, and confirm the remote repos > RUN: git remote -v
[x] ******Set environment variables on Heroku (needed b/cos default.env is excluded from git commits) >
[x] RUN: heroku config:set NODE_ENV=production
[x] RUN: heroku config:set ATLAS_DB_STRING="mongodb+srv://monkey-paw:<PASSWORD>@monkey-paw-cluster-cwcff.gcp.mongodb.net/nirsal_agcs?retryWrites=true&w=majority"
[x] RUN: heroku config:set ATLAS_DB_PASSOWRD=*******
[ ] Deploy local git repo. to a new/different Heroku app/dyno
[ ] RUN: heroku git:remote -a <NEW_HEROKU_APP_NAME>
[ ] RUN > npm run deploy
[ ] Get currently deployed app - RUN: git remote -v
IMPORTANT > DEPLOY NODE.JS / REACT APP TO HEROKU
[ ] Create & run React "build" folder on server
[ ] Add following script to package.json
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
-- "NPM_CONFIG_PRODUCTION=false" temporarily removes the app from production mode, in order to execute "npm run build"
-- "npm install --prefix client" installs all the React client-side dependencies / folders
-- "npm run build" creates a static production build and loads the index.html
[ ] RUN: heroku login
[ ] RUN: heroku create
[ ] RUN: git remote -v
[ ] Change default name of Heroku app >
[ ] RUN: heroku apps:rename [newname]
[ ] (Redundant) Add Heroku as a remote repo >
[ ] RUN: heroku git:remote -a <HEROKU_APP_NAME>
[ ] RUN: git push heroku master
[ ] Deploy to Firebase >>
[x] Install the Firebase CLI >> RUN: npm install -g firebase-tools
[ ] Initialize Firebase in the project directory >> RUN: firebase init
[ ] Open Heroku project > RUN: "heroku open"
IMPORTANT > DEPLOY NODE.JS APP TO VERCEL
[ ] Add the following to a config file called "vercel.json" at the root of the project
{
"version": 2,
"name": "automated-land-subdivision-api",
"builds": [
{
"src": "server.js",
"use": "@vercel/node"
}
],
"routes": [
{
"src": "/(.*)",
"dest": "/server.js"
}
]
}
**GIT COMMANDS
- REMOVE LOCAL GIT REPO AUTOMATICALLY CREATED BY REACT - rm -rf .git
https://cloudsociety.microsoft.com/en/devopsacademy
https://docs.microsoft.com/en-us/azure/app-service/quickstart-nodejs?tabs=windows&pivots=development-environment-cli
https://www.atlassian.com/git/tutorials/setting-up-a-repository