Giter Site home page Giter Site logo

habdash's Introduction

HABDash

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.


Server setup and deployment

This project was developed on Ubuntu 20.04


Server Setup

sudo apt-get update

Install git

sudo apt-get install git 

Clone the repository

git clone [email protected]:Eugene-Levinson/HABDash.git

Set up direnv

sudo apt-get install direnv

Add the folwing to your ~/.bashrc

eval "$(direnv hook bash)"

Set up project directory

cd HABDash

Install dependencies

sudo ./install_dep
npm install

Database setup

Secure DB installation

sudo mysql_secure_installation

Login to DB with root user

sudo mysql

Create a user to access the DB

CREATE USER '<username>'@'<host-to-be-accessed-from>' IDENTIFIED BY '<password>';

Grant privileges to the user

GRANT CREATE, ALTER, INSERT, UPDATE, DELETE, SELECT, REFERENCES on *.* TO '<username>'@'<host-to-be-accessed-from>' WITH GRANT OPTION;

Flush privileges and exit

FLUSH PRIVILEGES;
exit

Enable mysql server on startup

sudo systemctl enable mysql.service

SSL Certificate Setup

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)


Cloud Setup

This project utilises several google cloud services. The following setup is required to host this platform.

  1. Make sure that you have created a GCP project.
  2. Enable Maps JavaScript API.
  3. Generate an auth token (not a service account!) and make sure that the JavaScript Map API is added as a service for the token.
  4. 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

Setup GCS in the project directory

Next few steps set up service account on the server. They should be completed only after Cloud Setup has been done

Go into the project directory

cd ~/HABDash

Make sure no old service account are enabled

gcloud auth revoke --all

Auth into glcoud

gcloud auth login

Set up gcp service account

./config <gcp_project_name>

Allow direnv

direnv allow .

Create HABDash main DB and all required tables

node src/app/util/createdb.js

Start the server

Typical run command

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

habdash's People

Contributors

eugene-levinson avatar

Stargazers

 avatar Jacob Halogen avatar

habdash's Issues

There is no handling for `null` or `none` in the data

Currently, there is no handling of null and none in the data points. None and none should represent invalid or no data and should be handled accordingly. This needs to be supported on the backend and front end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.