Setup your own Nomie Syncing Server

UPDATED GUIDE ON GITHUB

Please see https://github.com/happydata/nsync-createuser for instructions on setting up your own syncing server.


OLD POST - FOR NOSTALGIA PURPOSES ONLY.

Warning: This post is designed for hackers who are comfortable setting up and configuring a database.

Only available for Nomie Beta 2 users.

If you're comfortable with databases, you might want to setup up your own Nomie syncing server for near-time device and backup synchronicity, that's fairly easy to do.

Based on the CouchDB API, Nomie's data store can now sync with any CouchDB compliant server (with CORS enabled). In this post I'm going to show you how to setup your own CouchDB (using the hosted service IrisCouch) to automatically sync with Nomie.

What's CouchDB

CouchDB is an open source NoSQL "database" run by the Apache Foundation that's fast, easily extendable, and has a ton of client libraries available. Learn more about CouchDB.

IrisCouch

IrisCouch is a CouchDB hosting service that offers a free version that's a good start for your own Nomie data.

If you'd rather setup your own CouchDB checkout this post on setting up a CouchDB server with a $5 month Digital Ocean server.) Most of the configuration should be the same.

Step 1. Setup your CouchDB

Once you click "Send", you'll see a success message with a link to your new database - CLICK THAT LINK!

Secure your CouchDB

You're now inside of your CouchDB admin section. But, BY DEFAULT YOUR COUCHDB IS PUBLIC. This is worth repeating, ANYONE CAN READ AND WRITE TO THE NEW DATABASE

Yes, that's right, your CouchDB is open to the world so we need to change that. Click the "Fix This" link in the lower right hand corner.

You'll be prompted to setup a "Server Admin". This user will have access to everything and anything, and will be the user you'll provide within the Nomie App. Set a username, password and click "create".

Setup Remote Access

In order to have Nomie sync with your CouchDB, you'll need to enable CORS (Cross Origin Resource Sharing). Click "Configuration" on the right side under "Tools".

If you do not find a CORS section, Scroll to the very bottom and click "Add new section".

You'll need to add the following items, with the section value set to: cors

  • option: credentials
  • value: true

  • option:headers
  • value: accept, authorization, content-type, origin

  • option: methods
  • value: GET, PUT, POST, HEAD

  • option: origins
  • value: *

Enable CORS in the HTTPD Section by scrolling down to the httpd section and changing enable_cors from false to true.

Create Your Databases

You'll need to create the following databases - replacing {username} with the Username you created before.

  • {username}_trackers - stores your trackers.
  • {username}_ticks - each time you click a tracker, a record of the event will be added to the ticks database.
  • {username}_notes - stores your notes
  • {username}_meta - this is currently not used but will be in future versions.

Set the name of your database, and click "Create".

You'll need to secure each of your database as well, as they are publicly available initially. To do this, click the name of the database then click "Security" in the upper left hand menu.

For both the "Admins" section and the "Members" section, provide the username you created before - in the form of a javascript array e.g. ["username"]

Setup Nomie

Launch Nomie on your device. Click the side menu and select Settings. Enable Syncing and provide your IrisCouch URL, username and password.

Once you click the Sync Toggle switch Nomie will test the connection, and if everything is ok will automatically sync with your newly setup CouchDB.

Here are a few fun things I personally plan on doing with the syncing.

  1. Garage Door Opener. I'm going to have my desktop at home monitor for the "Garage" tracker which will trigger some hardware to communicate with the opener.
  2. In-door Horn. A massive compressed-air horn in my home office. At any point I can scare the bejesus out of my family - remotely.
  3. Sync my other #QS services to Nomie.

Hacks will eventually be posted to the HappyData Github page