https://github.com/jumpingrivers/flu.dashboard
https://github.com/jumpingrivers/flu.dashboard
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/jumpingrivers/flu.dashboard
- Owner: jumpingrivers
- License: gpl-3.0
- Created: 2025-06-16T10:52:05.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2026-03-26T13:05:10.000Z (3 months ago)
- Last Synced: 2026-03-27T04:27:09.834Z (3 months ago)
- Language: R
- Size: 832 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Flu Dashboard
The {flu.dashboard} R package contains:
- A Shiny application for viewing the information provided in the application.
For information about the content and purpose of the application, read the file at [_inst/about/about_main.md_](inst/about/about_main.md).
A version of this app is deployed to [gallery-flu.jmpr.io](https://gallery-flu.jmpr.io/).
You can also view some of the other apps, dashboards and widgets from Jumping Rivers in our [gallery](https://www.jumpingrivers.com/data-science/gallery/).
## Environment variables
The app stores data using pins.
The current pin location used in the code is for a Posit Connect server.
If this is where your pins will be stored, you'll need to [create an API key](https://docs.posit.co/connect/user/api-keys/#api-keys-creating), or know what your existing one is.
Then you'll need to add these details to an _.Renviron_ file, which contains the following details:
```
CONNECT_SERVER=https://your.connect.server
CONNECT_API_KEY=AbCdE123456f
```
Replacing the placeholders with the value for your server address and API key.
You should not upload the .Renviron file as part of your bundle when deploying the application.
If the dashboard and the pre-processed data pins are deployed to the same Posit Connect server by the same user, these environment variables do not need to be configured for the application.
Posit Connect will handle the authentication automatically.
## Pins username
The file at *inst/data-processing/config.yml* is used to set the filename where pins are stored and the Posit Connect username that hosts the pin.
In order to load pins from the correct account name, you need to set your Posit Connect username in the `pins_username` variable.
The default setting is
```yaml
default:
pins_username: !expr Sys.getenv("PINS_USERNAME", unset = "your_username")
```
This allows you to define your username either as (in order of priority):
- An environment variable called `PINS_USERNAME`
- By replacing the `your_username` placeholder in the *inst/data-processing/config.yml* file.
## For application users
To install the application, use:
```r
remotes::install_github("jumpingrivers/flu.dashboard")
```
With any necessary [environment variables](#environment-variables) set to connect to the data sources through {pins}, you can start the Shiny application using:
```r
flu.dashboard::run()
```
## For application developers
### Restoring {renv}
If you are forking the repository to develop, note this uses {renv} to manage R package dependencies.
To install the R packages from the {renv} lockfile, run `renv::restore()` or read [documentation from the {renv} website](https://rstudio.github.io/renv/#workflow).
### Running the application
From the root directory of the repository, you can start the application in the normal way for a Shiny application.
```r
shiny::runApp()
```
### Deploying the application
1. If you have introduced or updated packages for the application, update the {renv} lockfile
```r
renv::snapshot(dev = TRUE)
```
1. If performing a git-backed deployment from Posit Connect, update the _manifest.json_ file:
```r
rsconnect::write_manifest()
```
1. Deploy to your hosting service from the *app.R* file at the root of the repository, or allow Posit Connect's git-backed deployment to perform the deployment and automatically check for updates to the manifest.json file by pushing changes to the git repository.
## Authors and acknowledgment
This has been created by the Data Science team at Jumping Rivers.
You can get in touch with us at [hello@jumpingrivers.com](mailto:hello@jumpingrivers.com).
We'd like to thank Andy McCann and the DS Team within NUCT at NHS ML who created the original inspiration inspiration for this app with their ['flu-tracker Shiny application](https://nhsml-nuct.shinyapps.io/NationalFlu/) ([source code](https://github.com/MLCSU/NationalFlu)).
## License
This R package has a [GNU GPL v3 license](LICENSE.md).