Phew! A journey (by examples) to get all the parts to come together to build a scalable template for multiple Dash apps deployed together with unified navigation and authentication

Image for post

Image by Alexas_Fotos from Pixabay

Full disclosure: I am not an expert in developing web applications. I don’t even consider myself a data scientist. Since I found Dash I have been on a journey to build a system that works for my use-case. This includes trying to glue together multiple loosely related groups of Dash apps developed using a windows computer but deployed to an Ubuntu VM behind a company’s firewall. Add in some authentication that users wont hate (i.e. something they already use) and I have arrived at something that I couldn’t find a clean example of so I thought I’d share my current solution and its evolution.

I am a structural analyst and I use Python daily to process test data, scale or combine analysis results, run optimizations or trade studies, and/or develop methods of analysis specific to a component or mechanism. Most other engineers do not use python. So once I have developed or coded up an existing analysis method, I usually want to deploy it to others in a controlled way, with a familiar and user-friendly interface…enter Plotly’s Dash framework!

Plotly’s Dash Framework

I am a huge fan of Plotly’s Dash framework. Making a Dash app is pretty simple if you are already familiar with python. Add in Dash Bootstrap Components and smooth, good-looking, and responsive web apps are just a few extra lines of code away. Going from existing Python scripts to web app is a matter of 1–2–3

  1. Creating the layout with components for user inputs (buttonsdropdownsnumber/text input, etc.) and regions with results (plotstables, etc.) using layout elements (div, row, column, etc.)
  2. Linking up the user inputs to the functions that actually do the work with callbacks
  3. Deploy the app or just run it on a host machine or VM accessible to your intended users

Image for post

Plotly’s Dash, image source: https://plotly.com/dash/

Dash apps look pretty, you can code them in Python (avoiding javascript and raw html), and can have a wide audience using the same ‘controlled’ tool (no passing around excel files thank you very much). Check out the Dash documentation if you aren’t familiar with it. There are a lot of other excellent tutorials on building Dash apps by people that are undoubtedly better than me so I’ll keep this section short. The Dash community forum and stack overflow are your friends.

Ok so now we have a sweet way to get a pretty tool out to the team. But I have lots of tools, some related, others not. If we could only group these apps together somehow…

#authentication #dash #flask #plotly

Embed Multiple Dash Apps in Flask with Microsoft Authenticatio
9.65 GEEK