-
Notifications
You must be signed in to change notification settings - Fork 5
Getting started
OK, so you want to clone and run the KnowNodes application on your own machine. This page is here to guide you through the steps to achieve that.
-
Install Node.js version 0.8!
-
To use multiple versions of node.js and switch between them as necessary, use one of the following three options:
-
nave
(for hackers/lovers see nvm vs. n vs. ?, doesn't work on windows) -
nvm
(see explanation) -
n
(see nvm vs. n)
-
-
-
For MacOSX - do you have an updated Xcode and have command line tools installed? If not update/install through app store and please go through the instructions here
-
For Linux, build-essential package
sudo apt-get install build-essential
-
Install the npm modules
npm install
-
WebStorm 6 (if you are part of CRI, ask Dor for the licence key)
- WebStorm is not a required dependency, for instance the app works with Linux from the command line.
-
Unix-based OS
Up until now, no one has had the courage to make the build process compatible with Windows. It shouldn't be THAT hard, however you should now that if you try, you'll be on your own, so good luck. A known issue is relative to line 6 of the package.json file :
"build": "coffee -c controllers/.; _coffee -c modules/.",
Windows won't understand the semi-colon.
- Install neo4j version 1.8.3
git clone https://github.com/CyberCRI/KnowNodes.git
That should be pretty easy. In WebStorm, run :
VCS > Checkout from Version Control > GitHub
When prompted, paste the URL : https://github.com/CyberCRI/KnowNodes.git
Another alternative for OSX users is to use the "clone in mac" option.
To run the project, you'll need the configuration files :
- DB.conf.js
- settings.js
- loggly.conf.js
These files include the credentials for the database, and are mandatory to be able to run the project. Ask Dor for them. Keep in mind that these files are top secret, so don't share them lightly and make sure you don't commit them to the Git repository.
Once you have those files, just paste them into the /config folder.
You will need to install all the dependencies of the KnowNodes project and also compile the .coffee
and ._coffee
to .js
. Node Packaged Modules (npm) will do that for you automatically, all you have to do is :
- Open a terminal
- Navigate to the root of the KnowNodes project (typically, ~/WebstormProjects/KnowNodes/)
- Run
npm install
- (Probably useless) Run
sudo npm install streamline -g
- (Might help if problem) Run
npm install jugglingdb
A common pitfall at this phase is linked to the presence of the npm-shrinkwrap.json
file. If you encounter the following message :
awk: line 1: illegal reference to array a
Then you should delete the npm-shrinkwrap.json
file before running npm install
. Restore the file after that.
(npm-shrinkwrap.json
is used only for appfog deploys, it is not used locally)
Choose to use the production
or development
environments:
export NODE_ENV=production
or
export NODE_ENV=development
By just running npm install
your files will be compiled! You can also use npm run build
.
To star the application locally, simply use:
npm start
Then navigate to: localhost:3000
When running the KnowNodes project, you will be able to run against the development or the production database. In order to be able to switch easily from one to another you can either import the settings.jar file or you can manually create two separate run configurations in WebStorm :
Run > Edit Configurations > Add New Configuration ("+") > Node.js
- Name : Production
- Path to Node App JS File : app.js
- Environment Variables (press the rightside icon to edit it): NODE_ENV=production
- Name : Development
- Path to Node App JS File : app.js
- Environment Variables (press the rightside icon to edit it) : NODE_ENV=development
By just hitting npm install
your files will be compiled!
If you wish, you can add a watcher in Webstorm for coffee, _coffee and Less files.
That should be it ! All you have to do now is to run one of either configurations, and navigate to : localhost:3000
Jade template engine generates our HTML
Less generates our CSS
BootStrap 2.3.2 is our CSS framework