Skip to content
zuk edited this page Mar 7, 2012 · 39 revisions

SAIL Docs

This is the starting point for SAIL documentation. Look here for general information about the framework. Language/Platform-specific documentation lives elsewhere (but is linked out from here).

What is it?

SAIL Smart SpaceSAIL or S3 for short — is a loose framework for building real-time networked apps (web-based, and otherwise).

SAIL lets various components (Web-based desktop apps, Android-based tablets, big-screen projected visualizations, custom Arduino hardware, or "intelligent" background agents) communicate asynchronously inside a common "space". SAIL is being actively developed to connect disparate technologies in "smart classrooms" or "smartrooms", but the framework makes sense in many other applications. For example you might use SAIL to build a web-based multiplayer game, a giant billboard display that shows input from smartphones, or a sensor net connected to monitoring agents.

SAIL uses XMPP as its underlying communication protocol. This allows (among other things) full push-pull communication in web-based apps. Also because XMPP is a well established platform-agnostic protocol, client libraries exist for most languages and a wide range of functionality is available off the shelf.

SAIL's architecture is:

Components (aka actors) in a SAIL-based system (apps, agents, sensors, peripherals, etc.) broadcast events to an XMPP groupchat channel (a common "space") without necessarily knowing or caring which other components might be listening. Each component also listens for certain kinds of events while ignoring others. For example, a sensor might pick up someone entering a room and trigger a person_entered event which in turn might be picked up by an agent that controls the room's lighting. Or a web-based app might generate a data_submitted event when a user fills out a form and a data processing agent might pick up that event and store its payload in a database.

This architecture allows for a highly modular loose-coupling of components. New agents or services can be added to a "space" at any time to enable new functionality without having to make changes to other existing components.

Getting Started

SAIL lets you build systems using a variety of languages and platforms. For example, we recently built a system that allowed a custom Android-based tablet app to talk to a Web-based smartboard interface written in JavaScript (the Android app is here and the JavaScript interface is here). To make this possible we've written a number of libraries that provide a layer of abstraction on top of of the XMPP protocol to make SAIL communication easier.

Currently the following libraries are available:

  • sail.js for client-side JavaScript
    • Used for writing client-side JavaScript apps such as the Jabberdy proof-of-concept multiplayer word guessing game. This is currently the most well documented and most functionally rich SAIL client library. See here for documentation: https:/educoder/sail.js/wiki
  • sail.rb for Ruby
    • We've been using Ruby to write server-side "agents" that encode much of the business logic in SAIL-based systems. In Jabberdy for example, players submit words and agents written in Ruby fetch definitions for those words from Google.
  • sail.java for Java
    • Pure-Java client libraries. Can be used to write agents and other kinds of components. Some examples are available here.
  • sail.java.android for Android
    • Java client libraries with additional bits for use in Androids apps. HelioRoom is one usage example.

SAIL Events

Because SAIL is based on an event-driven architecture, components generally do not talk directly to each other. Rather, components generate events to which other components react. Events are sent as XMPP messages to a groupchat channel to which all components are connected. See the SAIL Events page for details on the structure of a SAIL event.

Example Applications

Some (poorly documented) examples of existing SAIL-based apps are available here:

  • Jabberdy
  • HelioRoom — the Android app and the Web-based app
    • A classroom app built around the University of Illinois at Chicago's EVL HelioRoom solar system simulation. Kids in a classroom were given Android-based tablets where they could enter their observations about the simulation. The observations were picked up by the Web-based display on a large SMART board at the front of the class that allowed the teacher to sort and aggregate student data.

Note that some of these were built on top of older versions of the SAIL architecture, so some of the code you see there may not work with the most recent versions of libraries like sail.js.

Rollcall

Rollcall is something you will often see referenced in SAIL-based apps. It's a relatively simple directory service that provides web-based authentication and account management. SAIL apps can be built without it, but many of the applications we've built make use of it. It's a Ruby on Rails app and is relatively simple to deploy, although it is currently poorly documented. The source code is available here: https:/educoder/rollcall. Rollcall's API and architecture is documented here.