README.md

musicBox

The goal of musicBox package is to provide the User with easy-to-run Shiny App. Demonstarting CRUD operations is the main goal of the app rather than front-end visability (not themes were applied). The App contains 2 tabs per one functionality each: add own values to Postgres "musicianbox-db" database connected to the App (reactive update of the changed table) and show relations between musicians and bands. Postgres database containes 3 tables 'musicians', 'bands' and 'events' and one view 'prepared_events'. The tables are connected with each other with their primary key (id column). Database main assumption: all tables have unique naming (there are no two musicians with the same full name).

Installation and Running

You can install the released version of musicBox from GitHub with:

remotes::install_github('aqlina/musicBox@master', dependencies = 'Imports')

Or you can use Docker for setting up containers with Postgres database and Shiny App for you. For doing so you have to: - download 'Docker_settings' folder - change directory to that folder location - build an image and run containers by writing 'docker-compose up' in the command prompt/Docker - wait till environment will be set up - go to your browser 'http://0.0.0.0:9999' - enjoy the App :)

Example

This is a basic example:

{r example} library(musicBox) musicBox::launch_app() Please notice, launch_app() uses specified host and ports values. What's more, you need to set up Postgres database and pass environmental variables (DB_HOST, DB_PORT, DB_DATABSE, etc) by your own if you want to launch the app inside an R. The better and much easier way is to use Docker (see instructions above).

Justifying used technologies

  1. R/Shiny: they are both very powerful tools for creating applications, especially, the App using statistics or analytics behind.
  2. Docker: sets up environment required to the App smooth work easily; it creates isolated container (environment) for the App, therefore, makes the App "compatible" with all other operating systems and no conflicts are possible.
  3. Git: allows to control any change in the code; prevents a developer from loosing the code, even if the local machine crashes; makes the work on the code with the team members much easier; allows to have a working/production version of the App permanently and continue working on new functionalities.
  4. Postgres DB: Database is the best way to store the data: it controls the uniqueness of records; prevents form deleting tables which are connected to other; prevents from adding data of wrong type; speed up extraction of the data, therefore, the processing the data.
  5. tidyr, dplyr: the most handy way of preparing the data (combining string naming within usual naming); helps with better readability of the R code.
  6. stringr, stringi: very useful and intuitive libraries for working with string in R.
  7. devtools: this is the best way of creating package because it builds all the files needed, controls test checks, controls imported libraries, controls documentation completeness with the human-friendly communicates.
  8. roxygen2: helps to create very nice documentation with all necessary sections, translates R codes to .md format, so a developer doesn't need to switch R with other format.
  9. package: package is the best way for sharing the codes and documentation, therefore, make the maintenance of the codes much easier. Even, if you share it with the future you :)
  10. testhat: great and intuitve tool for writing automated tests for the package or an App and it is fully compatible with devtools.
  11. Visual Code Studio: convinient tool for using R and git simultaneously; makes it easy to see the changes made and to commit.

The sky is a limit

Some of the future App development options:



aqlina/musicBox documentation built on Jan. 20, 2024, 2:29 a.m.