ODK ♥ Github + node.js

I've been working on a simple ODK backend
https://github.com/digidem/simple-odk built on node.js
https://nodejs.org/ that receives form submissions from ODK collect and
stores them as geojson on a Github https://github.com repo.

Here at Digital Democracy we needed something more lightweight than ODK
Aggregate and Formhub and its derivatives, and wanted the flexibility to
switch in different back ends. One goal is to run this on a Raspberry Pi
http://www.raspberrypi.org/ as a portable form server, to avoid needing
every collection device to connect to the internet.

For now, it's called Simple ODK https://github.com/digidem/simple-odk.
I've also written a collection of modules that should be useful for anyone
working with node.js or javascript and ODK. They attempt to follow the
standards https://bitbucket.org/javarosa/javarosa/wiki/browse/ as closely
as possible and have reasonable test coverage (more tests welcome!)

If you want to get up and running straight away with your own server, it's
a one click deploy to Heroku: My Simple ODK
https://github.com/digidem/my-simple-odk. Note that Heroku is not the
best option for this because of their 30 second timeout
https://devcenter.heroku.com/articles/request-timeout which will cut off
any form submissions from slow connections, especially with media.

We use a $5/month Digital Ocean https://www.digitalocean.com/ droplet and
have written a provisioning
https://github.com/digidem/simple-odk/blob/master/bin/provision.js and deployment
script https://github.com/digidem/simple-odk/blob/master/bin/deploy.sh,
although it needs more tweaking of nginx config for slow connections and
large form uploads, but you can get up and running quickly and get SSL for
free on their herokuapp.com domain. To get a new server up and running we
just npm run provision then npm run deploy. We use Cloudflare
http://cloudflare.com/ to get SSL up and running easily for $20/month
with minimal config (you will be able to get SSL from Cloudflare for free
one this issue https://code.google.com/p/opendatakit/issues/detail?id=1121
is fixed). Cloudflare also has a timeout, of about 3-5 minutes in my
testing. To avoid this you need to store your own certificate on your own
server.

I'd be really interested in any feedback or ideas on this and happy to
answer any questions. I hope that this can be useful for the community in
some way.

Hi Gregor,

Thanks for sharing this. It sounds great! I have been waiting a long time
for something like this. I look forward to checking it out. I like that you
published some of the libraries on npm so that when people need a different
storage backend/authentication, they could use your work.

Cheers,
Martijn

··· On Saturday, March 28, 2015 at 11:54:20 AM UTC-6, Gregor MacLennan wrote: > > I've been working on a simple ODK backend > built on node.js > that receives form submissions from ODK collect and > stores them as geojson on a Github repo. > > Here at Digital Democracy we needed something more lightweight than ODK > Aggregate and Formhub and its derivatives, and wanted the flexibility to > switch in different back ends. One goal is to run this on a Raspberry Pi > as a portable form server, to avoid needing > every collection device to connect to the internet. > > For now, it's called Simple ODK . > I've also written a collection of modules that should be useful for anyone > working with node.js or javascript and ODK. They attempt to follow the > standards as > closely as possible and have reasonable test coverage (more tests welcome!) > > - openrosa-request-middleware > Basic > middleware for serving OpenRosa compliant responses for express middleware > - xform-to-json Converts > XForm submissions from ODK Collect to json or geojson > - openrosa-manifest Create > a valid OpenRosa manifest document see > https://bitbucket.org/javarosa/javarosa/wiki/FormListAPI > - openrosa-formlist Create > a valid JavaRosa FormList of xforms see > https://bitbucket.org/javarosa/javarosa/wiki/FormListAPI > > If you want to get up and running straight away with your own server, it's > a one click deploy to Heroku: My Simple ODK > . Note that Heroku is not the > best option for this because of their 30 second timeout > which will cut > off any form submissions from slow connections, especially with media. > > We use a $5/month Digital Ocean droplet > and have written a provisioning > and deployment > script , > although it needs more tweaking of nginx config for slow connections and > large form uploads, but you can get up and running quickly and get SSL for > free on their herokuapp.com domain. To get a new server up and running we > just npm run provision then npm run deploy. We use Cloudflare > to get SSL up and running easily for $20/month > with minimal config (you will be able to get SSL from Cloudflare for free > one this issue > is fixed). > Cloudflare also has a timeout, of about 3-5 minutes in my testing. To avoid > this you need to store your own certificate on your own server. > > I'd be really interested in any feedback or ideas on this and happy to > answer any questions. I hope that this can be useful for the community in > some way. >

--

Revolutionizing data collection since 2012.

Enketo https://enketo.org/ | LinkedIn
http://www.linkedin.com/company/enketo-llc | GitHub
https://github.com/enketo | Twitter https://twitter.com/enketo
| Blog http://blog.enketo.org/