Code, Data and Paper for Medwings - My Bachelor's thesis.
Find a file
2023-08-17 16:16:50 +02:00
app docs: fix typos and broken links 2023-08-02 15:17:46 +02:00
assets feat: add registration finalization and fix UI bugs 2023-08-01 15:46:50 +02:00
docs docs: update datamodel 2023-08-02 13:29:36 +02:00
.dockerignore feat: finish user registration flow 2023-07-28 23:27:12 +02:00
.gitignore feat: add gotify notification server 2023-07-27 13:29:32 +02:00
.postcssrc feat: add parcel bundler 2023-07-21 12:04:00 +02:00
Caddyfile feat: migrate to django backend 2023-07-21 10:57:46 +02:00
development.caddy.Dockerfile feat: migrate to django backend 2023-07-21 10:57:46 +02:00
development.django.Dockerfile feat: add automated notifications via cron 2023-08-01 00:07:24 +02:00
development.docker-compose.yml feat: add registration finalization and fix UI bugs 2023-08-01 15:46:50 +02:00
development.supervisord.conf feat: add automated notifications via cron 2023-08-01 00:07:24 +02:00
django.crontab feat: add automated notifications via cron 2023-08-01 00:07:24 +02:00
package-lock.json feat: implement datamodel 2023-07-27 16:37:18 +02:00
package.json feat: implement datamodel 2023-07-27 16:37:18 +02:00
README.md docs: fix typos and broken links 2023-08-02 15:17:46 +02:00
tailwind.config.js feat: update styling 2023-08-01 06:52:18 +02:00

MEDWings

Medwings is the Mobile Early Deterioration Warning System. It is a proof of concept for a remote patient monitoring system, designed for use by elevated-risk patients outside of direct medical supervision, such as at home or on the go.

The application utilizes smart medical devices to access vitals data gathered by users remotely. Data is aggregated, and a clinical early warning score is calculated based on the readings.

The Medwings application is split into different modules, each handling a specific responsibility:

  • core: global files and configuration
  • authentication: user creation and login/logout management
  • medwings: everything related to vitals data and MEWS calculation
  • gotify: interfaces to the notification server
  • withings: interfaces to the Withings API

You can read more about each module and its functionality in each section mentioned above.

Development

Sensitive Configuration Data

To avoid leaking sensitive configuration data, such as database passwords or API keys, all such values are stored in the .env-file.

Prior to running the application, you must create a file called .env in the project root. The file contains the following environment variables:

TIMEZONE=Europe/Berlin
PG_NAME=medwings
PG_USER=medwings
PG_PASSWORD=secret
PG_HOST=medwings-postgres
PG_PORT=5432
GOTIFY_USER=gotify
GOTIFY_PASSWORD=secret
GOTIFY_HOST=medwings-gotify
GOTIFY_PUBLIC_URL=https://notifications.medwings.example.com/
WITHINGS_CLIENT_ID=abc123myClientId
WITHINGS_CLIENT_SECRET=abc123myClientSecret

You should set the values of the following variables:

variable description value
PG_PASSWORD password for the PostgreSQL admin user a random string of 32 characters
GOTIFY_USER name of the Gotify admin user a random string of 32 characters
GOTIFY_PASSWORD password for the Gotify admin user a random string of 32 characters
GOTIFY_PUBLIC_URL URL where your public Gotify server can be reached this depends on your deployment environment
WITHINGS_CLIENT_ID Your Withings API client id see Withings API
WITHINGS_CLIENT_SECRET Your Withings API client secret see Withings API

Starting the dev environment

Once your environment vars are set up, you can run the backend and webserver, by running the following command:

sudo docker-compose -f development.docker-compose.yml up --force-recreate --build --remove-orphans

In a separate terminal, you should also start the frontend asset bundler:

npm run start

It supports file watching and automatic recompilation of the project's CSS and JS bundle.

Running commands inside the container

To run commands inside the django container, run the following:

sudo docker exec -itu django medwings-django <command>

Run database migrations inside the running container like so:

sudo docker exec -itu medwings-django python manage.py migrate

To enter django's interactive shell, run:

sudo docker exec -itu medwings-django python manage.py shell