Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
146 lines (100 sloc) 4.55 KB
Alpha Simprini incorporates Pathology and Taxi.

Alpha Simprini


From Lower Earth Orbit, it's Alpha Simprini

Alpha Simprini is a browser application framework. It is a terrible awful mish-mash of ideas from Backbone and SproutCore/Ember.js

Modular (or something)

Alpha Simprini uses Pathology and Taxi to power the underlying Object model and event/databinding systems.

Also present are jwerty, jQuery, underscore, ShareJS, rangy and fleck

Tests are written in nodeunit.


No Templating Language

Alpha Simprini doesn't use a templating language. Your DOM is generated by code. The opinion behind this is that a templating language (even so-called 'logicless' templates) really want to be Classes with methods deep within their hearts. Except they don't end up doing a very good job of approximating the experience.

( You could certainly build a templating language on top of the Alpha Simprini dom generation and data-binding api. But why? )

Declarative Data Binding

Declare your data as it will live in the DOM. Ordered list? Selection models? Relationships? Simple fields?

MyApp.ThingyView = AS.View.extend
  content: ->
    @h1 "This is the thingy view!"
    @p "This thing is ", @thingy.description, "."
    @ul ->
      @bind @thingy.children, (child) ->
        @li -> @bind(

When the data changes, the DOM will be updated to reflect those changes automatically. All event handlers are cleaned up as objects are removed too.


Domain Modeling

Model your domain with fields, and relationships: hasMany, hasOne, belongsTo.

CookBook.Recipe = AS.Model.extend()
CookBook.Recipe.field "minutesToPrepare", type: Number
CookBook.Recipe.field "veggeratian", type: Boolean
CookBook.Recipe.field "title"

CookBook.Ingredient = AS.Model.extend()
CookBook.Ingredient.field "name"
CookBook.Ingredient.field "quantity", type: Number
CookBook.Ingredient.belongsTo "recipe"

CookBook.Recipe.hasMany "ingredients", 
  model: -> MyApp.Ingredient
  inverse: "recipe"

Real Time Collaboration

Alpha Simprini ships with support for real-time collaboration with ShareJS

  1. Configure the connection between Alpha Simprini and ShareJS
# The default ShareJsURL looks like this:
AS.ShareJsURL = "http://#{window? or 'localhost'}/sjs"
# Set it as neccessary for your server configuration.
  1. Mixin ShareJS support
Editor.Document = AS.Model.extend()
  1. Load your document by ID
document ="documentid")

At this point you can use the model as usual. You don't have to wait for the object to properly connect to the ShareJS server. Any chanegs you make to the object will be properly applied when the connection is made.


In your application initialize function construct your models and views.

Todo ="Todo")
Todo.Application = AS.Application.extend
  initialize: ->
    @list =
    @list_view = @view Todo.Views.List, list: @list
    @append @list_view


You can get a package of dependencies with html_package .

curl > vendor/minispade.js
gem install html_package
hip install \
    --file="" \ 


The best supported use of Alpha Simprini is through minispade. The javascript files downloaded by hip install are pre-wrapped in minispade

A copy of minispade can be downloaded here, or from Github.

curl > vendor/minispade.js

Get all those files into your application, for example, with the Rails asset pipeline:

#= require 'vendor/minispade'
#= require_dir 'vendor/alpha_simprini'

minispade.require 'alpha_simprini'

Now you're off to the races.