Skip to content

e-zaline/flextool-web-interface

 
 

Repository files navigation

FlexTool 3 web interface

This package contains the web interface for FlexTool 3, an energy systems optimization model for power and energy systems with high shares of wind and solar power. A web server and a browser are needed to use the interface. If you already have a server running somewhere, just point your browser there and you are good to go. However, it is also possible to run the server and use the interface on a local installation. The instructions below guide through the process to do just that.

A link to the Flextool User Guide is available in the top right corner of the interface, next to the Logout button.

Installation

Currently, the only supported method is installation from the Git repository. Instructions to install into a conda environment are provided below, though Python's virtual environment would work equally well.

Installation in conda environment

Install Miniconda if you don't have conda yet.

  1. Open a conda prompt.
  2. Create a new Python 3.8 environment:
    conda create -n flextool3-web-interface python=3.8
    
  3. Activate the environment:
    conda activate flextool3-web-interface
    
  4. If you don't have Git installed yet, install it in conda:
    conda install git
    
  5. cd to a directory where you want the store the application.
  6. Clone the repository. This will create a new directory flextool-web-interface.
    git clone --recurse-submodules https://github.com/irena-flextool/flextool-web-interface.git
    
  7. cd to the newly created directory:
    cd flextool-web-interface
    
  8. Make sure Python's pip package is up-to-date:
    python -mpip install --upgrade pip
    
  9. Install Python packages that are required by FlexTool:
    python -mpip install -r requirements.txt
    
  10. Initialize server database and create a (super) user account (the password need not be secure/complicated on local server and warnings regarding it can be safely ignored):
    python init.py
    

Run

  1. Open a conda prompt.
  2. Activate the flextool3-web-interface environment:
    conda activate flextool3-web-interface
    
  3. cd to the flextool-web-interface directory that was set up during installation.
  4. Start local web server:
    python manage.py runserver
    
    The server will continue to run and log on the prompt until it is stopped by the user.
  5. Point your browser to http://localhost:8000/flextool3/.
  6. If asked, log in with the account created in Installation.

Stop

  1. Press Ctrl+C in the conda prompt where the server is running or just close the window.

Upgrade

  1. Open a conda prompt.
  2. Activate the flextool3-web-interface environment:
    conda activate flextool3-web-interface
    
  3. cd to the flextool-web-interface directory that was set up during installation.
  4. Pull the latest changes:
    git pull
    
  5. Make sure the Python environment and server database are up-to-date:
    python upgrade.py
    

Development

Install dev-requirements.txt to get the Python packages needed for development.

node.js and yarn package manager are needed to build the browser app.

Keeping master project up-to-date

The master project template is located in <repository root>/flextool3/master_project. The directory is a git submodule and can be updated to the latest version by

cd flextool3
cd master_project
git checkout master
git pull
cd ..
cd ..

Before committing the changes it is good idea to run the unit tests to ensure that the master project is still compatible with the website.

python manage.py test

It is OK to commit if the tests pass:

git add -A
git commit

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 46.1%
  • Vue 26.7%
  • JavaScript 25.4%
  • HTML 1.7%
  • CSS 0.1%