The velocity 9 website of the future, today! This repo holds the web application that powers Velocity 9! It allows developers to control the status of their serverless components, and see various stats about how they are running.
To set up the web application, there are two requirements, the Node configuration and the URL management.
Install the following from your system's package manager:
node
, version 13 or 14yarn
Run in the root repo directory to install all of the NPM packages:
yarn install
That's it! You've set up the Node side of things.
By URL management, we mean configuring access to the web app. The Velocity 9 Github app requires a callback URL that points at the site, which can make it difficult to use when testing. Once the application has been deployed to an actual server it's easy, as you just have it point to the deployed URL. To get around this problem while developing, however, we suggest using Ngrok. Ngrok allows for tunnels to your localhost servers, meaning that you can access a server running locally on your computer from anywhere in the world.
Example setup:
ngrok http 3000 --subdomain v9_website
this command launches Ngrok and tunnels HTTP port 3000 (the default React port).
Important Note: This specific command will NOT work without a paid version of Ngrok. The cheapest paid version allows you to have persistent links, so you do not have to constantly update the Github callback URL.
This project uses a .env
file to manage environment variables that do not belong in version control.
This includes things like deployment-specific values like database URLs, as well as more private variables like a Github secret.
It is imperative that the .env file never be comitted into version control, otherwise you will have to change all of the values it stores.
You can simply rename or move the EXAMPLE.env
to be called .env
SESSION_SECRET=11111
Secret used for encrypting each browser sessionGITHUB_KEY=thisissecret
Github app key for Velocity 9GITHUB_SECRET=thisissecret
Github app secret for Velocity 9HOST=http://v9_website.ngrok.io
Host URL to access the web interfacePOSTGRES_HOST=111.222.333.444
Host running the V9 database(link)POSTGRES_PORT=1234
Port to access the V9 databasePOSTGRES_DB=
Name of the database storing V9 infoPOSTGRES_USERNAME=
Username for PostgresPOSTGRES_PASSWORD=
Password for PostgresCOOKIE_SECRET=cookiesnomnomnom
Secret to encrypt cookiesNODE_CONFIG_DIR=./config
Not currently used, but points to config directoryNODE_PATH=src/
Where Node should look for source code (don't change this)
The V9 web app is written entirely in Javascript ES6, and uses React for the front-end and Node in the back-end. In addition, it uses Flow to enforce static typing. Authentication is handled through OAuth via Github, as Velocity 9 pulls all code from Github anyways. When writing JS code, make sure ESLint has no complaints when submitting a PR! This project uses CircleCI to automatically test code.