The HABDash project was started as my Computer Science A-Level coursework. The goal is to provide a way to visualise telemetry and data recieved from weather balloons or any other payloads. The hope is to provide an alternative solution to the currently existing ones, that is simple, dynamic and scales well on mobile devices.
This project was developed on Ubuntu 20.04
sudo apt-get update
sudo apt-get install git
git clone [email protected]:Eugene-Levinson/HABDash.git
sudo apt-get install direnv
Add the folwing to your ~/.bashrc
eval "$(direnv hook bash)"
cd HABDash
sudo ./install_dep
npm install
sudo mysql_secure_installation
sudo mysql
CREATE USER '<username>'@'<host-to-be-accessed-from>' IDENTIFIED BY '<password>';
GRANT CREATE, ALTER, INSERT, UPDATE, DELETE, SELECT, REFERENCES on *.* TO '<username>'@'<host-to-be-accessed-from>' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit
sudo systemctl enable mysql.service
You have to aquire a SSL certificate for the server. You can aquire one for free from LetsEncrypt.org
Make sure to save the location of your certificate. The path to the certificate will need to be added to the secret manager later (Cloud setup step)
This project utilises several google cloud services. The following setup is required to host this platform.
- Make sure that you have created a GCP project.
- Enable Maps JavaScript API.
- Generate an auth token (not a service account!) and make sure that the JavaScript Map API is added as a service for the token.
- Enable Secret Manager API.
Make sure the following secrets are created:
- SSL_KEY - file path to the SSL Key file
- SSL_CERT - file path to the SSL Certificate file
- DB_HOST - database host
- DB_USER - database user
- DB_PASSWORD - database password
- DB_NAME - database name
- MAPS_KEY - javascript maps API token
Next few steps set up service account on the server. They should be completed only after Cloud Setup has been done
cd ~/HABDash
gcloud auth revoke --all
gcloud auth login
./config <gcp_project_name>
direnv allow .
node src/app/util/createdb.js
nohup sudo --preserve-env node src/app/app.js -m prod &
Optional paramters:
-m
=> mode dev
or prod
(default set in src/app/config/common.js)
-p
=> http port (default set prod and dev configs)
-s
=> https port (default set in prod and dev config)
-d
=> when set to true
disables https and runs the server in http only mode