Flask front-end client for TimeSync
CSS Python HTML JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github
app
dockerfiles
docs
scripts
tests
.gitignore
.travis.yml
LICENSE
README.md
config.py.dist
docker-compose.yml
requirements.txt
run.py
wsgi.py

README.md

timesync-frontend-flask

Build Status

Front-end webapp for the TimeSync API.

Configuration

Copy config.py.dist and rename the copy config.py

$ cp config.py.dist config.py

Inside config.py there are several options that must be set before running the app for the first time

Option Description
SECRET_KEY The secret encryption key used to encrypt sessions. Make sure that it's hard to guess
TIMESYNC_URL The URL of the TimeSync server that this app will use
ENCRYPTION_KEY The encryption key used for session encryption
INITIALIZATION_VECTOR The initialization vector used for session encryption

Note: If you are only intending to run the app in a development environment with Docker, you do not need to change the default TIMESYNC_URL in config.py. For a full list of configuration options, check out the documentation

Development

To get set up in a development environment, you will first need to install:

  • docker
  • docker-compose

Setting up the development environment

To build the docker container do:

$ docker-compose build

Once that's done, you can run the app using:

$ docker-compose up

To generate dummy data for testing the app, run:

$ docker-compose run app python scripts/generate_dummy_data.py

Production

To install requirements, do:

$ virtualenv venv -p python2
$ source venv/bin/activate
(venv) $ pip install -r requirements.txt

To start the app, do:

(venv) $ python run.py

You can access the webpage at http://localhost:5000. The login page can be found at http://localhost:5000/login. To submit a time, visit http://localhost:5000/submit.

To run tests, do:

(venv) $ nosetests

To build documentation, do:

(venv) $ cd docs
(venv) $ make html
(venv) $ <browser> build/html/index.html