Skip to content

Commit 467fe7b

Browse files
committed
Merge pull request #404 from jembi/update-readme-for-1.1
Updated readme for 1.1 release
2 parents b4e80d2 + 78ab75a commit 467fe7b

File tree

2 files changed

+56
-68
lines changed

2 files changed

+56
-68
lines changed

README.md

Lines changed: 56 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -14,75 +14,58 @@ See the [development roadmap](https://github.com/jembi/openhim-core-js/wiki/Open
1414

1515
See [the documentation](https://github.com/jembi/openhim-core-js/wiki) for more details to get started.
1616

17-
# Quickstart Guide
17+
For additional information and tutorials see [openhim.org](http://openhim.org).
1818

19-
0. Install [Node.js](http://nodejs.org/) 0.11.9 or greater
20-
1. Install and start [MongoDB](http://www.mongodb.org/)
21-
2. Clone the `https://github.com/jembi/openhim-core-js.git` repository or download [the code](https://github.com/jembi/openhim-core-js/archive/master.zip) to the desired location
22-
3. In the root folder of the downloaded/cloned source, run `sudo npm install . -g`
23-
5. Start the server by executing `openhim-core`
19+
Getting started with the OpenHIM-core
20+
-------------------------------------
2421

25-
Alternatively you can also use one of the following options:
26-
* use [Vagrant](https://github.com/jembi/openhim-core-js/wiki/Running-the-OpenHIM-using-Vagrant) to fire up an instance if you're a developer, or just want a quick instance to test with, or
27-
* use [Puppet](https://github.com/jembi/openhim-core-js/wiki/OpenHIM-Installation-using-Puppet) to deploy an instance on a server.
22+
1. Install the latest stable [Node.js](http://nodejs.org/) 0.12.0 or greater.
23+
2. Install and start [MongoDB](http://www.mongodb.org/) 2.4 or greater.
24+
3. Install the OpenHIM-core package globally: `npm install openhim-core -g`, this will also install an openhim-core binary to your PATH.
25+
4. Start the server by executing `openhim-core` from anywhere.
2826

29-
Installation and Development
30-
============================
27+
To make use of your own custom configurations you can copy the [default.json](https://github.com/jembi/openhim-core-js/blob/master/config/default.json) config file and override the default setting:
3128

32-
Clone the `https://github.com/jembi/openhim-core-js.git` repository or download [the code](https://github.com/jembi/openhim-core-js/archive/master.zip).
33-
34-
Prerequisites
35-
-------------
36-
* [Node.js](http://nodejs.org/) 0.11.9 or greater
37-
* [Koa framework](http://koajs.com/)
38-
* [MongoDB](http://www.mongodb.org/)
39-
40-
The OpenHIM core makes use of the [Koa framework](http://koajs.com/), which requires node version 0.11.9 or greater. Node also has to be run with the `--harmony` flag for this allocation to work.
41-
42-
The easiest way to use the latest version of node is to install [`nvm`](https://github.com/creationix/nvm). On Ubuntu, you can install using the install script but you have to add `[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh # This loads NVM` to the end of your `~/.bashrc` file as well.
29+
```
30+
wget https://raw.githubusercontent.com/jembi/openhim-core-js/master/config/default.json
31+
# edit default.json, then
32+
openhim-core --conf=path/to/default.json
33+
```
4334

44-
Once `nvm `is installed, run the following:
35+
**Note:** one of the first things that you should do once the OpenHIM is up and running is setup a properly signed TLS certificate. You can do this through the [OpenHIM console](https://github.com/jembi/openhim-console) under 'Certificates' on the sidebar.
4536

46-
`nvm install 0.11`
37+
Developer guide
38+
---------------
4739

48-
`nvm alias default 0.11`
40+
You can use vagrant if you would want to get up and running quickly with a dev environment in a vm. See here to [use Vagrant](https://github.com/jembi/openhim-core-js/wiki/Running-the-OpenHIM-using-Vagrant) to fire up an instance.
4941

50-
The latest version of node 0.11 should now be installed and set as default. The next step is to get all the required dependencies using `npm`. Navigate to the directory where the openhim-core-js source is located and run the following:
42+
Clone the `https://github.com/jembi/openhim-core-js.git` repository.
5143

52-
`npm install`
44+
Ensure you have the following installed:
45+
* [Node.js](http://nodejs.org/) 0.12.0 or greater
46+
* [MongoDB](http://www.mongodb.org/) (in Ubuntu run `sudo apt-get install mongodb`, in OSX using [Homebrew](http://brew.sh), run `brew update` followed by `brew install mongodb`)
5347

54-
In order to run the OpenHIM core server, [MongoDB](http://www.mongodb.org/) must be installed and running.
48+
The OpenHIM core makes use of the [Koa framework](http://koajs.com/), which requires node version 0.12.0 or greater. Node also has to be run with the `--harmony` flag for Koa to work as it needs generator support.
5549

56-
### Installing MongoDB
57-
_Skip this section if you have already installed MongoDB_
58-
* [Linux install instructions](http://docs.mongodb.org/manual/administration/install-on-linux/):
59-
* in Ubuntu run `sudo apt-get install mongodb`
60-
* [OSX install instructions](http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/):
61-
* using [Homebrew](http://brew.sh), run `brew update` followed by `brew install mongodb`
62-
* To install MongoDB on Windows, follow the [Windows install instructions](http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/).
50+
The easiest way to use the latest version of node is to install [`nvm`](https://github.com/creationix/nvm). On Ubuntu, you can install using the install script but you have to add `[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh # This loads NVM` to the end of your `~/.bashrc` file as well.
6351

64-
For further information see the [MongoDB installation documentation](http://docs.mongodb.org/manual/installation/).
52+
Once `nvm `is installed, run the following:
6553

66-
### Starting MongoDB
54+
`nvm install 0.12`
6755

68-
* [Starting MongoDB on Linux](http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/#run-mongodb):
69-
* in Ubuntu run `sudo service mongodb start`
70-
* [Starting MongoDB on OSX](http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/#run-mongodb)
71-
* run `mongod` (or `mongod --dbpath <some alternate directory>` to manually specify your data directory)
72-
* To run MongoDB on Windows, see the [Windows documentation](http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/#start-mongodb).
56+
`nvm alias default 0.12`
7357

74-
For more information see the [MongoDB getting started guide](http://docs.mongodb.org/manual/tutorial/getting-started/).
58+
The latest version of node 0.12 should now be installed and set as default. The next step is to get all the required dependencies using `npm`. Navigate to the directory where the openhim-core-js source is located and run the following:
7559

76-
### Testing
77-
This step is optional but recommended to ensure that the system is running as expected. To run the tests see the [Testing](https://github.com/jembi/openhim-core-js#testing-1) section below.
60+
`npm install`
7861

62+
Then build the project:
7963

80-
Running the server
81-
==================
64+
`grunt build`
8265

83-
First make sure the project is build by running `grunt build`.
66+
In order to run the OpenHIM core server, [MongoDB](http://www.mongodb.org/) must be installed and running.
8467

85-
Once all the prerequisites have been installed, configured and started, run the OpenHIM core server by executing the following:
68+
To run the server, execute:
8669

8770
`node --harmony lib/server.js`
8871

@@ -92,54 +75,60 @@ The server will by default start in development mode using the mongodb database
9275

9376
This starts the server with production defaults, including the use of the production mongodb database called 'openhim'.
9477

95-
To make use of your own custom configurations you can copy the [default.json](https://github.com/jembi/openhim-core-js/blob/master/config/default.json) config script and keep the settings you wish to override. You can then override the default configuration settings with the following command:
78+
This project uses [mocha](http://visionmedia.github.io/mocha/) as a unit testing framework with [should.js](https://github.com/visionmedia/should.js/) for assertions and [sinon.js](http://sinonjs.org/) for spies and mocks. The tests can be run using `npm test`.
9679

97-
`--conf=path/to/customConfig.json`
80+
**Useful tips:**
9881

99-
So to start a production server with a custom config script it will look something like this:
100-
`NODE_ENV=production node --harmony lib/server.js --conf=path/to/customConfig.json`
82+
* `grunt watch` - will automatically build the project on any changes.
83+
* `grunt lint` - ensure the code is lint free, this is also run before an `npm test`
84+
* `npm link` - will symlink you local working directory to the globally installed openhim-core module. Use this so you can use the global openhim-core binary to run your current work in progress. Also, if you build any local changes the server will automatically restart.
10185

10286
Running the OpenHIM on boot
103-
===========================
87+
---------------------------
10488

10589
To help you get the OpenHIM server running on boot we supply a upstart config file (good for Ubuntu or other system that use upstart). Install the upstart config by doing the following:
10690

107-
`sudo cp resources/openhim-core.conf /etc/init/`
91+
```
92+
wget https://raw.githubusercontent.com/jembi/openhim-core-js/master/resources/openhim-core.conf
93+
sudo cp openhim-core.conf /etc/init/
94+
```
10895

10996
Then run start the server with:
11097

11198
`sudo start openhim-core`
11299

113100
It will automatically startup on reboot.
114101

102+
If you require custom config you will have to edit `openhim-core.conf` to add in the `--conf` parameter pointing to your external config file.
103+
104+
Contributing
105+
------------
106+
107+
You may view/add issues here: https://github.com/jembi/openhim-core-js/issues
108+
109+
To contibute code, please fork the repository and submit a pull request. The maintainers will review the code and merge it in if all is well.
110+
115111
Exporting/Importing Server Configuration
116-
===========================
112+
----------------------------------------
113+
114+
**Note:** This can now be done from the OpenHIM console which may be easier.
117115

118116
### Exporting
117+
119118
Follow the below steps to export and import the server metadata configuration. By default, the Users, Channels, Clients, ContactGroups and Mediators collections will be exported.
120119
Copy the file [openhim-configuration-export.sh](https://github.com/jembi/openhim-core-js/blob/master/resources/openhim-configuration-export.sh) to a folder where you wish your export to be saved. Run the shell scrip by executing the following command:
121120
`./openhim-configuration-export.sh`
122121

123122
Your exported collections should be located in the folder structure '/dump/openhim/'.
124123

125124
### Importing
125+
126126
To import you data successfully ensure that you are in the correct folder where the dump files are located. Execute the below command to import your collections.
127127
`mongorestore --db openhim dump/openhim`
128128

129129
NB! if you have changed your database name, then do so for the export/import as well.
130130
NB! Please ensure that you stop the server before exporting and importing.
131131

132-
133-
Testing
134-
=======
135-
136-
This project uses [mocha](http://visionmedia.github.io/mocha/) as a unit testing framework with [should.js](https://github.com/visionmedia/should.js/) for assertions and [sinon.js](http://sinonjs.org/) for spies and mocks. The tests can be run using `grunt`:
137-
```
138-
grunt test
139-
```
140-
141-
Alternatively you can also run the tests using `npm test`.
142-
143132
Design
144133
------
145134

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "openhim-core",
33
"description": "The OpenHIM core application that provides logging and routing of http requests",
44
"version": "1.1.0",
5-
"private": true,
65
"main": "./lib/server.js",
76
"bin": {
87
"openhim-core": "./bin/openhim-core.js"

0 commit comments

Comments
 (0)