Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A small application to demonstrate basic CouchDB features
JavaScript
tree: e126af049a

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
couchdb/_design
vendor/couch_docs
.gitignore
.push
Gemfile
MIT-LICENSE
README.markdown
Rakefile

README.markdown

CouchDB Showcase

This application is a showcase of the basic CouchDB database features.

It allows you to populate a sample database with contacts, example view definitions to query the data, as well as _show and _list functions to transform the documents and queries into another format (HTML, vCard and CSV).

After installation, your application should be available here: http://localhost:5984/addressbook/_design/person/_list/all/all.

Installation

You will need a working and running CouchDB version 1.0.1 or higher, a Ruby interpreter and a Rubygems packaging system.

First make sure that you have the Bundler gem installed:

$ gem list bundler

If not, install it:

$ sudo gem install bundler

Then, run the check for the required Rubygems:

$ bundle list

And install thosse missing:

$ bundle install

Usage

Once you have the neccessary tools installed, run the default Rake task:

$ rake

This should populate a database named addressbook in CouchDB with data and code.

A list of URLs to begin exploration is printed when the task ends.

When you make changes to the code, or you want to re-populate the data, you can run the individual tasks. See their list:

$ rake -T

To test CouchDB's _changes feed, you can execute this task:

$ rake changes DATABASE=addressbook

Any changes to the data you'll make should be printed in your terminal.

The code

All the Ruby support code is in the Rakefile file. It is deliberately very procedural, to be easy to follow.

All the view definitions are in the couchdb/_design/person/views folder.

Show and list functions are in their respective folders.

You can use the Watchr gem to continually update code inside the database after you change it:

$ watchr .push

Resources

Something went wrong with that request. Please try again.