marineenergy / api

Application programming interface (API) to expose records (FERC/USACE docs, MarineCadastre spatial, etc) to PRIMRE search engine
https://api.marineenergy.app
MIT License
0 stars 0 forks source link

Setup API to generate parameterized Rmd report #2

Closed bbest closed 3 years ago

bbest commented 3 years ago

See also mhk-env/mhk-env_shiny-apps#9

bbest commented 3 years ago
  1. run-api.R -> plumber.R which runs api.marineenergy.app

  2. plumber.R: /report forms the yaml configuration in /share/user_reports/ by user (e.g. /share/user_reports/ben@ecoquants.com/report_24488d53.yml) and kicks off a seperate system process to render the report with scripts/render_yml.R to generate the output document (e.g. /share/user_reports/ben@ecoquants.com/report_24488d53.pdf).

  3. Meanwhile the Shiny app polls for any changes within the user's reports folder via an API call in the apps:report-v2/server.R:

    poll_rpts_tbl <- reactivePoll(...)

    This updates the values$rpts which are reactive and feed into the get_rpts() which is also reactive and feeds into the final output$tbl_rpts displayed for the logged in user.