SlideShare a Scribd company logo
sails.js
realtime MVC framework for Node.js
who am i?
@mikermcneil
Design and develop javascript apps for
enterprise and startup customers
i have a startup called balderdash
Realtime used to
be kind of hard
XMPP
Comet
Reverse AJAX
Long polling
Flash sockets
WebSockets
Server-sent events
love at first sight
circa 2011
Node.js...
A lot easier now
Can we use Node.js for,
like, everything?
i wondered...
Can we use Node.js for,
like, everything?
i wondered...
maybe.
Lots
of different
kinds of
projects
There weren’t really any simple
and reproducible patterns for
structuring complicated Node.js
aplications top to bottom
Lots
of different
kinds of
projects
There weren’t really any simple
and reproducible patterns for
structuring complicated Node.js
aplications top to bottom
Could be working with an
existing client, or writing a new
client for a mobile web browser,
an automobile, a toaster, or god
knows what
Lots
of different
kinds of
projects
There weren’t really any simple
and reproducible patterns for
structuring complicated Node.js
aplications top to bottom
Could be working with an
existing client, or writing a new
client for a mobile web browser,
an automobile, a toaster, or god
knows what
Lots of different 3rd party
proprietary services to deal with
on the back-end -- there was no
standard way to integrate new
systems
Programming
realtime apps
was still not
trivial.
Socket.io and Express
messages/requests have to be
handled independently, which
leads to separate code bases for
realtime and traditional server
code.
Programming
realtime apps
was still not
trivial.
Socket.io and Express
messages/requests have to be
handled independently, which
leads to separate code bases for
realtime and traditional server
code.
Socket programming is a new
paradigm for many modern web
developers
Socket.io and Express
messages/requests have to be
handled independently, which
leads to separate code bases for
realtime and traditional server
code.
Socket programming is a new
paradigm for many modern web
developers
Questions about scalability
Programming
realtime apps
was still not
trivial.
Express wasn’t
“structured
enough”
Authentication has to be rolled
from scratch
Express wasn’t
“structured
enough”
Authentication has to be rolled
from scratch
No standard,
implementation-agnostic method
of working with datastores
Express wasn’t
“structured
enough”
Authentication has to be rolled
from scratch
No standard,
implementation-agnostic method
of working with datastores
Low level and free-form -- not a
lot of guidelines for teams used
to convention-over-configuration
frameworks
too bad.
we went with Node anyway.
so Sails.js was born
MVC structure
Sails.js is modeled after the same
convetion-over-configuration philosophy
you’re used to from frameworks like Rails,
Grails, Symfony, and Zend.
Controllers are just Express middleware
Views are ejs by default, but you can use
jade, etc. We rarely use them since we’re
normally making single page apps with
client-side templates.
Lightweight ORM
Kept querying semantics dead-simple and
adapter-agnostic whenever possible
Pulled the best of Active Record,
Hibernate, and Mongoose
Made it easy to add purpose-built adapters
at the app level
Policies
Policies are just more Express middleware
They can be chained together to “protect”
or preprocess requests for controllers
E.g. access control, storage quotas, or
anything else you’d want to use
middleware for
Node PDX: Intro to Sails.js
Socket.io Express
interpreter
Translated incoming socket.io messages into
Express requests
Translated res.send(), res.json(), and res.view()
to respond via the socket, as well as allowing
for streams
Added res.broadcast() and req.join() methods
for pubsub
Normalized configuration
Node PDX: Intro to Sails.js
Blueprints
Instead of something like Rails HTML
scaffolds, by default, when you generate a
model and controller, Sails serves an API
Built-in search, sort, pagination, and
complex queries
Authentication/access control can be built
on top using policies
Other
cool
stuff
CLI tool
REPL
Custom adapters
Optional server-side coffee
support
Automatic asset bundling (LESS
and coffeescript files are
compiled, merged with css and js,
and injected into the DOM,
minified in production mode)
Node PDX: Intro to Sails.js
Node PDX: Intro to Sails.js
let’s code things now
OK
Community is growing (1900 stars, 160 forks
on github, active IRC channel and Google
group)
CURRENT STATUS (V0.8.9)
Community is growing (1900 stars, 160 forks
on github, active IRC channel and Google
group)
My company and most of our customers are
using Sails in production
CURRENT STATUS (V0.8.9)
Community is growing (1900 stars, 160 forks
on github, active IRC channel and Google
group)
My company and most of our customers are
using Sails in production
Oldest running production Sails app has
been up for over 300 days
CURRENT STATUS (V0.8.9)
Roadmap
More adapters
More modularization to allow for
a la carte usage of framework
components
Grunt/Yeoman integration for
asset management and app
generation
Built-in support for associations
in ORM
Contribute to an adapter
Want to get involved?
Contribute to an adapter
Work on the yeoman/grunt
integration
Want to get involved?
Contribute to an adapter
Work on the yeoman/grunt
integration
Play with Sails and come up with
more cool shit
Want to get involved?
Questions?
Special thanks to:
@colinwren
@dcbartlett
@particlebanana
@tedkulp
Irl Nathan
Troy & NodePDX
Dan Dwyer & Joyent
& all the other excellent Sails.js contributors
Thanks!
@mikermcneil
mike@balderdash.co

More Related Content

What's hot (20)

PDF
Building a Single-Page App: Backbone, Node.js, and Beyond
Spike Brehm
 
PPTX
Mvvm knockout vs angular
Basarat Syed
 
PDF
NodeWay in my project & sails.js
Dmytro Ovcharenko
 
PPTX
AngularJS + NancyFx + MongoDB = The best trio for ultimate SPA by Bojan Velja...
Bojan Veljanovski
 
PPTX
Blazor
Rafał Hryniewski
 
PPTX
Lazy angular w/ webpack
Rich Snapp
 
PDF
NodeSummit - MEAN Stack
Valeri Karpov
 
PPTX
Blazor
Sandun Perera
 
PDF
Kickstarter Your Node.JS Application
Hengki Sihombing
 
PDF
Choosing the best JavaScript framework/library/toolkit
Hristo Chakarov
 
PDF
Isomorphic web application
Oliver N
 
PPTX
Codegen2021 blazor mobile
Jose Javier Columbie
 
PPT
Nodejs - Building a RESTful API
Sang Cù
 
PDF
JS Framework Comparison - An infographic
InApp
 
PPTX
jQuery Conference 2012 keynote
dmethvin
 
PDF
Going Node.js at Netflix
micahr
 
PDF
Node.js & Twitter Bootstrap Crash Course
Aaron Silverman
 
PDF
React server side rendering performance
Nick Dreckshage
 
PDF
Getting Started with Angular - Stormpath Webinar, January 2017
Matt Raible
 
PDF
On Selecting JavaScript Frameworks (Women Who Code 10/15)
Zoe Landon
 
Building a Single-Page App: Backbone, Node.js, and Beyond
Spike Brehm
 
Mvvm knockout vs angular
Basarat Syed
 
NodeWay in my project & sails.js
Dmytro Ovcharenko
 
AngularJS + NancyFx + MongoDB = The best trio for ultimate SPA by Bojan Velja...
Bojan Veljanovski
 
Lazy angular w/ webpack
Rich Snapp
 
NodeSummit - MEAN Stack
Valeri Karpov
 
Kickstarter Your Node.JS Application
Hengki Sihombing
 
Choosing the best JavaScript framework/library/toolkit
Hristo Chakarov
 
Isomorphic web application
Oliver N
 
Codegen2021 blazor mobile
Jose Javier Columbie
 
Nodejs - Building a RESTful API
Sang Cù
 
JS Framework Comparison - An infographic
InApp
 
jQuery Conference 2012 keynote
dmethvin
 
Going Node.js at Netflix
micahr
 
Node.js & Twitter Bootstrap Crash Course
Aaron Silverman
 
React server side rendering performance
Nick Dreckshage
 
Getting Started with Angular - Stormpath Webinar, January 2017
Matt Raible
 
On Selecting JavaScript Frameworks (Women Who Code 10/15)
Zoe Landon
 

Viewers also liked (10)

PDF
Sails.js Intro
Nicholas Jansma
 
PDF
How to Build a Great Web Application
Mike McNeil
 
PPT
NijmegenJS - SailsJS intro march 10 2016
Barry Nijenhuis
 
PDF
Sails Framework Instroduction
Leo Berdu
 
PDF
I Love APIs - Oct 2015
Mike McNeil
 
PPT
Developing Rest services with SailsJs by Andrey Kolodnitskiy
Lohika_Odessa_TechTalks
 
PDF
How to build cost and plan App Development - Fuerte International App Developers
Greg Jarrett
 
PDF
Richard rodger technical debt - web summit 2013
Richard Rodger
 
PPTX
Ax 2012 enterprise portal development
Moutasem Al-awa
 
PDF
How to Become a Thought Leader in Your Niche
Leslie Samuel
 
Sails.js Intro
Nicholas Jansma
 
How to Build a Great Web Application
Mike McNeil
 
NijmegenJS - SailsJS intro march 10 2016
Barry Nijenhuis
 
Sails Framework Instroduction
Leo Berdu
 
I Love APIs - Oct 2015
Mike McNeil
 
Developing Rest services with SailsJs by Andrey Kolodnitskiy
Lohika_Odessa_TechTalks
 
How to build cost and plan App Development - Fuerte International App Developers
Greg Jarrett
 
Richard rodger technical debt - web summit 2013
Richard Rodger
 
Ax 2012 enterprise portal development
Moutasem Al-awa
 
How to Become a Thought Leader in Your Niche
Leslie Samuel
 
Ad

Similar to Node PDX: Intro to Sails.js (20)

PPTX
Come Sail Away With Me (you guys): Node.js MVC Web API's Using Sails.js
Eric Nograles
 
PDF
JS Lab`16. Андрей Колодницкий: "Разработка REST сервисов на SailsJS"
GeeksLab Odessa
 
PPT
Sails js
Andrey Kolodnitsky
 
PDF
Intro to Sail.js
Nicholas McClay
 
PPTX
Like Ruby on Rails for Node - the Sails js framework
Stenio Ferreira
 
PDF
Rags to Open Source - AllThingsOpen, Raleigh, NC 2014
Mike McNeil
 
PDF
The Happy Path: Migration Strategies for Node.js
Nicholas Jansma
 
PDF
Sails.js: Rags to...Open Source
All Things Open
 
PPTX
MunichJS - node.js - from the beginning
Robert Prediger
 
PDF
Nodejs + Rails
Michał Łomnicki
 
PDF
Building Killer RESTful APIs with NodeJs
Srdjan Strbanovic
 
PDF
Node.js
Matt Simonis
 
PDF
Developing realtime apps with Drupal and NodeJS
drupalcampest
 
PDF
Introduction to sails.js
Amit Bidwai
 
PDF
SocketStream
Paul Jensen
 
PPT
Node js
Chirag Parmar
 
PDF
Matthew Eernisse, NodeJs, .toster {webdev}
.toster
 
PDF
NodeJS
LinkMe Srl
 
PDF
Realtime web apps rails
Ambert Ho
 
PPTX
Building and Scaling Node.js Applications
Ohad Kravchick
 
Come Sail Away With Me (you guys): Node.js MVC Web API's Using Sails.js
Eric Nograles
 
JS Lab`16. Андрей Колодницкий: "Разработка REST сервисов на SailsJS"
GeeksLab Odessa
 
Intro to Sail.js
Nicholas McClay
 
Like Ruby on Rails for Node - the Sails js framework
Stenio Ferreira
 
Rags to Open Source - AllThingsOpen, Raleigh, NC 2014
Mike McNeil
 
The Happy Path: Migration Strategies for Node.js
Nicholas Jansma
 
Sails.js: Rags to...Open Source
All Things Open
 
MunichJS - node.js - from the beginning
Robert Prediger
 
Nodejs + Rails
Michał Łomnicki
 
Building Killer RESTful APIs with NodeJs
Srdjan Strbanovic
 
Node.js
Matt Simonis
 
Developing realtime apps with Drupal and NodeJS
drupalcampest
 
Introduction to sails.js
Amit Bidwai
 
SocketStream
Paul Jensen
 
Node js
Chirag Parmar
 
Matthew Eernisse, NodeJs, .toster {webdev}
.toster
 
NodeJS
LinkMe Srl
 
Realtime web apps rails
Ambert Ho
 
Building and Scaling Node.js Applications
Ohad Kravchick
 
Ad

Recently uploaded (20)

PDF
July Patch Tuesday
Ivanti
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Python basic programing language for automation
DanialHabibi2
 
July Patch Tuesday
Ivanti
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Python basic programing language for automation
DanialHabibi2
 

Node PDX: Intro to Sails.js

  • 3. Design and develop javascript apps for enterprise and startup customers i have a startup called balderdash
  • 4. Realtime used to be kind of hard XMPP Comet Reverse AJAX Long polling Flash sockets WebSockets Server-sent events
  • 5. love at first sight circa 2011 Node.js...
  • 7. Can we use Node.js for, like, everything? i wondered...
  • 8. Can we use Node.js for, like, everything? i wondered... maybe.
  • 9. Lots of different kinds of projects There weren’t really any simple and reproducible patterns for structuring complicated Node.js aplications top to bottom
  • 10. Lots of different kinds of projects There weren’t really any simple and reproducible patterns for structuring complicated Node.js aplications top to bottom Could be working with an existing client, or writing a new client for a mobile web browser, an automobile, a toaster, or god knows what
  • 11. Lots of different kinds of projects There weren’t really any simple and reproducible patterns for structuring complicated Node.js aplications top to bottom Could be working with an existing client, or writing a new client for a mobile web browser, an automobile, a toaster, or god knows what Lots of different 3rd party proprietary services to deal with on the back-end -- there was no standard way to integrate new systems
  • 12. Programming realtime apps was still not trivial. Socket.io and Express messages/requests have to be handled independently, which leads to separate code bases for realtime and traditional server code.
  • 13. Programming realtime apps was still not trivial. Socket.io and Express messages/requests have to be handled independently, which leads to separate code bases for realtime and traditional server code. Socket programming is a new paradigm for many modern web developers
  • 14. Socket.io and Express messages/requests have to be handled independently, which leads to separate code bases for realtime and traditional server code. Socket programming is a new paradigm for many modern web developers Questions about scalability Programming realtime apps was still not trivial.
  • 16. Express wasn’t “structured enough” Authentication has to be rolled from scratch No standard, implementation-agnostic method of working with datastores
  • 17. Express wasn’t “structured enough” Authentication has to be rolled from scratch No standard, implementation-agnostic method of working with datastores Low level and free-form -- not a lot of guidelines for teams used to convention-over-configuration frameworks
  • 18. too bad. we went with Node anyway.
  • 20. MVC structure Sails.js is modeled after the same convetion-over-configuration philosophy you’re used to from frameworks like Rails, Grails, Symfony, and Zend. Controllers are just Express middleware Views are ejs by default, but you can use jade, etc. We rarely use them since we’re normally making single page apps with client-side templates.
  • 21. Lightweight ORM Kept querying semantics dead-simple and adapter-agnostic whenever possible Pulled the best of Active Record, Hibernate, and Mongoose Made it easy to add purpose-built adapters at the app level
  • 22. Policies Policies are just more Express middleware They can be chained together to “protect” or preprocess requests for controllers E.g. access control, storage quotas, or anything else you’d want to use middleware for
  • 24. Socket.io Express interpreter Translated incoming socket.io messages into Express requests Translated res.send(), res.json(), and res.view() to respond via the socket, as well as allowing for streams Added res.broadcast() and req.join() methods for pubsub Normalized configuration
  • 26. Blueprints Instead of something like Rails HTML scaffolds, by default, when you generate a model and controller, Sails serves an API Built-in search, sort, pagination, and complex queries Authentication/access control can be built on top using policies
  • 27. Other cool stuff CLI tool REPL Custom adapters Optional server-side coffee support Automatic asset bundling (LESS and coffeescript files are compiled, merged with css and js, and injected into the DOM, minified in production mode)
  • 31. Community is growing (1900 stars, 160 forks on github, active IRC channel and Google group) CURRENT STATUS (V0.8.9)
  • 32. Community is growing (1900 stars, 160 forks on github, active IRC channel and Google group) My company and most of our customers are using Sails in production CURRENT STATUS (V0.8.9)
  • 33. Community is growing (1900 stars, 160 forks on github, active IRC channel and Google group) My company and most of our customers are using Sails in production Oldest running production Sails app has been up for over 300 days CURRENT STATUS (V0.8.9)
  • 34. Roadmap More adapters More modularization to allow for a la carte usage of framework components Grunt/Yeoman integration for asset management and app generation Built-in support for associations in ORM
  • 35. Contribute to an adapter Want to get involved?
  • 36. Contribute to an adapter Work on the yeoman/grunt integration Want to get involved?
  • 37. Contribute to an adapter Work on the yeoman/grunt integration Play with Sails and come up with more cool shit Want to get involved?
  • 39. Special thanks to: @colinwren @dcbartlett @particlebanana @tedkulp Irl Nathan Troy & NodePDX Dan Dwyer & Joyent & all the other excellent Sails.js contributors