Sails.js

Zohar Arad. © 2013

Why Sails?

After all, there are so many other frameworks

A framework is a set of tools and conventions
brought together to solve a problem.

A good framework should

  • Reduce the need for boilerplate code
  • Lift the burden of making trivial decisions
  • Encourage clear conventions and style
  • Provide automation for repetitive tasks

With Sails, you get

  • Familiar MVC structure
  • Conventions over Configuration
  • Out-of-the-box REST and WebSockets
  • Modular ORM
  • Express.js underneath

Let's Dig Deeper

Source: simpsons.wikia.com/wiki/Gravedigger_Billy

Waterline

Sails' underlying ORM Framework

Waterline

  • One ORM to rule them all! (ActiveModel)
  • Model-level adapters
  • Modular storage adapters
  • Well documented and easy to extend

Waterline - The Gain

  • Business logic abstraction (no adapter dependency)
  • Flexible per-model storage
  • Popular DB support with more on the way

Controllers

REST and WebSockets auto-magic

Source: simpsons.wikia.com/wiki/Gravedigger_Billy

Controllers

  • Sensible defaults
  • Per-controller configuration
  • ACL thanks to policies (works great with Passport)
  • Automatically RESTful all the way down to the model
  • WebSockets works on the same RESTful resources

Controllers - The Gain

  • Reduced boilerplate
  • Immediate REST
  • Real-Time support
  • Tunable security

Developer Happiness

We're not masochists

Developer Happiness

  • Component Generator
  • Interactive Console
  • Asset Management
  • LESS support out of the box
  • Jade, Handlebars and others supported through standard Node modules

Developer Happiness - The Gain

  • Automation
  • Interactive Debugging
  • No asset management hell
  • Familiar tools at your fingertips

Final Thoughts

Before a quick demo

Time is precious! Spend it on what matters most - Your code

Having too much choice is not always a good thing!

Yes, I'm looking at you, PHP, Python and Node.js

Sails.js is flexible enough to support whatever
tool-set you enjoy using,

yet, it employs enough conventions, boilerplate and
guidelines to keep you focused.

It's the first Node.js framework that actually made me say Wow!

Source: jiniandjia.com/blog/?tag=loans

Demo App

Real-Time Dashboard


Find the code on Github