Skip to content

mfarhansohail/ShinyBuilder

 
 

Repository files navigation

ShinyBuilder

Build Status

ShinyBuilder is a point-and-click dashboard platform based on R/Shiny which makes it simple to create and share live, connected dashboards. To try it out, please see the ShinyBuilder live demo.

ShinyBuilder was created with the following goals:

  • Easy Access - Can be accessed from any web browser
  • Easy Authoring - Dashboards are created via a point-and-click GUI, enabling anyone with basic SQL skills to set up a professional dashboard in a matter of minutes.
  • Instantly Connected - ShinyBuilder charts begin as SQL queries, and are immediately linked to a live database. Once created, the charts are refreshed daily & automatically, eliminating need to build ETL workflows.
  • Extensible & Modular - all major JavaScript libraries used in the project have been wrapped into resusable R/Shiny packages, making it easy to extend ShinyBuilder or to use ShinyBuilder components in your own projects.

ShinyBuilder components include:

Install

To install ShinyBuilder, download and install R. Then from the R console, run:

if (!require("devtools"))
  install.packages("devtools")
devtools::install_github("mul118/shinyMCE")
devtools::install_github("mul118/shinyGridster")
devtools::install_github("iheartradio/ShinyBuilder")

If all goes well, you should now be able to run ShinyBuilder locally by typing:

ShinyBuilder::runShinyBuilder()

Note: ShinyBuilder was developed and tested for the Mac and Linux platforms. While runShinyBuilder should work on Windows, some admin features may not work properly.

Shiny Server

You can deploy ShinyBuilder to Shiny Server by installing the package on the server, then running the deployShinyBuilder function:

deployShinyBuilder(dir = '/srv/shiny-server/ShinyBuilder')

Please note that by default, ShinyBuilder is set to auto-update all dashboards by registering and periodically running a cron script. You can enable or disable by setting the update argument to TRUE or FALSE, respectively. You can also specify the update schedule via the times argument, which takes the crontab format (i.e., minute (0-59), hour (0-23), day of month (1-31), month (1-12), day of week (0-6, Sun = 6)). For example, to update all ShinyBuilder dashboards at 12:00 AM every day, run

deployShinyBuilder(dir = '/srv/shiny-server/ShinyBuilder', update = TRUE, times = c(0, 0, "*", "*", "*"))

Databases

You can connect ShinyBuilder to your databases using the included dbList functions. For example to add a SQL Server database, download an appropriate JDBC driver to the drv directory of the installed ShinyBuilder package, install RJDBC, then run the following code:

mssql_db <- quote({
  require(RJDBC)
  sb_drv_dir <- paste0(system.file(package = 'ShinyBuilder'), '/drv')
  dbConnect(
    drv       = JDBC('com.microsoft.sqlserver.jdbc.SQLServerDriver', sb_drv_dir), 
    url       = 'jdbc:sqlserver://server_address', 
    user      = 'user', 
    password  = 'pwd')})
    
mssql_default_query <- "SELECT month, earnings, costs \nFROM monthly_reports_table"

dbListAdd(db_name = 'MSSQL', db = mssql_db, query_fn = RJDBC::dbGetQuery, default_query = mssql_default_query)

Use

Please see the Sample Dashboard for a mini-tutorial to get you started. If you have any questions, comments, concerns, etc., please feel free to consult the ShinyBuilder mailing list.

Customize

You can customize the look and functinality of ShinyBuilder to suit your needs. The code can be found in the inst folder, and follows standard Shiny app formatting (i.e., ui.R, server.R, and global.R files). If you write an improvement, feel free to submit it as a pull request, and we'll review/merge it into the main app.

About

Visual dashboard builder platform based on R/Shiny

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 50.8%
  • R 45.8%
  • CSS 3.4%