-
Notifications
You must be signed in to change notification settings - Fork 8
Installation Instructions on Nodejitsu
Mac Robeson edited this page Jul 5, 2022
·
30 revisions
CrowdGauge runs on Node.js and can be hosted on any server running Node. These instructions are for hosting on Nodejitsu.com.
- Install Node.js (this will automatically install the package manager called NPM)
- Set up an account on Nodejitsu.com and follow the instructions in the email. Note: for some reason they include the Ubuntu-specific 'sudo' command in the instructions. If you're not on Ubuntu (or similar) just leave that first part off and run "npm install jitsu -g".
- As per the email instructions, you will be asked to confirm your account and set up a password.
- Clone the github repository: https://github.com/placematters-decision-lab/crowdgauge.git
- By default, your application will be run from a subdomain on Nodejitsu (e.g. crowdgauge.jit.su). Open package.json in the root of the repository you just cloned and edit the 'subdomain' property from 'crowdgauge' to whatever you want as your unique URL on jit.su (jitsu will warn you later if its taken). Note that certain characters (such as underscores) are not permitted in the URL. See this regex.
- Navigate a command window / terminal to the root of the crowdgauge folder you just cloned (where package.json resides).
- Run the command: jitsu deploy
- The application should upload and attempt to run, but it will return an error at this point because we still need to configure databases.
- Log in to the Nodejitsu control panel.
- Open the 'Apps' tab. Select your app on the side panel and then select the 'Environment variables' tab. Click 'Add variable' to add these keys:
COUCH_URL, REDIS_HOST, REDIS_PORT, REDIS_KEY
- Enter 6379 next to REDIS_PORT
- You are going to need to copy multiple variables across so use a new browser tab (or window). Open the 'Databases' tab.
- Click CouchDB on the left and add an IrisCouch database.
- Copy the connection string and paste in the other window next to the COUCH_URL key under 'Environment variables'.
- Click on Redis (By Iriscouch) on the left and then 'Add database'.
- Copy the Host URL and paste it next to REDIS_HOST
- Copy the Password and paste it next to REDIS_KEY
- Click 'Save'
Redeploy the application as per the 'Deploy your application' instructions above.
To start building content, go to your_subdomain.jit.su/client/contribute/index.html. You will be prompted to sign in with a Persona account.
Once you have everything set up, you probably want to secure your CouchDB database which is completely open by default.
- Copy the CouchDB URL (the one you copied into the COUCH_URL variable) and append /_utils/ at the end. Hit that URL.
- Click the 'Fix this' link at the bottom right to set up a CouchDB username and password.
- Update your COUCH_URL environment variable: insert username:password@ as a prefix after 'https://' - it should look something like this:
https://joe:[email protected]:6984/
If you run into problems, please see the troubleshooting page