Skip to content

RIT-Software-Engineering/RIT-SE-Senior-Project

Repository files navigation

Website

Environment URL
Production https://seniorproject.se.rit.edu
Test https://seniorproject-sandbox.se.rit.edu

Server Setup

Add new developer to production server

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

Setup SSH

  1. Create SSH keys (There are plenty of tutorials online to do this)
  2. Create ssh folder: mkdir /home/USERNAME/.ssh
  3. Add your public key to /home/USERNAME/.ssh/authorized_keys (create file if does not exist)
  4. Restart ssh daemon: sudo systemctl restart sshd
  5. Add user to pm2 group: usermod -aG pm2 USERNAME
  6. Paste alias pm2='env HOME=/home/website/RIT-SE-Senior-Project/server pm2' into the bottom of ~/.bashrc

Install/Develop locally

  • Using Dev Container

    • 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 and devcontainer.json)
    • VSCode will also automatically configure the development environment, including setting up the necessary extensions and settings.
  • Using Local Setup

    • Run install.ps1 (recommended) or install.bat (legacy) or install.sh (on linux) to get dependencies set up locally
      • install.ps1 supports performing a clean installation by using the -CleanInstall flag. Use this if you encounter a npm 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 locally

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.

Deploying to production

After sshing into the server, cd into either prod or test project. Then run respective deploy_{prod|sandbox}.sh script

Technical Information

  • 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 using pm2 kill to stop the pm2 process and pm2 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 by lint-staged which only runs the linting on staged changes. husky is what manages the git hook.

Project File Structure Info

  • 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
  • /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. (see test_cases\readme.md)

Backend Documentation

Swagger Link

About

The Senior Project Website for RIT SE hosted at senior project.se.rit.edu

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 28

Languages