Backbone.js provides a structure for JavaScript-heavy applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, and views with declarative event handling, while connecting it all to your existing application over a RESTful JSON interface. This Mobile Pack presents a single page JavaScript contact management app that demonstrates how to use Backbone with the Force.com REST API to retrieve data from Salesforce from either a Visualforce page or an external mobile web app implemented in PHP or Node.js.
The Mobile Pack for Backbone.js supports two deployment options for your HTML5 mobile app.
- To use the Mobile Pack with a Visualforce page (i.e. host the app on Force.com), follow this quick start.
- To deploy your HTML5 app externally (e.g. on Heroku) and source data from Salesforce, follow this quick start.
backbone.force.js
- a plugin library, originally written by Piotr Walczyszyn, but since extended for the Mobile Packs, that enables Force.com connectivity for Backbone's Model and Collection types.Samples/BackboneVFJQueryMobile
- a Visualforce page and supporting static resources that implements the single page contact management app.Samples/BackboneBootStrap
- sample mobile web applications that can be deployed outside Force.com; for example, to Heroku. Each serves up the same single page contact management app, but includes a back end implemented for a different web environment:Samples/BackboneBootStrap/nodejs
- for Node.jsSamples/BackboneBootStrap/php
- for PHP
For much more information on building enterprise mobile applications on Force.com with Mobile Packs, go to the Mobile Packs home page.