index
Overview
Commands to setup JodPro Frontend after spinning up a new instance
- Running Ubuntu 24.04
Installation Steps
Upgrade default ubuntu packages
sudo apt-get update
sudo apt-get upgrade
sudo apt update
sudo apt upgrade
Install nvm
To manage node version easily
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.bashrc
command -v nvm
nvm install 20.17
Install pm2
To easily start the serve process
npm install pm2@latest -g
Install serve
Simple statice server to serve built react files
npm install -g serve
Add Github Deploy Keys
Create private key
ssh-keygen -t ed25519 -C "appname.env.role"
Copy public key
cat ~/.ssh/appname.env.role.pub
Paste into Github repo Settings > Deploy Keys
Add github.com host to ~/.ssh/config
Update ssh config to use the private key (.pem file)
nano config
Add github.com as a host using the .pem key
Host github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/appname.env.role
Set permission on the private key
chmod 400 ~/.ssh/deploy-github-jodpro-api-qa
Clone the repo
git clone github@github.com:org-name/repo-name.git
Add Swap Space
We can [[Add Swap Space to Ubuntu 24.04]] so we dont run out of memory when building the app on the same host that serves the compiled react file
Deploy react app
cd ~./project-folder
npm install
npm run build
pm2 serve build 3000 --spa
Issues
One of your dependencies, babel-preset-react-app, is importing the
"@babel/plugin-proposal-private-property-in-object" package without
declaring it in its dependencies. This is currently working because
"@babel/plugin-proposal-private-property-in-object" is already in your
node_modules folder for unrelated reasons, but it may break at any time.
babel-preset-react-app is part of the create-react-app project, which
is not maintianed anymore. It is thus unlikely that this bug will
ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
your devDependencies to work around this error. This will make this message
go away.
=============
WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.
You may find that it works just fine, or you may not.
SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <5.2.0
YOUR TYPESCRIPT VERSION: 5.4.5
Please only submit bug reports when using the officially supported version.