Skip to content

karmi/couchdb-showcase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A small application to demonstrate basic CouchDB features

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published