Getting started

Download the boilerplate

The easiest way to start a Chaplin application is to download the boilerplate. It contains a recent build of Chaplin as well as all JavaScript libraries Chaplin depends upon:

This is just the standard setup. You may substitute Underscore with Lodash, jQuery with Zepto and RequireJS with different other AMD module loaders like Curl.

The boilerplate comes in four flavours:

  • CoffeeScript code, if you develop your application in CoffeeScript
  • Plain JavaScript code, if you develop your application in normal JavaScript
  • Brunch skeleton, if you prefer using Brunch and synchronous common.js modules.
  • Yo generator, that provides a functional boilerplate Chaplin app out of the box using JavaScript, Stylus and Ejs. You also get access to a number of sub-generators which can be used to easily create individual models, views, collections and so on.

Hello World!

The boilerplate contains the necessary files which inherit from the core Chaplin class.

Integrating Chaplin into Rails 3

Use requirejs-rails gem.