Skip to main content

Self hosting on localhost

This tutorial will guide you on how to download your apps and run it locally on your own computer at this url: http://localhost:3000.


This is an advanced tutorial and prior experience using the terminal is expected

Downloading the code

  1. Go to and download the source code. You can either:
  • Click on Code > Download ZIP on the Github site, and then extract the ZIP file. img alt
  • OR
  • Execute the git clone command in your terminal (if you have git installed).
git clone

Setting up the back-end server

  1. Download Python if you do not have it installed already.
    • This tutorial has been tested on Python 3.8.
  2. Open your terminal, and cd into the back-end folder.
cd MecSimCalc-self-hosted/back-end/
  1. Install all the Python libraries in requirements.txt using pip install:
pip install -r requirements.txt
  1. Start the server:

If python does not work, try python3

  1. You should see the following printed to your terminal:
* Serving Flask app 'server' (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Running on (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 742-486-046

Setting up the front-end client

  1. Download NodeJS if you do not have it installed already.
    • This tutorial has been tested on Node 16.7.
  2. Keep the Python server process running from before and open another terminal.
  3. cd into the front-end folder:
cd MecSimCalc-self-hosted/front-end/
  1. Install all the npm packages in package.json:
npm install
  1. Start the front end server:
npm run build
npm run start

The following should be printed to your terminal:

ready - started server on, url: http://localhost:3000
info - Loaded env from \MecSimCalc-self-hosted\front-end\.env
  1. Go to http://localhost:3000 to check the website is working.

Adding your apps

  1. Go to and download your apps by clicking the Download button.


  1. Copy the downloaded .json files into the MecSimCalc-self-hosted/apps folder.

  2. Refresh http://localhost:3000 and voilà, your apps should now show up.

Starting the application

After the initial installation of the application, you do not need to re-install the pip and npm packages. To start up your application again, do the following:

  1. Open a a terminal, and cd into the front-end folder.
  2. Execute npm run start.
  3. Open another terminal, and cd into the back-end folder.
  4. Execute python
  5. Go to http://localhost:3000.

To shut down the application, simply close the two terminal windows.


If the application is not working, check that both client and server processes are running in the terminals, and that there are no error messages in the terminals.

Production build

When your self-hosted application is ready to be deployed into production, make the following changes:

  1. In, set debug to False:
  1. In .env, change NEXT_PUBLIC_API to the url of your Python server, if needed.
  2. Start the front-end server in production mode:
npm run build
npm run start


Once you have completed the initial setup, you can start the application by running the following commands for future runs:

# In terminal 1
cd back-end

# In terminal 2
cd front-end
npm run dev