Sails.js – The MVC Framework for Node.js – Node.JS Base

Sails.js – The MVC Framework for Node.js – Node.JS Base

0 1


Presentation for Sails.JS - SXSW13

On Github dcbartlett / presentation_sailsjs_sxsw13


The MVC Framework for Node.js

AHOY! Mateys!

Sail.js is a MVC framework built to run on node.js. You can have your project up and production ready in weeks instead of months.

Node.JS Base

Sails.JS is built on Node.JS. Well lets explain what Node.JS is a little.

What is Node.JS

Node.JS is an extremely fast and effcient server for high load applications.

Users of Ruby and Python will be familiar with Node.JS as it is modeled similarly to Ruby's Event Machine and Python's Twisted.

What is Node.JS

Node.JS is very scalable. Instead of threading processes like other systems, Node.JS handles processes as parallel scheduled child processes

Why do we use Node.JS?

  • It's asynchronous, which means better performance
  • Javascript is the one language to rule them all, whether we like it or not
  • It makes realtime apps way easier
  • It's IO/networking/disk libraries are modern.
  • Javascript uses closures, a powerful programming tool.

Sails.JS, Why you should use it?

We think you should use Sails.JS to build...well, eveything.

Sails.JS has a RESTful API built in.

Sails.JS creates a default codebase for your project.

Sails.JS allows for different databases.

Sails.JS has support for socket/websockets.


Sails.JS has a scaffolding system that generates a simple CRUD system for each model you create.

API is reachable both internally and via calls to a URI (<Operation>)


Blueprints are templates that are created for your project when you generate it.

sails new <project_name>

sails lift


Waterline is a brand new kind of storage and retrieval engine.

A uniform API for accessing different kinds of databases, protocols, and 3rd party APIs.

"Socket" to them!

Sails.js allows for the use of sockets and websockets by default.

Realtime IO apps for the Realtime World.

Diving Deeper

Works in Mobile Safari

Try it out! You can swipe through the slides and pinch your way to the overview.

Marvelous Unordered List

  • No order here
  • Or here
  • Or here
  • Or here

Fantastic Ordered List

One is smaller than... Two is smaller than... Three!

Markdown support

For those of you who like that sort of thing. Instructions and a bit more info available here.

<section data-markdown>
  ## Markdown support

  For those of you who like that sort of thing.
  Instructions and a bit more info available [here](

Transition Styles

You can select from different transitions, like: Cube - Page - Concave - Zoom - Linear - Fade - None - Default


Reveal.js comes with a few themes built in: Sky - Beige - Simple - Serif - Night - Default

* Theme demos are loaded after the presentation which leads to flicker. In production you should load your theme in the <head> using a <link>.

Global State

Set data-state="something" on a slide and "something" will be added as a class to the document element when the slide is open. This lets you apply broader style changes, like switching the background.



Custom Events

Additionally custom events can be triggered on a per slide basis by binding to the data-state name.

Reveal.addEventListener( 'customevent', function() {
	console.log( '"customevent" has fired' );
} );

Clever Quotes

These guys come in two forms, inline: The nice thing about standards is that there are so many to choose from and block:

For years there has been a theory that millions of monkeys typing at random on millions of typewriters would reproduce the entire works of Shakespeare. The Internet has proven this theory to be untrue.

Pretty Code

function linkify( selector ) {
  if( supports3DTransforms ) {

    var nodes = document.querySelectorAll( selector );

    for( var i = 0, len = nodes.length; i < len; i++ ) {
      var node = nodes[i];

      if( !node.className ) ) {
        node.className += ' roll';

Courtesy of highlight.js.

Intergalactic Interconnections

You can link between slides internally, like this.

Fragmented Views

Hit the next arrow...

... to step through ...

any type of view fragments This slide has fragments which are also stepped through in the notes window.

Fragment Styles

There's a few styles of fragments, like:








Spectacular image!

Export to PDF

Presentations can be exported to PDF, below is an example that's been uploaded to SlideShare.

Take a Moment

Press b or period on your keyboard to enter the 'paused' mode. This mode is helpful when you want to take distracting slides off the screen during a presentation.

Stellar Links

It's free

reveal.js and are entirely free but if you'd like to support the projects you can donate below. Donations will go towards hosting and domain costs.


BY Hakim El Hattab /