A modern map for a modern campus.
UW Map is a webapp that allows students to find their way around the University of Waterloo campus while avoiding all the traffic.
Deployment server is running Debian 12 (Bookworm).
$ pwd
~/uwmapSet up DNS:
uwmap.live. 300 IN A {ip}
api.uwmap.live. 300 IN CNAME uwmap.live.
Get packages:
apt update -y && apt upgrade -y
apt install -y nginx python3 python3-pip nodejs npm certbotUpgrade node, npm, and set up PM2:
npm install -g n
n latest
npm install -g npm@latest
npm install -g pm2
pm2 startupGet dependencies:
python3 -m pip install -r backend_api/requirements.txt
npm install --prefix ./main-appGet SSL certificates:
systemctl stop nginx
certbot certonly
systemctl start nginxSet up reverse proxies:
cp {nginx-fastapi.conf,nginx-t3.conf} /etc/nginx/sites-available
ln -s /etc/nginx/sites-available/{nginx-fastapi.conf,nginx-t3.conf} /etc/nginx/sites-enabled/
systemctl restart nginxGenerate secrets:
echo "- `openssl rand -hex 20`" | tee -a backend_api/keys.yamlRun backend_api:
pushd backend_api
pm2 start "TEST_ENV=0 uvicorn api:app" --name backend_api
popdRun frontend:
pushd main-app
npm run build
pm2 start npm --name "frontend" -- start
popdEnable automatic startup after reboot:
pm2 saveView backend at api. and frontend at @..
ArduinoIDE is used to deploy firmware (./uwmap.ino) to the ESP32s.
To deploy, connect the ESP32 to the computer and set the partition scheme: Tools > Partition Scheme > Huge APP.
Modify the line containing the "url" string so that device_id=x refers to a desired ESP32 id.
If connected via usb, it is necessary to put the ESP32 into download mode by holding the Boot and Reset buttons simultaneously.
Select the correct board and port, then run Upload.
Documentation for the backend API is live at api./docs.