Chaplin

Application architecture using Backbone.js.

Application architecture

Chaplin is an architecture for JavaScript applications using the Backbone.js library. Chaplin addresses Backbone’s limitations by providing a lightweight and flexible structure that features well-proven design patterns and best practices.

Some of Chaplin’s features:

Downloads

Chaplin is available in two builds: AMD and Common.js. Pick AMD if you want to build your app manually with require.js or common.js if you want to get stuff handled automatically with Brunch.

There is no “global variables” build, so Chaplin explicitly prohibits any using without module systems.

Latest release is 0.9.0 (changelog, diff from 0.8.0)

Chaplin depends on the following libraries:

If you’ll be using AMD version, you will also need an AMD module loader like RequireJS, Almond or curl to load Chaplin and lazy-module application modules.

Documentation

Documentation for Chaplin is available on GitHub.

There is also annotated source code available.

Articles, screencasts and talks:

Motivation

While developing several web applications using Backbone.js, we felt the need for conventions on how to structure such applications. Backbone is an easy starting point, but provides only basic, low-level patterns. Especially, Backbone provides little to structure an actual application. For example, the famous “Todo list” is not an application in the strict sense nor does it teach best practices how to structure Backbone code.

Backbone doesn’t intend to be an all-round framework so it’s not appropriate to blame Backbone for these deliberate limitations. Nonetheless, most Backbone use cases need a sophisticated application architecture.

This is where Chaplin enters the stage. Chaplin is derived from the codebase of moviepilot.com, a real-world single-page application. It draws attention to the top-level architecture: everything above simple routing, individual models, views and their binding.

Boilerplates

Chaplin needs a simple skeleton to start up and configure the core modules. We provide several boilerplates to make the start easier.

Examples

Are you using Chaplin too? Add your application to the wiki page and it will be featured here.

Ost.io

Ost.io is an open-source forum for GitHub projects (code). Uses Chaplin as app skeleton and Rails for backend.

Todos

Todos (code) is a port of the famous backbone todos example app. Uses localStorage to persist data.

Alternative versions:

Composing with Chaplin

Composing with Chaplin is an example that shows how Chaplin regions and compositions behave (code).

Facebook Like Browser

github.com/chaplinjs/facebook-example example uses Facebook client-side authentication to display the user’s Likes.

Tweet your Brunch

github.com/brunch/twitter is a simple twitter client. It uses Twitter client-side authentication to display user’s feed and to create new tweets.

Delicious

Delicious is a free service designed to be the best place to save what you love on the web, whether it's a video, picture, product, blog post, article or music. We then help you remember and find it later. It’s using Brunch as application builder and Chaplin as a framework on top of Backbone.

Delicious

Moviepilot

Moviepilot is a home for upcoming movies, where you can discover and read about the movies that interest and excite you.

Moviepilot

Community

Commercial support and training

9elements — Berlin/Bochum, Germany

One of the creators of Chaplin, is offering commercial support and training for Chaplin and Backbone-based JavaScript applications. 9elements is a software and design agency located in Berlin and Bochum, Germany. Send us a mail for more information: contact@9elements.com.

Paul Miller — Kharkiv, Ukraine

Chaplin & Brunch maintainer is offering consulting & training for all Backbone-related stuff. Contact him: paul@paulmillr.com.

Concordus Applications — Sacramento, CA, USA

Offering commerical support and training for Chaplin and Backbone-based JavaScript applications. Concordus Applications is an enterprise integration and software development firm. Email us for more information: support@concordusapps.com.

La Coopérative des Tilleuls - Lille, France

Offering commercial support and training for Chaplin and Backbone-based JavaScript applications. La Coopérative des Tilleuls is a software, training and web-design cooperative enterprise located in Lille, France. Send us a mail for more information: contact@les-tilleuls.coop.

Brought to you by

Ryan Leckey Ryan Leckey and others