Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time




  • Vagrant 1.6.3+
  • Ansible 1.7+

To install the development environment run.

  • git clone
  • git clone
  • cd ltfhc-next
  • vagrant up (The provisioning will take a long time as it is building couch from source currently.)
  • (vagrant provision) Only necessary if you modify the playbook or need to provisioning an existing and running vagrant VM.
    • If you have made targeted modifications in the playbook and want to only run specific tags then use ansible-playbook -i system/inventory --private-key=~/.vagrant.d/insecure_private_key -u vagrant ../ltfhc-config/playbook/site.yml --tags="SOMETAGS"

You should be able to access the application at https://localhost:8443 with the username demo and the password demo

To access Futon use

Optional steps

To be able to run couchdb on :

  • Add to /etc/hosts
  • sudo ipfw add 101 fwd,8443 tcp from any to me 443

Now you should be able to see Futon at

Create a user account click "Fix this" to end the Admin Party (bottom right of Futon)

Deploying the EMR app

We use Kanso for dependency management and installation of this CouchApp.

To install:

npm install kanso

To get dependencies:

cd <project root>
kanso install

To push to local CouchDB:

kanso push http://localhost:5984/emr


Clone the repository and install dependent packages with Kanso.

git clone
cd ltfhc-next
kanso install

You can use the credentials you created above after ending the Admin Party. Edit your .kansorc to be able to push by default to your personal working dev replica. Replace USER and PASS (make sure to push by default to emr__dev__USER)


exports.env = {
    // the default env will be used when you just do "kanso push"
    'default': {
        db: '' 
    // you can also define named environments this one will 
    // be used when you do "kanso push production"
    'development': {
        db: ''
    // you can also define named environments this one will 
    // be used when you do "kanso push production"
    'production': {
        db: '',
        minify: true

Then upload the data files to your personal development database.

kanso upload data
kanso upload schema

Push your local couch app to your personal development database.

kanso push

The app should be available at

License & Copyright

Copyright 2014 Lake Tanganyika Floating Health Clinic, 501(c)(3)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Caolan's dev environment

I was having problems with the vagrant setup above (CouchDB was eating 100% ram and CPU when PUT'ing documents for some reason). Until we can invest time in fixing the development environment properly here's the process I'm using:

Setup .dev domains for local machine (debian)

  • sudo apt-get install dnsmasq
  • edit /etc/dnsmasq.conf
    • add: address=/dev/
  • service dnsmasq restart
  • edit /etc/dhcp/dhclient.conf
    • add: prepend domain-name-servers;
  • service network-manager restart

Start couchdb docker container

$ fig up

CouchDB should then be accessible at http://localhost:5985/_utils, username: demo, password: demo

Push district couchapp

$ rm kanso.json
$ ln -s ./kanso.json
$ kanso push http://demo:demo@localhost:5985/emr_district

You can now access the district couchapp at

Push clinic couchapp

$ rm kanso.json
$ ln -s ./kanso.json
$ kanso push http://demo:demo@localhost:5985/emr_clinic

You can now access the clinic couchapp at

Push clinic data

$ kanso upload data http://demo:demo@localhost:5985/emr_clinic --skip

Setup replication of approved reports from clinic instance to district

$ ./utils/setup_clinic_to_district_replication.js http://demo:demo@localhost:5985 emr_clinic emr_district

To view reports in district instance

Create a user of type 'District' in the user administration interface, login to the district couchapp and click the tab for the clinic. To add more clinics to the district or add more distrits edit the lib/districts.js file.

You'll need to approve a report in the clinic instance (and make sure you have done the above replication setup).