A Learning Portal built with Couchbase Server 2.0 and ElasticSearch
Ruby JavaScript Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
app
config
db
doc
lib
log
public
script
spec
vendor
.gitignore
.rvmrc
Gemfile
Gemfile.lock
Procfile
README.md
Rakefile
Vagrantfile
config.ru
couchbase.sh

README.md

learningportal

A Couchbase / Elastic Search proof of concept app.

Dependencies

Stable

The following dependencies are considered stable and working as a minimum version.

  • elastic search 0.19.3
  • Ruby 1.9.3-p0
  • Bundler 1.2.0.rc

Development

The following dependencies are currently in development and may change more frequently.

  • libcouchbase 1.1.0.dp5
  • couchbase server 2.0.dp4.1 (version 730)

Installation

Development (OSX)

The first thing to do is ensure your OSX machine is ready to go.

  1. OSX Ruby Development Dependencies
  2. Application Dependencies

Once you've done that, for local development we have two approaches

The benefit of a VM is such that new development releases of couchbase server can be tested (and isolated) from the learningportal app.

Production (EC2)

re-install couchbase on an ec2 instance.

sudo /etc/init.d/couchbase-server stop
sudo rpm -e couchbase-server-2.0.0dp4r-730.x86_64
sudo rm -rf /opt/couchbase
sudo rpm -i couchbase-server-community_x86_64_2.0.0dp4r-730-rel.rpm
sudo /etc/init.d/couchbase-server start

Migrating Staging / Production Buckets

When adding new buckets to staging or production we sometimes only want to create and migrate the buckets which do not yet exist. This is done by the following:

rake lp:ensure_buckets
rake lp:migrate

Management Tasks

The following is a list of tasks that are useful for managing the application.

➜  learningportal git:(master) rake -T | grep lp:
rake lp:create              # Create all buckets
rake lp:drop                # Drop all buckets
rake lp:migrate             # Update couchbase views
rake lp:ensure_buckets      # Detect and create missing buckets (Safe operation)
rake lp:es:create_index     # Create ElasticSearch index
rake lp:es:delete_index     # Delete ElasticSearch index
rake lp:es:reset            # Delete and recreate ElasticSearch index
rake lp:recalculate_active  # Recalculate active content
rake lp:recalculate_scores  # Schedule background score indexing for all documents
rake lp:reindex             # Regenerate all indexes
rake lp:reset               # Reset all data (create, drop, migrate, seed)
rake lp:seed                # Seed 100 documents
rake lp:top_tags_authors    # Update top tags and authors

Libraries