uwcirg/tb-api

Name: tb-api

Owner: University of Washington Clinical Informatics Research Group

Description: null

Created: 2018-02-21 23:11:33.0

Updated: 2018-02-21 23:11:50.0

Pushed: 2018-03-06 21:19:38.0

Homepage: null

Size: 10506

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

tb API

A simplified FHIR-based backend API application using the mPOWEr data model.

Setup

(see https://docs.docker.com/compose/gettingstarted/)

  1. Install Docker and Docker compose.

  2. Clone project into desired working directory:

    clone https://github.com/uwcirg/tb-api.git
    
  3. Build and run the containers

    b-api
    er-compose build
    er-compose up -d
    
  4. Navigate to http://localhost:5000/hello. You should get an Welcome to mPOWEr! message.

Debugging / Playing Around

The database is created using the initdb.sql file in the /db/sql/ directory. The database container uses the volume tbapi-db for database data. It also maps a 2nd volume for initializing the database, which only happens if the main volume does not exist yet (I think).

The database container also exposes the mysql port (3306) as port 6603 externally.

To (1) re-create the db, (2) re-load it with data from initdb.sql, and (3) connect to it from the host machine (command-line mysql client or workbench):

b-api
er-compose down -v
er-compose up -d --build db

l -u root -p root -h localhost -P 6603

docker-compose down removes all related volumes, networks, and containers, so we start at a clean slate.

docker-compose up -d --build db builds and starts only the db container.

Development

Common commands:

project_dir>

-build and re-start containers, including db init:
er-compose down -v
er-compose up -d --build

ndows-specific: Ensures container is notified of changes by Host inside volume
n this command in PowerShell
e: https://github.com/merofeev/docker-windows-volume-watcher
t-Process -NoNewWindow docker-volume-watcher mysite

art interactive shell connected to dev container
er exec -it mpower-app bash

n flask shell inside interactive shell
ask shell

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.