How do you structure larger applications?

I’m running into an issue where I need to organize my application because of everything contained within. I originally wanted to go ahead with an MVC pattern, but having played around with it this just isn’t compatible with dash unless we rebuild a new app for every route (if you use a callback for routing, then you can’t compartmentalize your other callbacks since the code is running from inside a callback).

I can’t seem to break free from having to create everything and add all callbacks upfront, regardless of whether a user would even have access to something. Or create a different app for each route.

I surely must be missing something. What does everyone else do? Any help/inspiration would be great. Thanks!

Edit: currently looking into just using django with some dash integration.

1 Like

HI @dmill
Welcome to the community.

I’ve heard people use Dash with django, but I’m not sure how it worked out for them. Using mutlipage app won’t work for you in this case?

I’ve built out a multi-page app for our planning needs which is great. I have multiple backup pages and multiple main pages. A few things to keep in mind though, make sure that callbacks only reference outputs once. I get tripped up by that sometimes. For common components between pages I can get away with only having one callback with that component as an output.

2 Likes

I wrote a wrapper to support multi page apps GitHub - sjtrny/dash-multi: Framework for multi-page Dash apps. It’s used by a few people but probably the largest project that uses it is https://business-forecast-lab.com.

Otherwise Dash is adding better support for multi page apps. There’s a feature preview available 📣 Introducing Dash `/pages` - A Dash 2.x Feature Preview