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
-
- You may need to add the following to your hosts file (
C:\Windows\System32\drivers\etc\hosts
):150.171.69.10 mcr.microsoft.com 150.171.69.10 eastus.data.mcr.microsoft.com
- Install Docker
- Install VSCode and the Dev Containers extension
- Open the project in VSCode and select "Reopen in Container" from the command palette (Ctrl+Shift+P)
- The project will automatically initialize and all necessary dependencies will be installed. (see
install.ps1
anddevcontainer.json
) - VSCode will also automatically configure the development environment, including setting up the necessary extensions and settings.
- You may need to add the following to your hosts file (
-
- Run
install.ps1
(recommended) orinstall.bat
(legacy) orinstall.sh
(on linux) to get dependencies set up locallyinstall.ps1
supports performing a clean installation by using the-CleanInstall
flag. Use this if you encounter anpm install
failure. Caution: Ensure you have commited/pushed any important changes before running this command.install.ps1
also supports skipping initializing the server or the ui, using the-SkipServer
and-SkipUI
flags.
- You will need to manually install the Prettier extension on your IDE (for VSCode) (for IntelliJ).
- Run
In order to get things running locally, you'll need to run npm start ui
and npm start server
in the root of the project.
After sshing into the server, cd into either prod or test project. Then run respective deploy_{prod|sandbox}.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. -
This project uses a git hook that automatically formats code before comitting. The linting is done by
prettier
and is run bylint-staged
which only runs the linting on staged changes.husky
is what manages the git hook.
-
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- Note that test data is stored in
/server/server/database/test_data
- Note that test data is stored in
-
/ui
files for the REACT based frontend -
/test_cases
location of the comprehensive test case workflows which should be verified before deployment to ensure everything is working as expected. (seetest_cases\readme.md
)