Skip to content

bcgov/aqwarnings_shiny

Apache 2.0 License Creative Commons BY 4.0 License Lifecycle:Maturing

aqwarnings_shiny

An interactive app to issue or end Air Quality Warnings built using RStudio's Shiny open source R package.

Usage

Only to be used by ENV Air Quality Meteorologists contact the team for usage.

Development

Technologies used

R Packages

bcmaps
fs
here
htmlwidgets
knitr
leaflet
leaflet.esri  # note: this package has been removed from the CRAN repo and is unmaintained
mapview
sf
shiny
shinydashboard
shinyjs
tidyverse # mostly using dplyr, tidyr, readr, lubridate
quarto
webshot
zip

Getting Started

Here is high-level documentation on the development of applications, use of GitHub, and Openshift in the Government of BC:

Running the application in local development environment

Instructions are geared toward the following tools:

  1. Ensure R, RStudio, and Quarto are installed on the machine
  2. Clone this repository using GitHub Desktop
  3. Open project in RStudio
  4. Install required packages Run source("src/run_app_locally/install_packages.r") in the console or select "Run" from RStudio's Source Pane
  5. Make and required changes
  6. Run the app locally to review Run shiny::runApp() or select "Run App" from RStudio's Source Pane

Deploying

To deploy to TEST and PROD you require a shinyapps.io account.

  1. Install rsconnect.

    • Before deploying for the first time, you need to ensure you have the rsconnect R package from CRAN installed. Run the following command in your R console to check: library(rsconnect)
    • If you get an Error that says “there is no package called ‘rsconnect’, try to install it the usual way: install.packages(rsconnect)
  2. Configure rsconnect with your shinyapps.io token. Follow the shinyapps.io instructions to copy your token from the account page and configure it in the R console: rsconnect::setAccountInfo(name="<ACCOUNT>", token="<TOKEN>", secret="<SECRET>")

  3. Publish the app.

    • Run deployApp() or select "Publish" from RStudio's Source Pane with either the ui.R or server.R file open.
    • Fill in all the required details in the dialog box, noting them for future reference:
      • On the left side, choose which files to publish (or not publish)
      • On the right side, ensure you have the correct account selected
      • Enter a name that is at least 4 alphanumeric characters (no spaces). the name will be part of the URL to access your app, for example: https://<ACCOUNT>.shinyapps.io/<APPNAME>
    • For PROD the app name is aqwarnings_shiny, we publish new apps for major test versions following the convention aqwarnings_shiny_test_<date>.
  4. Set up athentication for the app. (Note: you only have to do this when publishing a new app)

    • Go to the shinyapps.io dashboard.
    • Navigate to the administrative interface, select the application to modify, and click on the Users tab. - Follow the instructions to change the Application Visibility setting to "Private" and restart the app.

Getting Help or Reporting an Issue

To report bugs/issues/feature requests, please file an issue.

How to Contribute

If you would like to contribute, please see our CONTRIBUTING guidelines.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

License

Copyright 2025 Province of British Columbia

Code is licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Documentation including the content of air quality warnings and bulletins by the Province of British Columbia is licensed under a Creative Commons Attribution 4.0 International License: https://creativecommons.org/licenses/by/4.0/.

Third party intellectual property material

This repository contains information in the /data/raw/shapefiles folder adapted from Meteorological Service of Canada (MSC) Forecast Regions Polygons, which is information licenced under the Data Server End-use Licence of Environment and Climate Change Canada.


This project was created using the bcgovr package.

About

Private shiny app for Air Quality Warnings.

Topics

Resources

License

Apache-2.0, CC-BY-4.0 licenses found

Licenses found

Apache-2.0
LICENSE
CC-BY-4.0
LICENSE-docs

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors 6