Victus Spiritus

home

Reckless Photo CouchDB App in 60 seconds

19 Sep 2010

Assumption: you have couchapp and couchDB installed, see this post

Disclaimer: While I've read a bunch about couch's background, I have yet to setup any apps. Today's challenge is to set one up in 60 seconds and blog about it (in a much longer time).

step one

Clone somebody else's app to see the structure

I cloned Tyler's pic app, from CouchOne. I just realized Tyler may enjoy Dead Can Dance as well.

couchapp clone http://victusfate.couchone.com/pics/_design/pic pic

If you point clone to a couchapp it grabs a file tree structure that looks like this:

 .
   |-_attachments
   |---style
   |-evently
   |---items
   |-----_changes
   |---profile
   |-----profileReady
   |-------selectors
   |---------form
   |-lists
   |-shows
   |-template
   |-updates
   |-vendor
   |---couchapp
   |-----_attachments
   |-----docs
   |-----evently
   |-------account
   |---------loggedIn
   |---------loggedOut
   |---------loginForm
   |-----------selectors
   |-------------form
   |---------signupForm
   |-----------selectors
   |-------------form
   |-------docs
   |---------index
   |---------topic
   |-----------edit
   |-------------_init
   |---------------selectors
   |-----------------a.edit
   |-----------------a.run
   |-------profile
   |---------loggedOut
   |---------noProfile
   |-----------selectors
   |-------------form
   |---------profileReady
   |-----lib
   |-views
   |---main
   |---recent-items

That's more than I want to care about off the bat. Let's see if there's someplace I can stick all my photos without thinking.

The important aspects of accessing CouchDB are well articulated by Noah Slater's definitive guide (I now have the pdf, Kindle version, and iOS app). You can complain about your pain points directly to Noah here at his mailing list but be nice and RTFM first. My immediate difficulties included:

I'm all out of time at the moment but you can at least see Tyler's variant of the couchapp and I'll get back to tweaking my local version and documenting later. Looking forward to attaching image files later tonight.