Environment | URL |
---|---|
Production | https://seniorproject.se.rit.edu |
Test | https://seniorproject-sandbox.se.rit.edu |
Create new user account:
sudo adduser USERNAME
Give user administrative privileges:
sudo usermod -aG sudo username
On first login, new user must change password by using the passwd
command
- Create SSH keys (There are plenty of tutorials online to do this)
- Create ssh folder:
mkdir /home/USERNAME/.ssh
- Add your public key to
/home/USERNAME/.ssh/authorized_keys
(create file if does not exist) - Restart ssh daemon:
sudo systemctl restart sshd
- Add user to pm2 group:
usermod -aG pm2 USERNAME
- Paste
alias pm2='env HOME=/home/website/RIT-SE-Senior-Project/server pm2'
into the bottom of~/.bashrc
Run install.bat
to get dependencies set up locally
In order to get things running locally, you'll need to run npm start
in both the ./server
and ./ui
folders
After sshing into the server, cd into either prod or test project. Then run according deploy.sh script
-
We use nginx as a reverse proxy to serve the website. Network requests for both the UI and the server go into nginx and either get redirected to the UI's static files or to endpoints on the server.
-
The server is running locally using pm2.
-
pm2 is a pain in the butt. If you are having issues with
.env
variables not updating, you may need to restart the pm2 daemon by usingpm2 kill
to stop the pm2 process andpm2 start /home/website/RIT-SE-Senior-Project/server/main.js
to start it again.
-
Root level (not in /nginx, /server, or /ui) contains files important for deployment of code onto the production and sandbox servers
-
/nginx configuration info for the nginx server/reverse proxy
-
/server files for the backend
-
/ui files for the REACT based frontend