Skip to main content

How to Access Project / Set Up Locally

# Buckner University

Repository Link: https://github.com/BucknerHeavyLiftCranes/Buckneruniveristy

Need to contact Buckner in order to gain access to it.

## Running the App in Testing Mode

Our app utilizes an SSO with secrets. This cause two major issues when it comes to testing our code. 1: Any would-be user who is not part of the Buckner Microsoft organization will be unable to login. 2: We can’t publish the secrets and therefore any call to the SSO causes a 500 level error. Our solution to this was to create a branch with a button that circumvents the login and delivers some fake data to the front end for demonstration purposes.

1. Clone the repo locally

2. Install Docker and make sure it’s running

3. Open the app in vscode

4. Run `git switch final_testing` to switch to the testing branch

5. Run `cd frontend` to switch to frontend

6. Run `npm start` to start the app

## Running the Full Stack App

In order to run the app on your host machine you will need to take a few steps

1. Clone repo locally

2. Install Docker if not already installed and make sure it’s running

3. Make sure you an SSL Cert for https. If not see Generating Cert. Section

4. Open VSCode and run `Dev Containers: Reopen Container` in command pallet by pressing `Command + Shift + P`

5. Open a new terminal in VSCode and split it

6. In one terminal switch to the backend directory by running `cd backend`

7. In the other terminal switch to the frontend by running `cd frontend`

8. Run `npm install` in both terminals

9. Navigate back to the `/Buckneruniverity` directory

10. Run `npm install`

11. Run `npm start` this will start both the backend and frontend

12. Navigate to `https://localhost:3000/` for backend

13. Navigate to `https://localhost:5000/` for frontend

## Generating Certificate

Here are the directions for generating a certificate for https

1. Create a folder in `backend` called `credentials`: `mkdir credentials`

2. Move into new folder: `cd credentials`

3. Generate key file: `openssl genrsa -out key.pem`

4. Generate CSR file: `openssl req -new -key key.pem -out csr.pem`

5. Generate Certificate: `openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem`

OR

1. Navigate to `/Buckneruniversity` directory

2. Run `npm run generate-certificates`

3. This will automatically create the backend folder called credentials and generate the key file, CSR file, and Certificate for you

## Secrets

Secrets and tokens for APIs should NEVER be stored on Github. In order to run the app locally you will need to write secrets into .env file. This file can be created by running `touch .env` when in the `/backend` directory. The code base is set up to pull the secrets as environmental variables from this file. To get the secret values please contact the Buckner IT team.

## Frontend

### List of Libraries

| Libraries |

| ——– |

| React |

| ReactDOM |

| Material-ui |

## Backend

### List of Libraries

| Libraries |

| ——– |

| express.js |

| axios |

| cors |

| https |

| fs |

| querystring |

| jwt-decode |gi

## Documenation

### ITI api: https://documenter.getpostman.com/view/7332963/UVyoXJk7#81ccc687-6e24-4d52-bd09-9638284b82c2

### Microsoft OpenID: https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-auth-code-flow

### Salesforce integration: https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_client_credentials_flow.htm&type=5

### Salesforce api: https://www.postman.com/salesforce-developers/workspace/salesforce-developers/collection/12721794-67cb9baa-e0da-4986-957e-88d8734647e2

Notes

The setup guide is also included in GitHub readme

Technical Description

Buckner University is meant to be a standalone site. Buckner Heavylift is the primary owners and Buckner Employees are the users. Post project completion Buckner will assume responsibility to pull the code and put it on their company Github and connect it to their website hosting service.

  • Must login with a Buckner account using Microsoft SSO