PKPDApp is an open source web-based application to explore, analyse and model the pharmacokinetics and pharmacodynamics of chemical compounds. The app is currently under heavy development, however a preliminary version is being deployed with Heroku and can be found under https://pkpdapp.herokuapp.com/.
If you are interested in developing PKPDApp with us, or just run the app locally, you can clone the repository and follow the installation instructions below.
-
Install sundials, python dev libraries and rabbitmq server
- Ubuntu-latest:
apt-get install libsundials-dev python3-dev rabbitmq-server
Note: if you are in WSL then the rabbitmq server will not automatically start, you can start it manually using
sudo -u rabbitmq rabbitmq-server
- MacOS-latest:
brew install sundials rabbitmq
Note: to restart rabbitmq after an upgrade: brew services restart rabbitmq
- Windows-latest: Sundials will be installed automatically by installing the app.
-
Set environment variables
- Edit the
.env
file in the root of the repository and edit the following environment variables to correspond to your particular setup. The most important variables to alter are those corresponding to secret keys and passwords, others you can probably leave as-is.
- Install requirements
- Create a new virtual environment (optional) then install the requirements
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
- Create database
cd pkpdapp
python manage.py migrate
- Run RabbitMQ
celery -A pkpdapp worker --loglevel=INFO
- Run local server
python manage.py runserver
- (Optional) Create admin user
python manage.py createsuperuser
Running the frontend will require a local installation of Node.js. On Ubuntu 20.04 LTS,
for example, you can install using snap
sudo snap install node --classic
It is also useful to install the yarn
package manager
npm install --global yarn
Navigate to the frontend/
directory and install the Node.js dependencies
cd frontend
yarn install
You can run the frontend using
yarn start
You should be able to see the pkpd web app at 127.0.0.1:3000.
Alternatively you can build a docker image and run the image inside the container with commands below.
$ docker-compose build
$ docker-compose up
You should be able to see the web application at 127.0.0.1.
We run a range of tests each time a commit is pushed to an open pull request using Github Actions. Passing these tests is prerequisite for merging a pull request. Some of these can be run locally as described below:
- copyright tests:
python run-tests.py --copyright
- code style:
flake8
- unit tests:
python manage.py test
runs everything; to run a single test in a file (say) calledtest_models.py
usepython manage.py test pkpdapp.tests.test_models
- code coverage tests: can't be done locally
Install the cache using
$ sudo apt install memcached
Run memcached using
$ memcached -p 11211
PKPDApp is fully open source. For more information about its license, see LICENSE.md.