The DRE server contains all of the backend components to support the Drug Reactions Explained [DRE] application.
It is comprised of a a single node.js project that uses the express framework.
It is responsible for:
-
Acting as a web server for the DRE Application front end angularjs application (contained in the
/client
folder) -
Powering the Reaction Lookup APIs that provide the application a reaction explanation lookup service
-
Hosting the Reaction Lookup APIs documentation (powered by swagger-ui)
- The Merriam Webster API
- The Wordnik API
-
Clone this repo
-
Change directory to
ads-bpa
cd ads-bpa
-
Create configuration files
# Copy sample config files cp client/app/scripts/config-sample.js client/app/scripts/config.js cp server/config-sample.js server/config.js # Update config files with your hostnames, api keys, and mongo settings vim client/app/scripts/config.js vim server/config.js
-
Install npm dependencies
npm install -g bower grunt-cli mocha
-
Change directory to
client
and install npm modules / bower componentscd client npm install bower install
And use grunt to build all dependencies into a single directory.
grunt build
NOTE: The Backend Node.js app serves the Frontend AngularJS app.
-
Change directory to
server
and install npm modulescd ../server npm install
-
Start mongo and then start the App
mongod --config /usr/local/etc/mongod.conf # You may need to modify path to mongod.conf npm start
-
View App. Default url is: http://localhost:3000
-
Clone this repo
-
Change directory to
ads-bpa
cd ads-bpa
-
Create configuration files
# Copy sample config files cp client/app/scripts/config-sample.js client/app/scripts/config.js cp server/config-sample.js server/config.js # Update config files with your hostnames, api keys, and mongo settings vim client/app/scripts/config.js vim server/config.js
-
Build a docker image
# replace [image_name] with the name you want to call the image docker build -t [image_name] .
The above command used the Dockerfile include in the repo.
-
Start the mongo container and then start a container using the image you just built:
docker pull mongo docker run -d --name db mongo # replace [image_name] with the name of the image you used in step 4 docker run -d --name dre -p 3000:3000 --link db:db [image_name]
-
View App. Default url is: http://localhost:3000