EECA-NZ / eeud-dashboard

Energy End-Use Database dashboard built with Quarto and Shiny for Python
MIT License
1 stars 0 forks source link

CI/CD

Energy End-Use Database Dashboard

This is a dashboard for EECA's Energy End-Use Database, built with Quarto and Shiny for Python. Quarto provides the dashboard's document structure and layout, and Shiny provides the dashboard's interactivity. This dashboard is deployed as an interactive application to EECA's shinyapps.io space.

Live Production Dashboard Live Development Dashboard

How to install and run the dashboard locally

There are two things you will need to run the dashboard: Quarto and Python. This readme will assume the latter is already installed through Anaconda.

Install the Quarto CLI tool from the Quarto website: https://quarto.org/docs/download/. This dashboard requires only v1.4.x, the first Quarto release to include dashboard functionality. At the time of writing, v1.4.x is no longer in pre-release.

At the time of writing, shinyapps.io only supports python 3.7.13, 3.8.13, 3.9.13. If an application is deployed using another version of python, shinyapps.io will attempt to run it on the closest major/minor version of python. For this reason, a Python 3.9.x virtual environment is used in the development of this dashboard.

How to deploy the dashboard

Deployment to shinyapps.io is done via Github actions.

Dev: deployment occurs on any push to main branch.

Prod: deployment occurs on any release tag that matches the pattern v*.*.*.

Updating deployment secrets

A user with access to EECA's shinyapps.io portal and the settings for this repo can update the Github secrets as needed.

See the instructions on this Posit docs page to get rsconnect token information.

Creating a new app

Easiest way to is to build and then deploy manually

rsconnect deploy shiny . -n "ACCOUNT NAME HERE" -t "APPLICATION NAME HERE" -N

Potential deployment issues

In the testing of deployment of this dashboard, a number of difficulties were encountered that may also be encountered by others attempting to run this dashboard.

Additional documentation