Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Realtime MVC with Sails.js

JSIST
September 27, 2014

Realtime MVC with Sails.js

JSIST 2014
By : Serdar Doğruyol
http://jsist.org

JSIST

September 27, 2014
Tweet

More Decks by JSIST

Other Decks in Programming

Transcript

  1. BUT

  2. Typical Node App • Everyone tries to reinvent the wheel

    • No common structure • Security problems
  3. Sails • Convention over Configuration via MVC • Seamless Realtime

    powered by Socket.io • Automatic API generation via Blueprints. • Security & Access Control via Policies.
  4. MVC • Good ol’ MVC. Just like Rails, Django, Symfony

    e.g • Views are EJS by default. Can be anything you prefer ( Jade e.g)
  5. Waterline • Totally Database Agnostic ( SQL and NoSQL) •

    ORM + ODM • Same code to retrieve data from different adapters. • Easily Customizable
  6. Realtime = Easy • WebSockets <3 • Translates incoming socket

    messages to be compatible with all of your routes. • No need to have a separate code base
  7. Blueprints • Just like Rails’ scaffolds but for APIs. •

    Built-in search, sort, pagination and complex queries. • Can be protected / controlled via policies.
  8. 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.
  9. Associations • PostgreSQL + MongoDB. Seriously? • Cross-connection. Different hosts,

    users, easy legact data integration, e.g join two PostgreSQL databases with different schemas.
  10. Other Goodies • Flexible Asset Pipeline. Customizable, Grunt- based, can

    be used with all the existing plugins. • Custom Generators • REPL • Internationalization