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

Realtime MVC with Sails.js

4cf764dcd5d1efc1de7051603bdf8215?s=47 JSIST
September 27, 2014

Realtime MVC with Sails.js

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

4cf764dcd5d1efc1de7051603bdf8215?s=128

JSIST

September 27, 2014
Tweet

Transcript

  1. Welcome to Istanbul

  2. Serdar Doğruyol Lead Developer @webBox @sdogruyol

  3. http://webbox.io

  4. <3 Ruby <3 Javascript

  5. Gorbachev Puff Puff Thunderhorse @gorbypuff

  6. First Let’s talk about Node

  7. • Javascript everywhere <3 • Freaking Fast • Perfect Fit

    for Realtime Apps • NPM Rocks
  8. is GREAT

  9. BUT

  10. hapi meteor flatiron actionhero koa geddy socketstream express zappa ???

    http
  11. Typical Node App • Everyone tries to reinvent the wheel

    • No common structure • Security problems
  12. None
  13. None
  14. None
  15. “Node on Sails for modern apps.” P.S: I’m looking at

    you Ruby on Rails
  16. Modern App? • APIs • Security • Realtime

  17. Sails • Convention over Configuration via MVC • Seamless Realtime

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

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

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

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

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

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

    be used with all the existing plugins. • Custom Generators • REPL • Internationalization
  25. None
  26. Thank You! @sdogruyol