Survey banner
The Dataiku Community is moving to a new home! Some short term disruption starting next week: LEARN MORE

App Files in Shiny Web App

vishalsharma
Level 1
App Files in Shiny Web App

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

0 Kudos
2 Replies
MichaelG
Community Manager
Community Manager

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

I hope I helped! Do you Know that if I was Useful to you or Did something Outstanding you can Show your appreciation by giving me a KUDOS?

Looking for more resources to help you use DSS effectively and upskill your knowledge? Check out these great resources: Dataiku Academy | Documentation | Knowledge Base

A reply answered your question? Mark as ‘Accepted Solution’ to help others like you!
0 Kudos
vishalsharma
Level 1
Author

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

0 Kudos