A Real-Time GitHub commit visualizer inspired by Gource, written in Svelte, vis.js and Ably.
Read about how it was built in my recent blog post
Deploying this application to a supported hosting provider gives you a real-time visualization of the commits to your GitHub organization or repository. It would be perfect for large screens, lobby displays, and places where it might be useful to see your efforts being visualised!
To use this application to visualize your own git commits, you will need to deploy the WebApp (including the bundled GitHub webhook) to a location where GitHub can call it. We suggest Netlify or Azure Static WebApps, which both allow you to deploy a static web application, along with hosting bundled serverless functions from the same repository. This repository is configured to seamlessly run on both Netlify and Azure out of the box without modification.
ABLY_API_KEY
to your deployed app.
b. Add the env variable GITHUB_WEBHOOK_SECRET
to your deployed app (containing a password you make up)https://your-deployed-app.com/api/github-hook
(the URL of your app will differ - but the API
location will always be the same - /api/github-hook
)
b. Set the SECRET
to the same password you configured in your applications environment variable.In order to run this app, you will need an Ably API key. If you are not already signed up, you can sign up now for a free Ably account. Once you have an Ably account:
This app uses Ably Channels and Token Authentication.
You'll need to configure settings on both GitHub and your Netlify/Azure to make this application work:
We've bundled a netlify.toml
file in the root of the repository, which will configure your build and deployment settings.
You will need to add two environment configuration settings using the netlify UI:
ABLY_API_KEY=your-ably-api-key
GITHUB_WEBHOOK_SECRET=a-secret-password-that-you-make-up
You can configure your secrets in netlify
by going to your app dashboard and visiting:
Site Overview > Site Settings > Build and Deploy > Environment > Environment Variables
Click on Edit Variables to add the values for ABLY_API_KEY
and GITHUB_WEBHOOK_SECRET
.
The rest of the Netlify build is configured via the netlify.toml
file included in this repository.
Use the Azure Portal to create a new Static Web Application, select custom, and use the following configuration values:
app_location: "/"
api_location: "api"
output_location: "dist"
You can either enter these in the Azure Portal UI, or you can directly edit the GitHub build .yml file that gets created in the .github
file afterwards if you missed this or made a mistake.
You can install GitHub WebHooks on either specific GitHub repositories or the entire organization. The configuration settings are the same regardless.
To configure for your entire organization (i.e. all repositories in the organization) do the following:
GITHUB_WEBHOOK_SECRET
environment variable.You can repeat these steps repository-by-repository if you prefer.
To run the app locally, once cloned, you will need to create an .env
file in root directory, to configure your ABLY_API_KEY
and GITHUB_WEBHOOK_SECRET
:
ABLY_API_KEY=your-ably-api-key
GITHUB_WEBHOOK_SECRET=a-secret-password-that-you-make-up
Next install the Netlify CLI, to run the serverless functions locally, then install the dependencies and run the start script:
npm install netlify-cli -g
npm install
npm run start
Once running, you can browse to http://localhost:8080
You can also run tests in the CLI:
npm run test
Note: You will need to restart the dev server if you modify your .env
file.
Because GitHub needs a public URL to send WebHook data to, you'll need to make the github-hook
API in this repository accessible to the internet to do local development.
You could:
ngrok
for local development - exposing http://localhost:7071
to the internet - and use the Azure Static Web Apps SDK.Note: The github-hook
code contains no logic (it just accepts, verifies and forwards the hook data to an ably
channel). You can rely on a deployed instance of this hook as long as your ably API key and channel names are consistent.