2020-07-05 10:26:34 -04:00
|
|
|
# sartography/protocol-builder-mock
|
|
|
|
|
|
|
|
# UVA IRB Protocol Builder Mock
|
2020-01-09 10:24:21 -05:00
|
|
|
|
|
|
|
## Requirements
|
|
|
|
* Python 3
|
|
|
|
* pip (for python 3)
|
|
|
|
* pipenv (just run pip install pipenv)
|
|
|
|
|
2021-01-20 11:03:14 -05:00
|
|
|
## Database Setup
|
|
|
|
The database for the CR Connect project will create an empty database for protocol builder as well.
|
|
|
|
We did this because you would only by running this mock in order to support the app. Would be good
|
|
|
|
to have this set up and run as a part of that docker-compose rather than having to spin this up seperately.
|
|
|
|
|
|
|
|
With the database running, be sure to execute
|
|
|
|
|
|
|
|
```
|
|
|
|
flask db upgrade
|
|
|
|
```
|
|
|
|
to set up the database structure.
|
|
|
|
|
|
|
|
|
|
|
|
## Starting up Protocol Builder
|
2020-01-09 10:24:21 -05:00
|
|
|
```bash
|
|
|
|
pipenv run python run.py
|
|
|
|
```
|
|
|
|
This will start a webserver on localhost at port 5001. To see the api, you can visit
|
|
|
|
http://localhost:5001/pb/ui
|
|
|
|
|
2021-01-20 11:03:14 -05:00
|
|
|
## Create an example study
|
|
|
|
Finally, you will need to connect to the protocol builder mock ui in a web browser (see above url)
|
|
|
|
And use this to connect to create a new study. Be sure the study is owned by the person you are logging in
|
|
|
|
to on CR-Connect. For must development environments this will be dhf8r.
|
|
|
|
|
2020-01-09 10:24:21 -05:00
|
|
|
|
|
|
|
## For future reference, these are the steps Sartography is taking to set up Mock Services:
|
2020-01-08 15:57:00 -05:00
|
|
|
|
|
|
|
1. mdkir project
|
|
|
|
1. cd project
|
|
|
|
1. pipenv install
|
|
|
|
1. pipenv install flask
|
|
|
|
1. pipenv install connexion
|
2020-01-09 10:24:21 -05:00
|
|
|
1. place your swagger/openapi file in the root directory
|
2020-02-17 16:47:34 -05:00
|
|
|
1. add methods to return example data in the app.py file.
|
|
|
|
|
|
|
|
## Deploying to staging
|
|
|
|
We don't have a travis / test environment set up for this yet, no tests
|
|
|
|
but you can build and publish it with:
|
|
|
|
```bash
|
|
|
|
docker image build -t sartography/protocol-builder-mock:latest .
|
|
|
|
docker push sartography/protocol-builder-mock:latest
|
|
|
|
```
|