App Files in Shiny Web App

vishalsharma
vishalsharma Registered Posts: 3

Hello team,

I am creating a shiny web app in Dataiku. The application I am trying to create is a modular application which includes several files and folders in the web app. The structure of my app would like like as follows:

ui.R
server.R
global.R
modules/
module1.R
module2.R
www/
logo.png
styles.css
myproject.js
python_scripts/
script1.py
script2.py
script3.py

Now inside my ui.R and server.R, I am planning to call the module1 and module2. Inside my global.R, I am planning to import the files from python_scripts and www folder. How can I achieve this in dataiku shiny web app?

Regards,
Vishal


Operating system used: Windows 10 Enterprise

Answers

  • Michael Grayson
    Michael Grayson Administrator, Dataiker, Alpha Tester, Dataiku DSS Core Designer, Community Team Posts: 298 Administrator

    Hi @vishalsharma
    sorry this was automatically filtered as spam. Appreciate you pointing that error out.

    Reposting here @Mattsco
    's response from your reporting the error to us so it's out in public!


    @Mattsco
    :

    Hello,

    If you have multiple files in your webapp, I would suggest to use code libraries.
    Keep the UI.R and Server.R in the webapp, move the rest in your project lib.

    You can read this page of the doc for more info:
    https://doc.dataiku.com/dss/latest/python/reusing-code.html

    Matt

  • vishalsharma
    vishalsharma Registered Posts: 3
    edited July 17

    Hi Michael,

    Thank you for your response. When I do dkuSourceLibR("global.R"), it works fine from project library but when I do includeHTML("www/google-analytics.html") or tags$link(href = "www/styles.css", rel = "stylesheet", type = "text/css"), the files are not found.

    Warning in file(con, "r") :
    cannot open file 'www/google-analytics.html': No such file or directory
    Warning: Error in file: cannot open the connection
    75: file
    74: readLines
    73: includeHTML
    1: shiny::runApp

    Regards,

    Vishal

Setup Info
    Tags
      Help me…