Flask + Dashboard = Flash. A project dashboard that works.
Heroku
Cloud Foundry
Flash can easily be deployed to any Cloud Foundry environment. An example
manifest.yml
is included with the project, showing how to configure the deployment with an app name and a random route. Once you have installed the CLI and selected an appropriate target org and space, you can simplycf push
.Docker
Alternatively, build a Docker container as below and deploy to an online container hosting service.
There are three environment variables that Flash is aware of:
PORT
- the port to bind to (defaults to 5000)FLASK_SECRET_KEY
- the secret key for Flask sessions (they aren't currently used, but it's good practice to set it to a random value)FLASH_CONFIG
- the configuration, described below
The configuration, either saved in config.json
at the project root or as the
$FLASH_CONFIG
environment variable, should look like:
{ "project_name": <name of the project>, "services": [ { "name": "tracker", "api_token": <your API token>, "project_id": <your project ID> } ] }
If both the environment variable and the config file are provided, the environment variable takes precedence.
If loading from config.json
, any value in the "services"
settings that
$LOOKS_LIKE_THIS
(leading $
, capital letters and underscores only) will
be assumed to be an environment variable and retrieved accordingly. This lets
you version control most of your configuration without leaking API tokens and
other secrets.
project_name
- the project's name to display in the footer (defaults to"unnamed"
)services
- an array of service configurations (see flash_services for details and configuration options)style
- the stylesheet to use (defaults to"default"
, which is currently the only option...)project_end
- the end data and time of the project, in any format accepted by Moment.js. If provided, a countdown to this point will be shown in the footer (no default, if not provided no countdown is shown).
If you just want to run Flash locally, you can use the included Dockerfile
to build and run a Docker container. This is a two-step process, after which
Flash will be available at https://localhost:5000
:
docker build -t textbook/flash . docker run -p 5000:80 textbook/flash
If your config.json
includes environment variable references, or you want
to override the configuration completely with $FLASH_CONFIG
, you can supply
environment variables at docker run
time with the -e
command.
The easiest way to install Flash for development is:
- Install the dependencies:
pip3 install -r requirements.txt
- Install the package in development mode:
python3 setup.py develop
- To run it locally, edit
flash/config.json
or provide$FLASH_CONFIG
then run:python3 scripts/launch.py
- To run the tests, use
python setup.py test
or runpy.test
directly. In the latter case, use--runslow --Chrome
(or another browser of your choice) to include the integration tests, and see the docs forpytest-pylint
configuration options. For the integration tests you will need to ensure thatchromedriver
is on your PATH; on OS X, you can simplybrew install chromedriver
.
The templates are written using the Jinja2 template language.
Thunder is a new branch in the Flash repository that might eventually replace the original. It switches the framework from Flask to Tornado, allowing asynchronous processing and websockets.