Skip to the content.

Create and deploy a web app based on your model

A free GitHub account is required to access the program code in this repository; send us your GitHub username.

Creating a web app extends access to your model across your organization, to colleagues who may not be Scale-up Suite users (yet) and to users on devices such as phones and tablets.

In this illustration we use a technology called Streamlit to create the front-end and run Dynochem and Reaction Lab models using Python code. Using Streamlit and the example files Dynochem(.py) or Reactionlab(.py) together, no front-end development in Javascript, HTML or CSS are needed; the standard user interface is generated automatically from the scenarios tab in your model. For simple deployments, Streamlit also bypasses the need for web server software (like Apache or IIS).

A free GitHub account is required to access the program code in this repository; send us your username to access Dynochem.py and Reactionlab.py. By design, users can deploy any model in a standard manner without writing or changing a single line of this code or any part of their working DC model. For simple deployments, no special server software is needed.

RunScript Automation is required to run the code in this repository. This product is available with Scale-up Suite 2, which includes Dynochem 6 and Reaction Lab 2. Contact your Scale-up Systems representative if you would like to obtain licenses for this new product, which are currently part of our Digitalization Pilot Program. See this KB article for basic details on Dynochem automation and this one for information specific to RunScript Automation.

How to use the code and deploy any model as a web app [allow 5 minutes]

That’s it. You’re done.

See a live version

A live web app for a simple model and demo purposes is often running here.

How to start the web app service using a script

You can use a DOS batch file to run the streamlit command, instead of opening a DOS window, e.g.

cd C:\Users\<userid>\Automation\Model1\
streamlit run Dynochem.py --server.port 8506

where the path in the first line points to the folder containing the Dynochem.py file and the Dynochem model you want to use.

You can also run a series of the above batch files in another batch file. Streamlit may also be run from Powershell and in Powershell scripts instead of batch files.

Setting up the server to run the web app [one time only; IT task]

You can deploy a web app locally for access by your colleagues and using your own computer as the ‘server’. This is easy and quick but not suitable for a permanent stable deployment supporting many users. This section describes deploying to a server and is oriented towards people with IT skills and is a one time only set-up, in case you do not already have a suitable server machine on which to run the simulations. You need a computer with the same basic software and hardware requirements as any Scale-up Suite install. It is common to use a Windows server machine (e.g. Windows server 2012 or later). It is also common for that to be a ‘cloud’ machine, provided by Amazon (AWS) or Microsoft (Azure). If you are reading this, you probably have many of those already.

The app will now work locally. Some additional network security settings may be required to ensure that the necessary ports on the server machine are open for users of the web app, see example settings below.

To test your installation locally:

Note that Streamlit does not support Internet Explorer (IE) 11 or earlier versions so if you are running this on Windows Server 2012R2 or later, you will need to download an alternative browser such as Chrome.

To deploy securely behind IIS, please see instructions here.

Originally Developed and Tested on

The python code was developed and tested on this set-up:

The deployment procedure has been tested on the following systems:

Restrictions

Known Issues

Third party References and Resources