Skip to content

Commit

Permalink
Working on buindling everything
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-flynn committed Oct 11, 2022
1 parent a1f3b15 commit 312d082
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 11 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
node_modules/
build/
build/
bin/api
bin/logs
bin/realtime
2 changes: 2 additions & 0 deletions back-end/api/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules/
build/
dist/
logs/
*.log
*.env
22 changes: 20 additions & 2 deletions back-end/api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion back-end/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"main": "build/Server.js",
"type": "module",
"scripts": {
"start": "tsc && node build/Server.js"
"start": "tsc && node build/Server.js",
"build": "tsc",
"dist": "ncc build build/Server.js -e sqlite3 -o dist"
},
"author": "Kyle Flynn",
"license": "ISC",
Expand All @@ -18,6 +20,7 @@
"@types/passport-jwt": "^3.0.6",
"@types/passport-local": "^1.0.34",
"@types/sqlite3": "^3.1.8",
"@vercel/ncc": "^0.34.0",
"editorconfig": "^0.15.3",
"eslint": "^8.20.0",
"eslint-config-prettier": "^8.5.0",
Expand Down
4 changes: 3 additions & 1 deletion back-end/realtime/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules/
build/
dist/
logs/
*.log
*.env
logs/
22 changes: 20 additions & 2 deletions back-end/realtime/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions back-end/realtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"type": "module",
"scripts": {
"start": "tsc && node build/Server.js",
"start:debug": "tsc && set DEBUG=*& node build/Server.js"
"build": "tsc",
"dist": "ncc build build/Server.js -o dist"
},
"author": "Kyle Flynn",
"license": "ISC",
Expand All @@ -18,11 +19,12 @@
"@types/passport": "^1.0.9",
"@types/passport-jwt": "^3.0.6",
"@types/passport-local": "^1.0.34",
"@vercel/ncc": "^0.34.0",
"typescript": "^4.7.4"
},
"dependencies": {
"@toa-lib/server": "file:../../lib/server",
"@toa-lib/models": "file:../../lib/models",
"@toa-lib/server": "file:../../lib/server",
"body-parser": "^1.20.0",
"cors": "^2.8.5",
"express": "^4.18.1",
Expand Down
15 changes: 15 additions & 0 deletions bin/pm2.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
apps : [{
name : "EMS API",
script : "./api/Server.js",
env: {
NODE_ENV: "production"
}
},{
name : "EMS REALTIME",
script : "./api/Server.js",
env: {
NODE_ENV: "production"
}
}]
}
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
"scripts": {
"install:lib": "cd ./lib/models && npm install && cd ../client && npm install && cd ../server && npm install && cd ../../",
"build:lib": "cd ./lib/models && npm run build && npm link && cd ../client && npm run build && npm link && cd ../server && npm run build && npm link && cd ../../",
"install:backend": "cd back-end/api && npm install && npm link @toa-lib/models && npm link @toa-lib/server && cd ../realtime && npm install && npm link @toa-lib/models && npm link @toa-lib/server && cd ../../",
"build:backend": "cd ./back-end/api && npm run build && npm run dist && cd ../realtime && npm run build && npm run dist",
"install:backend": "cd back-end/api && npm install && cd ../realtime && npm install && cd ../../",
"install:frontend": "cd front-end && npm install && npm link @toa-lib/models && npm link @toa-lib/client && cd ../",
"setup": "npm run install:lib && npm run build:lib && npm run install:backend && npm run install:frontend"
"setup": "npm run install:lib && npm run build:lib && npm run install:backend && npm run install:frontend",
"build:all": "npm run build:lib && npm run build:backend && cd ../../",
"dist": "xcopy .\\back-end\\api\\dist .\\bin\\api /E /R /Y && xcopy .\\back-end\\realtime\\dist .\\bin\\realtime /E /R /Y"
}
}

0 comments on commit 312d082

Please sign in to comment.