modular shiny app

Hi Shiny devs!
I'm attempting to start a shiny app using modules.

I have some doubts that make my app not start or crash.

Basically I want a dummy menu with 3 widgets:

  • drop down menu with some country names
  • button to submit the country name input
    this button later on will be connected to create a word file with the name of the country.
  • button 2 or downloadbutton that will download the word doc created.

I have been reading all about shiny app modules and also I am aware of using moduleServer() for shiny versions 0.15 or above. I'm using 0.15.0.

I know so far I haven't implemented "commented out" the server side of each module.
It doesn't work anyway.

Any pointers on how to get going will be really appreciated.

btw:
In the following link I found a repo which uses two modules:

My question is:
the name of the R file module eg: UploadModule.R
is the same name as the function module server.
uploadModule <- function(input, output, session, ...) {
userFile <- reactive({ …. }) …. }

When calling the module in the app.R
source("uploadModule.R")
….
datafile <- callModule(uploadModule, "datafile")
….
This the bold uploadModule the actual server function from the module named the same?
and
Do we have to have same names?

As mentioned earlier

Any input is really appreciated! I'm sure it will help me to become a better shiny app dev.

Hope you have a great day.

Shiny Regards,

Elia

The shiny moduleServer is not meant to be used with callModule which was for the previous shiny modules framework.

I recommend the online book 'mastering shiny' which has a great chapter on shiny modules.

Fantastic thanks for the pointer! :slight_smile: