Skip to content

Instantly share code, notes, and snippets.

@kastman
Last active August 29, 2015 13:59
Show Gist options
  • Save kastman/10681539 to your computer and use it in GitHub Desktop.
Save kastman/10681539 to your computer and use it in GitHub Desktop.
Clean Survana Install

Install Instructions

Prerequisites

  • Install Homebrew
  • ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Install node.js:
  • Note: The only current supported version is node 0.8 (0.10 breaks with some charset error).
  • brew install nvm
  • Note: Homebrew requires some setup for node, including mkdir ~/.nvm and adding NVM_DIR and sourcing nvm.sh to the .bash_profile. Follow the instructions under "==> Caveats" if you see them.
  • nvm install 0.8 && nvm use 0.8 or http://nodejs.org/download/
  • Install MongoDB: brew install mongodb or http://www.mongodb.org/downloads
  • GCC - For OSX, this means installing XCode (the Command Line Tools are not enough).

Edit config.js:

  • change 'YOUR_EMAIL' to a GMail or Yahoo e-mail address
  • change exports.port to 8080 (or 8081 if 8080 fails to load?)
  • (optional) replace 'localhost' with a public domain name, if you have one

Make a new private folder (needs to be writable by Node):

$ mkdir private
$ chmod 770 private
$ npm install

Then start the server:

$ npm start

To start using Survana Admin:

Go to http://localhost:8080/admin

Login with the same e-mail address you entered in config.js (using openauth)

Click Create

Click Questionnaire

Paste in the following code: https://gist.github.com/vpetrov/6c93029c103683e809f8

Save, then Preview.

Studies are simply collections of published forms, so feel free to explore the UI.

As soon as a study is published, a unique URL is assigned to it and it can then be shared with anyone.

To learn how to create more questionnaires using our JSON-based DSL, please see [this]:(https://github.com/vpetrov/survana-admin/wiki/Developer's-Guide-to-Creating-Questionnaires) wiki page.

var survana=require('survana');
var config=require('./config');
survana.run(config);
var path=require('path');
exports.host='0.0.0.0';
exports.port=8081;
exports.publicURL = 'http://localhost/';
exports.encryption={
bits:1024,
key:'private/local.private'
};
exports.modules={
study:{
prefix:'/',
store:'http://localhost/store/',
admins:{
'local':{
'url':'http://localhost/%ID%',
'key':'private/local.public',
'local':true
}
}
},
admin:{
superuser: 'YOUR_EMAIL',
prefix:'/admin/',
publishers:{
'local':{
'url':'http://localhost/',
'local':true
}
},
stores:{
'local':{
'url':'http://localhost/store/',
'local':true
}
}
},
store:{
prefix:'/store/'
}
};
{
"name": "SurvanaTest",
"version":"0.1.0",
"private": true,
"scripts": {
"start": "node app"
},
"dependencies": {
"survana": "0.x.x",
"survana-admin": "0.x.x",
"survana-study": "0.x.x",
"survana-store": "0.x.x"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment