Developing Scalable Applications

Sails.js

Introduction

user

Shlomi Fruchter


LATEST POSTS

Write your own programming language 19th May, 2014

Finding a home for your docker container 30th March, 2014

Web Application Frameworks

Sails.js

Posted on .

Sails.js is like Ruby on Rails for node.js. It takes all the nice things from RoR and put them on top of node and express.

If you still haven’t checked sails, I suggest you give it a try. It is far from being production ready – there is still no real solution for associations between data objects (relationships / foreign keys), but they are working on it.

I tried to use it for a simple app and it’s really nice and easy to use. I’m pretty happy about the stack I used, the components played nice with each other:

  • Server side
    • Sails.js
    • MongoDB
  • Front-end
    • Marionette / Backbone
    • Compass
    • Bootstrap

You define your models and get ruby like REST API out of the box, then you can define controllers to write custom handlers and logic. Since backbone was originally written to work with RoR, it’s pretty easy to connect it to the REST API that sails.js generates.

The nice thing about Sails.js is that it’s modular and let you work directly with the frameworks it depends on. The routing is defined using Express framework so if you know it you should feel at home. The ORM framework it uses is called Waterline and can be used on its own even without sails. Database integration is defined by Adapters, in the mean time there is support for MySql, Postgres and MongoDB only.

Node, Sails and Backbone mark an important direction: create modular, small and independent components that developers can mix and match to create higher level applications, while preferring convention over configuration, but allowing flexibility where the user wants it.

Edit (20/04/2014): sample code can be found here: https://github.com/shlomifruchter/storyjs

profile

Shlomi Fruchter

Comments
user

Author sandman

Posted at 4:10 am April 16, 2014.

I’ve been looking for a template using Sails and Marionette and your post was the first I came across…by any chance did you push your simple app to github?

Thanks for sharing Shlomi!

Reply

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

View Comments (4) ...