-
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-compose
is installed:> docker-compose version Docker Compose version v2.17.3
-
make sure
npm
andnode
are installed:> node -v v20.3.0 > npm -v 8.19.2
-
run
npm install
on the/backend
and/frontend
directories> pwd /repos/hacklab-booking # repo root directory > cd backend > npm install > cd ../frontend > npm install
-
load
docker-compose.dev.yml
into 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_mail
is your email, andhttp_cn
is currently unused:utorid http_mail http_cn
-
connect to PostgreSQL by connecting to
jdbc:postgresql://localhost:5432/postgres
with the credentialspostgres:example
.- under the
User
table, modify your account to have theadmin
role.
- 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
example
to access theUser
table. - Find your
utorid
and change the role fromstudent
toadmin
. - After refreshing your Hacklab Booking System browser window, you will see an
administrator
button.
- 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.