-
Notifications
You must be signed in to change notification settings - Fork 3
Deployment and Configuration
As of now, the project is hosted on a VM provided by UTM. There is an Apache instance listening on ports 80 and 443 and reverse proxies to port 3555.
Our app is self-contained and has its own nginx reverse proxy to have all requests to /api directed to the backend container and all other requests to the frontend container.
GitHub Actions CI is configured to auto-deploy the main branch to the UTM production VM.
The frontend was bootstrapped with create-react-app and is served by serve. The backend is a nodejs app.
There are certain environmental variables that the backend expects. These environment variables may be placed in an .env file in the backend folder, and must never be pushed to the Git history.
| Backend enviroment variable name | Purpose |
|---|---|
EMAIL_USER |
The username used by node_mailer to send emails |
EMAIL_PASSWORD |
The password used by node_mailer to send emails. Note that an app password may be required for this field. |
FRONTEND_URL |
The base URL of the frontend deployment, e.g., https://hacklabbooking.utm.utoronto.ca
|
To deploy, get the latest code, and run docker compose up -d --build. This will start up our application on port 3555. A different port would require modifying the compose file.
-
make sure
docker-composeis installed:> docker-compose version Docker Compose version v2.17.3 -
make sure
npmandnodeare installed:> node -v v20.3.0 > npm -v 8.19.2
-
run
npm installon the/backendand/frontenddirectories> pwd /repos/hacklab-booking # repo root directory > cd backend > npm install > cd ../frontend > npm install
-
load
docker-compose.dev.ymlinto docker> docker compose -f docker-compose.dev.yml up -d -
once successfully deployed, connect to the frontend by injecting the following request headers to
localhost:3555.http_mailis your email, andhttp_cnis currently unused:utorid http_mail http_cn -
connect to PostgreSQL by connecting to
jdbc:postgresql://localhost:5432/postgreswith the credentialspostgres:example.- under the
Usertable, modify your account to have theadminrole.
- under the
After installing and deploying Hacklab Booking, there are additional steps that must be completed first before it can be used.
To create an admin account, start by logging in as a regular user. Your account will be created with a student role. To modify this role without other administrators, you will have to directly modify the PostgreSQL database.
- Connect to the database by using
jdbc:postgresql://<deployment url>:5432/postgres - Use the password
exampleto access theUsertable. - Find your
utoridand change the role fromstudenttoadmin. - After refreshing your Hacklab Booking System browser window, you will see an
administratorbutton.
- Access the Admin dashboard, which can be accessed by clicking the "Admin" button on the dashboard
- Access the Room manager by clicking "Manage rooms" then click "Create room" and fill in the details
- Click "Add"
- In the "Control access" page, select at least one approver who can approve requests for that room
- The room is now ready to accept booking requests
Joan6 is a webpage meant to be displayed on a tablet in front of a room. Navigate to
https://hacklabbooking.utm.utoronto.ca/joan/<ROOM> to see the joan6 view.
The Joan naming scheme is kept for historical reasons.