Frontstage microservice for RAS
10K+
User interface for Respondent Account Services
Based on python 3.9
Use Pyenv to manage installed Python versions
Install dependencies to a new virtual environment using Pipenv
pip install -U pipenv
pipenv install
ras-frontstage requires a redis instance to store user jwt's when they are logged in
For local development this can be installed using Homebrew
brew install redis
For more information see here
It can also be run with docker
docker run --name redis -p 6379:6379 -d redis
ras-frontstage calls one other service, ras-frontstage-api See that repo for how to run it and see the config below for the environment variables used to connect to it
pipenv run python run.py
Install test dependencies with
pipenv install --dev
The Makefile will run the tests in the unit or integration tests folder using pytest, and present a coverage report.
These can be easily run via the following commands:
make unit-tests
make integration-tests
or if you are running redis in the docker environment
make docker-test
or if you wish to run a single test file, it can be specified as follows:
make INTEGRATION_TESTS=tests/integration/views/surveys/test_surveys_list.py integration-tests
make UNIT_TESTS=tests/unit/test_filters.py unit-tests
The syntax above will work equally well with the 'docker-test' target
Note that this script will fail if there is a node_modules folder in the repo
Environment variables available for configuration are listed below:
| Environment Variable | Description | Default |
|---|---|---|
| APP_SETTINGS | Which config to use | 'Config' (use DevelopmentConfig) for developers |
| SECRET_KEY | Secret key used by flask | 'ONS_DUMMY_KEY' |
| SECURITY_USER_NAME | Username for basic auth | 'admin' |
| SECURITY_USER_PASSWORD | Password for basic auth | 'secret' |
| JWT_SECRET | SECRET used to code JWT | 'testsecret' |
| VALIDATE_JWT | Boolean for turning on/off JWT validation (True=on) | True |
| GOOGLE_ANALYTICS | Code for google analytics | None |
| GOOGLE_TAG_MANAGER | Code for google tag manager | None |
| REDIS_HOST | Host address for the redis instance | 'localhost' |
| REDIS_PORT | Port for the redis instance | 6379 |
| REDIS_DB | Database number for the redis instance | 1 |
| RAS_FRONTSTAGE_API_PROTOCOL | Protocol used for frontstage-api uri | 'http' |
| RAS_FRONTSTAGE_API_HOST | Host address used for frontstage-api uri | 'localhost' |
| RAS_FRONTSTAGE_API_PORT | Port used for frontstage-api uri | 8083 |
These are set in config.py
Content type
Image
Digest
Size
217.1 MB
Last updated
about 5 years ago
docker pull sdcplatform/ras-frontstage:maintenance-prototype