Project 7.5: RESTful applications, Service-Oriented Architectures

April 25, 2011

Objective

Learn about REST and SOA. Integrate your node with the mothership.

Prerequisites

You should have completed Project 7.4 and be working on Unit 7d.

Requirements

Review the Spec

First, be sure to review the mothership specification as described here in the main Project 7 doc.

Get the Code, Run the App

Next, clone the mothership repository (remember, clone it to a directory outside of any existing repository, not from within) and conduct the typical setup tasks (create a database.yml, run rake db:setup, possibly run bundle install if necessary).

Now, run the app. Keep in mind that you'll be running two apps in dev (your component app, and the mothership) so you'll need to specify a different port when running the mothership and your component app simultaneously. Assuming your component app is listening on port 3000, you may wish to run the mothership on port 3001 like so: script/server -p3001

Test Deployment & Collaboration

Next, edit your .git/config so it looks something like this:

[core]
  repositoryformatversion = 0
  filemode = true
  bare = false
  logallrefupdates = true
  ignorecase = true
[remote "origin"]
  fetch = +refs/heads/*:refs/remotes/origin/*
  url = git@github.com:ybakos/csci446-mothership.git
[branch "master"]
  remote = origin
  merge = refs/heads/master
[remote "staging"]
  url = git@heroku.com:blooming-frost-996.git
  fetch = +refs/heads/*:refs/remotes/heroku/*
[remote "production"]
  url = git@heroku.com:stormy-moon-647.git
  fetch = +refs/heads/*:refs/remotes/heroku/*

You'll probably just need to add the last six lines.

Next, edit README.md and add your name to the list under "contributors." Commit and push your change.

Next, try deploying to staging (git push staging master or if you're using heroku_san, rake staging deploy). You should be able to deploy without any errors on the console and be sure to visit http://blooming-frost-996.heroku.com (httpauth is mines/mines) to make sure it's working in staging.

Integrate Your Application

Watch the following to see how the applications talk to one another.

Your task actually isn't very complicated. Follow the example Shield imeplementation (be sure you've pulled the mothership recently) and be sure to:

IMPORTANT: You should only push working code to github, or 22 other students will whine at you and not buy you a beer after the semester is over. (You can push to Heroku as you see fit.)

Grading criteria (2000 points)

You must be able to create an armada that uses your (and ideally, everyone else's) component data.

These tasks are due by Thursday, May 12 @ 11:59PM.