Facebook Developer Starter Guide: October 2008
Facebook Developer Starter Guide: October 2008
October 2008
1 The Morph Application Platform provides an end-to-end deployment and management environment for Web applications
that includes load balancing, high availability infrastructure, distributed computing, virtualized web stacks, databases,
managed backups, and monitoring. It also provides scalable resources and an environment that grow or shrink as demanded
by utilization, allowing developers to support customers yet avoid over-provisioning.
2A Morph AppSpace cube is a virtualized application compute environment that is managed by the Morph Application
Platform and part of each Morph AppSpace subscription. Each Morph AppSpace cube is a self-contained environment for
running a specific application. The Morph AppSpace cube for Rails includes Mongrel and Nginx.
Note: The following steps assume that you have prior knowledge and experience in using Ruby
on Rails. It is also assumed that you have installed Ruby on Rails on your machine.
As an example, let’s develop the MakePoem application. The MakePoem application is a collaborative
poem writing application. This application allows Facebook users to add the application, create a
poem project that invites friends to write, invites other Facebook users to add the application, and so
on.
The following lists the easy steps to develop the MakePoem application:
<head>
<title>MakePoem Home</title>
</head>
<body>
<h1>MakePoem</h1>
<h2>The MakePoem application is a collaborative poem writing
application. This application allows Facebook users to add the
application, create a poem project
that invites friends to write, and invites other
Facebook users to add the application.</h2>
</body>
</html>
9. Delete the index.html file from the public directory.
10. In the command console, type $ script/server.
11. Access http://0.0.0.0:3000/. You will see an application such as this:
MakePoem
1. Let’s install the gem needed for the development of the application. In the command console,
type:
$ sudo gem install facebooker
$ cd makepoem
$ script/plugin install http://facebooker.rubyforge.org/svn/
trunk/facebooker
Note: You might also need to install the json(1.1.2) gem.
2. Set up your Facebook Developer account. Go to http://www.facebook.com/developers/.
Note: This assumes that you have already signed up a Facebook account.
3. From your Facebook Developer application, click Set Up New Application. This displays:
Note: After setting up your application, Facebook automatically generates the API key and the
Secret key. Click on your application to see the generated keys.
6. Check in the MakePoem application’s code to a source code control repository such as SVN.
6. Download the Capistrano file from the subscription widget. Save this file to your application’s root
directory.
Note: We recommend that you commit the Capistrano file to your SVN repository or to the
version control system you are using.
7. Use a text editor to open the morph_deploy.rb file. Replace the set:repository line with
your version control system.
Example: set :repository, ‘https://dev.myapp.com/repos/ruby/trunk/testing/
makepoem’
8. Upload and deploy your application on the Morph AppSpace. In the command console, type cap
-f morph_deploy.rb morph:deploy (if you saved morph_deploy.rb in another directory,
change this command accordingly).
Note: If you are using a version control system other than Subversion, perform the following:
* If you’re using git:
cap -f morph_deploy.rb -s scm=git -s deploy_via=checkout
morph:deploy
For more information about the Morph AppSpace, refer to the Rails Developers’ Cookbook.
Morph Labs uses virtual infrastructures including Amazon Web Services to provide a truly elastic
environment for web applications that can be instantly provisioned and seamlessly scaled.
Morph Labs is a global company with headquarters in Cebu City, Philippines with additional
in-country operations in Manila along with Los Angeles, California and Portland, Oregon in the U.S.A.
www.mor.ph
World Headquarters
Unit 1A, Asiatown IT Park,
Lahug, Cebu City 6000
Philippines
Worldwide Inquiries
[email protected]
www.mor.ph