Skip to content

benjaminhlina/glatar-app

Repository files navigation

R-CMD-check Docker Build Status Deploy to DO Deployed App Status

Great Lakes Aquatic Tissue Analysis Repository (GLATAR) App

{glatar} is an R package that creates a {shiny} app that interfaces with the GLATAR PostgreSQL database to provide a seamless and rich interface.

The app can be accessed at glatar.org and provides the ability to upload (i.e., if you are a contributing member), map, view raw data (i.e., if you are a contributing member), view summarised data, view scatter plots of the raw data, search source material within the database, register as a contributing memeber, and search species within the database.

This project has used LLMs as a tool to assist in development, however, any code that has been generated by LLMs has been meticulously screened, edited, and redeveloped.

Installation and Running the App

The {glatar} package can be intsalled in R using the following:

pak::pak('benjaminhlina/glatar-app')

To run the app use the following:

library(glatar)
glatar_app()

To view the overall progress of the package please see news

Repository Structure

This repository contains a Shiny App built as a package (i.e, {glatar}) along with Dockerfiles, renv, shell scripts, nginx and shiny configuration files, and html.

The structure of the package is the following:

├── R
│   ├── app_glatar.R

contains glatar_app() which builds the ui, server and runs shiny::shinyApp(ui = ui, server = server).

The ui contains a list of tabs, panels, and sidebars to build given the corresponding module function. While server contains the appropriate server functions that map to a given ui (e.g., "view_summary" tab in ui with the same shiny namespace name being used in the server).

From there, there are fnct_*.R files and mod_*.R files.

mod_*.R files contain modules and modals that contain ui and server functions that are directly used in either the ui or server within glatar_app().

├── R
│   ├── mod_about_ui.R
│   ├── mod_document_ui.R
│   ├── mod_glatar_diagram.R
│   ├── mod_home_tab.R
│   ├── mod_how_to_use_ui.R
│   ├── mod_login_ui.R
│   ├── mod_raw_sidebar.R
│   ├── mod_register.R
│   ├── mod_scatter_sidebar.R
│   ├── mod_source_sidebar.R
│   ├── mod_summary_sidebar.R
│   ├── mod_taxa_search_ui.R
│   ├── mod_upload_data.R
│   ├── mod_view_data.R
│   ├── mod_view_map.R
│   ├── mod_view_scatter_plot.R
│   ├── mod_view_source.R
│   ├── mod_view_summer_info.R

Any fnct_*.R files contain functions that are to be used in a mod_*.R file. There are a total of 30 fcnt_*.R files with {glatar} having 161 functions in total.

├── R
│   ├── fnct_add.R
│   ├── fnct_app_version.R
│   ├── fnct_check.R
│   ├── fnct_clean.R
│   ├── fnct_clear.R
......

GitHub Actions and Server Deployment

The package and app are deployed using GitHub Actions (GHA). When a push to the main branch of the repository occurs the first two actions to be triggered are R CMD Check and pkgdown. R CMD check, checks if the package can be built while pkgdown deploys the R package to a pkgdown website.

Upon the R CMD Check completing, it triggers a GHA that builds a docker container that installs all of the package needed to support {glatar} using renv, it then installs a fresh version of {glatar} and copies the app.R file which contains the following:

library(glatar)
glatar_app()

This will allow the shiny-server to run properly and executes the shiny_entry.sh file. This file contains environmental variables and calls shiny-server. This docker container is registred on GitHub Container Registery (GHCR).

Once complete, another GHA is triggered which uses docker composer (i.e, docker-compose.yaml) to deploy the shiny app in its container, and an nginx and certbot containers on to a Digital Ocean's Droplet.

Lastly, once that GHA is complete, a GHA checks if the app returns a 200 status and if the logs run to confirm the app has been deployed properly.

Contribution and Issue Policy

If you would like to contribute please feel free to fork the repository, create a branch, implement your changes and submit a PR for review.

This repository will not be accepting LLM submitted PRs nor PRs that contain directly copy and pasted code from LLMs that has not be vetted and edited.

Issues that are submitted by LLMs and/or copied and pasted from LLMs will be deleted and ignored, as the issuer needs to have the ability to be able to write their own issues.

About

This is a Shiny-App that interfaces with a database to produce a rich interface to interact with proxcomp, energy density, and isotope data for fish and inverts in the Great Lakes

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages