Ember front end for HospitalRun
965
Ember frontend for HospitalRun: free software for developing world hospitals
To run the development environment for this frontend you will need to have Git, Node.js, Ember CLI, Bower, and CouchDB installed.
Contributions are welcome via pull requests and issues. Please see our contributing guide for more details, including a link to join our project Slack.
To install the frontend please do the following:
yarn global add ember-cli@latest.
Depending on your npm permissions you might need root access to install ember-cli.git clone https://github.com/HospitalRun/hospitalrun-frontend, go to the cloned folder and runyarn install
hospitalrun-frontend fork and make your contributions via a branch on your fork../script/initcouch.sh in the folder you cloned the HospitalRun repo. A user hradmin will be created with password test../script/initcouch.sh USER PASS in the folder you cloned the HospitalRun repo. USER and PASS are the CouchDB admin user credentials../script/initcouch2.sh in the folder you cloned the HospitalRun repo. A user hradmin will be created with password test../script/initcouch2.sh USER PASS in the folder you cloned the HospitalRun repo. USER and PASS are the CouchDB admin user credentials.server/config-example.js to server/config.js in the folder you cloned the HospitalRun repo. If you already had a CouchDB admin user that you passed into the couch script (./script/initcouch.sh USER PASS), then you will need to modify the couchAdminUser and couchAdminPassword values in server/config.js to reflect those credentials. (Note: If on Mac, you need to make sure CouchDB can be run. See How to open an app from an unidentified developer and exempt it from Gatekeeper.)make serve, it will start couchdb, install npm dependencies and start the server.To start the frontend please do the following:
yarn start in the repo folder. If yarn start doesn't work for you, try ember serve as an alternative.hradmin and password test.To run HospitalRun with Docker please do the following:
git clone https://github.com/HospitalRun/hospitalrun-frontend.git.cd hospitalrun-frontend.docker build -t hospitalrun-frontend ..docker run -it --name couchdb -d couchdb:1.7.1 to create the couchdb container.docker run -it --name hospitalrun-frontend -p 4200:4200 --link couchdb:couchdb -d hospitalrun-frontend to create the HospitalRun container.To run HospitalRun with Docker-compose please do the following:
docker-compose up to reduce the steps to build and run the application.If you are running with Docker Toolbox you will have to run the following commands to get the IP of the docker machine where hospitalrun-frontend is running with the following:
docker-machine ip default.http://<docker-machine ip>:4200 in a browser and login with username hradmin and password test.If you are not running with Docker toolbox, please do the following:
http://localhost:4200 in a browser and login with username hradmin and password test.Always make sure to git pull and get the latest from master.
The app will usually tell you when something needs to happen (i.e. if you try to yarn start and npm is out of date, it will tell you to run yarn update. But If you run into problems you can't resolve, feel free to open an issue, or ask for help in the HospitalRun Slack channel (you can request an invite here).
Otherwise, here are some tips for common issues:
The browser shows only a loading dialog
Is your server (still) running? Is CouchDB running? If not, that's probably the issue.
My changes aren't showing up in the browser
Try a browser refresh cmd + r.
ERR! stack python2: command not found
yarn install requires Python 2 to build some dependencies.
Make sure python2 is accessible from the current working directory.
If you're using pyenv, you can run the following to override the Python version used in the current working directory:
$ pyenv install 2.7.15
$ pyenv local 2.7.15
If you would like to load sample data, you can do so by navigating to Load DB under the Administration menu. You should see the following screen:

Click on Choose File and select the file sample-data.txt which is included in the root directory of the repo at sample-data.txt. Next, click on Load File. When the database load is complete a message will appear indicating if the load was successful.
Fixtures are PouchDB dumps that are generated with pouchdb-dump-cli.
To create a fixture, run pouchdb-dump http://localhost:5984/main -u hradmin -p test | cat > tests/fixtures/${name_of_fixture}.txt.
To use a fixture, use runWithPouchDump(${name_of_fixture}, function(){..}); in your acceptance test. For example:
test('visiting /patients', function(assert) {
runWithPouchDump('default', function() {
//Actual test code here
authenticateUser();
visit('/patients');
andThen(function() {
assert.equal(currentURL(), '/patients');
});
});
});
To run the test suite locally while developing, just run ember test from the project root.
Tests will also run automatically via Travis CI when you push a branch to the repository or a pull request. You can view output by going to the Travis test status from the Pull Request merge box.
Again, contributions are welcome via pull requests and issues. Please see our contributing guide for more details.
Seriously, please read the Contribution Guide.
To start coding and understand the frameworks, concepts and structure of the project, please read: Contribution Guide: Start Coding.
If you are willing to try using make, ensure you have installed Git, Node.js and CouchDB (steps 1, 2 and 7 above), you may skip the rest. This requires CouchDB in the path to work correctly.
make serve, it will start CouchDB, install npm dependencies and start the server.make all to run all tests and build the app.Makefile to figure other targets available.Documented in the project wiki
Q: What is the difference between hospitalrun-frontend and hospitalrun-server?
Frontend is the primary repository and is used for development purposes. Server is the node backend, if you are looking to run HospitalRun in a clinical setting, you should use server.
Content type
Image
Digest
Size
1.1 GB
Last updated
almost 8 years ago
docker pull vuminhtuan/hospitalrun