Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vanhry/r.control

Lightweight R shiny app for managing R services (plumber/shiny) deployed with Caddy
https://github.com/vanhry/r.control

caddy golem plumber r shiny

Last synced: 6 days ago
JSON representation

Lightweight R shiny app for managing R services (plumber/shiny) deployed with Caddy

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

## R.control

[![R build status](https://github.com/vanhry/R.control/workflows/R-CMD-check/badge.svg)](https://github.com/vanhry/R.control/actions)

The goal of R.control is to control all of your R plumber (actually any http based) services in one place.

# Shiny app

#### Deployment of shiny app

Lightweight version of shiny application based on [R-minimal Docker image](https://github.com/r-hub/r-minimal) with simple and secure [Caddy server](https://github.com/caddyserver/caddy)

You just need to clone the repo, build the docker, install system variables `$HOST` and `$EMAIL`, and run:
```docker-compose up -d```

And that's it! `r emo::ji("contest")`

# Package

#### Installation of package

Development version

``` R
remotes::install_github("vanhry/R.control")
```

``` {r}
library(R.control)
```

If you want to use this library you must create `yaml` file of your plumber services

``` yaml
`r xfun::file_string(system.file("plumber_services.yaml",package="R.control"))`
```

Add to your `plumber.R` file **/healthcheck** method
```r
#' @get /healthcheck
function(res) {
res$status <- 200
res$body <- "Healthy"
res
}
```

You can use `create_table_plumber("path/to/file")` to receive the table of all services

```{r}
data <- create_table_plumber(system.file("plumber_services.yaml",package="R.control"))
data
```

Also it's possible to use shiny application with:
```r
R.control::run_app()
```
![Shiny app screen](inst/imageapp3.png)

If click on Details for shiny server, it will open the modal with each service

![Shiny apps](inst/imageapp2.png)

Build Docker
```shell
docker build . -t user/plumbercontrol_app -f Dockerfile
```

Project was created using [golem](https://github.com/ThinkR-open/golem) package