Skip to content

uhndev/hateoas-server

Repository files navigation

dados-server

DADOS is a single software platform for electronically collecting and managing data related to treatment outcomes. The application has been implemented within various clinics and departments at UHN to handle prospective clinical trials and subspecialty registries. Initially created by integrating and enhancing two open-source Web-based applications developed by Duke University, DADOS-Prospective and DADOS-Survey, the DADOS platform is currently developed, maintained, and supported by the Techna Institute for use within UHN and other research institutions across the world. New features to improve usability and expand its applicability in the field of translational and clinical research are continually developed and enhanced.

Installing Node without Administrative Rights

There are 2 parts of the NODEJS Windows installer.

  1. Download the node.exe binary into a local folder. a. 32-bit b. 64-bit
  2. Add your local folder to your PATH Environment.
  3. Download the NPM zip.
  4. Extract the .zip to a local folder.
  5. Add the local folder into the PATH Environment.

Installing Prerequisites

$ curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
$ apt-get install --yes git
$ apt-get install --yes vim
$ apt-get install --yes nodejs
$ apt-get install --yes build-essential
$ apt-get install --yes mongodb
$ apt-get install --yes postgresql

$ wget http://download.redis.io/releases/redis-stable.tar.gz
$ tar xvf redis-stable.tar.gz
$ cd redis-stable
$ make
$ make install

$ sudo npm install -g phantomjs
$ sudo npm install -g pm2
$ sudo npm install -g grunt-cli
$ sudo npm install -g karma
$ sudo npm install -g bower
$ sudo npm install -g sails

(Optional) Install Python Tools for Auto-Generating Test Data

$ apt-get install --yes python-setuptools
$ easy_install requests fake-factory
$ npm run populate

Install NPM Dependencies

$ npm install

Running The Application

$ sails lift

Login Credentials

By default, an admin user is created with username admin and password admin1234. If you wish to change these defaults, they can be set via:

Seting environment variables

variable description default
ADMIN_USERNAME admin username admin
ADMIN_EMAIL admin user email address [email protected]
ADMIN_PASSWORD admin user password admin1234

Or setting local config in config/local.js (file is in .gitignore)

sails.config.permissions.adminUsername = 'admin'
sails.config.permissions.adminEmail = '[email protected]'
sails.config.permissions.adminPassword = 'admin1234'

Testing

Run grunt test or npm test to test (uses the test environment & database) Run npm run coverate to run tests and output coverage metrics

If you'd like to generate fake test data in the app, follow these steps:

  1. Make sure you have python installed and python-setuptools
  2. Use easy_install to install modules: easy_install requests fake-factory
  3. Configure amount of data to be generated by modifying the config/scripts/dados-pygen/settings.json
  4. Run dados-pygen via npm script: npm run populate

Documentation

Run grunt generate-docs to auto-generate sails documentation for backend code.

Troubleshooting

grunt errors

Depending on your setup, when you run sails you may encounter any of these errors:

Waiting ... Fatal error: watch ENOSPC
Error: Maximum call stack size exceeded

To resolve this, make sure that your version of grunt-contrib-watch is at least 0.6.0 in your package.json and if all else fails, increase the number of files that can be watched via the command:

$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

bcrypt errors

If you are having trouble installing bcrypt, make sure you have installed the node-gyp package and its dependencies globally:

$ sudo apt-get install libssl-dev
$ sudo apt-get install build-essential
$ sudo npm install -g node-gyp
Windows Users
  1. install Python http://www.python.org/download/releases/2.7.5/
  2. Install Visual Studio 2012/13 Express (or other)
  3. Install Windows SDK (for Windows 7 / 8)
  4. Install Win64 OpenSSL v1.0.1g
  5. Then run npm install bcrypt

Source

npm errors

If during the prerequisite installation phase you find that npm keeps failing to install packages, cleaning the npm cache may be of use:

$ npm cache clean

However if all else fails, a fresh start may be required (NOTE the following will completely uninstall node and all global npm packages)

sudo apt-get remove nodejs
sudo apt-get remove npm
sudo apt-get autoremove
rm -Rf ~/.npm
rm -Rf /usr/local/lib/node_modules
rm -Rf /usr/local/lib/node
rm -Rf /usr/local/lib/npm
rm -Rf $HOME/tmp

License

(The MIT License)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published