Realtime MVC with Sails.js
-
Upload
serdar-dogruyol -
Category
Technology
-
view
106 -
download
1
Transcript of Realtime MVC with Sails.js
Welcome to Istanbul
Serdar DoğruyolLead Developer @webBox
@sdogruyol
http://webbox.io
<3 Ruby
<3 Javascript
Gorbachev Puff Puff Thunderhorse@gorbypuff
First
Let’s talk about Node
• Javascript everywhere <3
• Freaking Fast
• Perfect Fit for Realtime Apps
• NPM Rocks
is
GREAT
BUT
hapi
meteor
flatiron actionhero
koa
geddy
socketstream
express
zappa
???
http
Typical Node App
• Everyone tries to reinvent the wheel
• No common structure
• Security problems
“Node on Sails for modern apps.”
P.S: I’m looking at you Ruby on Rails
Modern App?
• APIs
• Security
• Realtime
Sails
• Convention over Configuration via MVC
• Seamless Realtime powered by Socket.io
• Automatic API generation via Blueprints.
• Security & Access Control via Policies.
MVC
• Good ol’ MVC. Just like Rails, Django, Symfony e.g
• Views are EJS by default. Can be anything you prefer ( Jade e.g)
Waterline
• Totally Database Agnostic ( SQL and NoSQL)
• ORM + ODM
• Same code to retrieve data from different adapters.
• Easily Customizable
Realtime = Easy
• WebSockets <3
• Translates incoming socket messages to be compatible with all of your routes.
• No need to have a separate code base
Blueprints
• Just like Rails’ scaffolds but for APIs.
• Built-in search, sort, pagination and complex queries.
• Can be protected / controlled via policies.
Policies• Reusable
• Basically Express Middleware
• Preprocessing or protecting to handle requests for controllers.
• Can be used for access control, authentication,request limiting or anything you can think of.
Associations
• PostgreSQL + MongoDB. Seriously?
• Cross-connection. Different hosts, users, easy legact data integration, e.g join two PostgreSQL databases with different schemas.
Other Goodies
• Flexible Asset Pipeline. Customizable, Grunt-based, can be used with all the existing plugins.
• Custom Generators
• REPL
• Internationalization
Thank You!@sdogruyol