26
Welcome to Istanbul

Realtime MVC with Sails.js

Embed Size (px)

Citation preview

Page 1: Realtime MVC with Sails.js

Welcome to Istanbul

Page 2: Realtime MVC with Sails.js

Serdar DoğruyolLead Developer @webBox

@sdogruyol

Page 3: Realtime MVC with Sails.js

http://webbox.io

Page 4: Realtime MVC with Sails.js

<3 Ruby

<3 Javascript

Page 5: Realtime MVC with Sails.js

Gorbachev Puff Puff Thunderhorse@gorbypuff

Page 6: Realtime MVC with Sails.js

First

Let’s talk about Node

Page 7: Realtime MVC with Sails.js

• Javascript everywhere <3

• Freaking Fast

• Perfect Fit for Realtime Apps

• NPM Rocks

Page 8: Realtime MVC with Sails.js

is

GREAT

Page 9: Realtime MVC with Sails.js

BUT

Page 10: Realtime MVC with Sails.js

hapi

meteor

flatiron actionhero

koa

geddy

socketstream

express

zappa

???

http

Page 11: Realtime MVC with Sails.js

Typical Node App

• Everyone tries to reinvent the wheel

• No common structure

• Security problems

Page 12: Realtime MVC with Sails.js
Page 13: Realtime MVC with Sails.js
Page 14: Realtime MVC with Sails.js
Page 15: Realtime MVC with Sails.js

“Node on Sails for modern apps.”

P.S: I’m looking at you Ruby on Rails

Page 16: Realtime MVC with Sails.js

Modern App?

• APIs

• Security

• Realtime

Page 17: Realtime MVC with Sails.js

Sails

• Convention over Configuration via MVC

• Seamless Realtime powered by Socket.io

• Automatic API generation via Blueprints.

• Security & Access Control via Policies.

Page 18: Realtime MVC with Sails.js

MVC

• Good ol’ MVC. Just like Rails, Django, Symfony e.g

• Views are EJS by default. Can be anything you prefer ( Jade e.g)

Page 19: Realtime MVC with Sails.js

Waterline

• Totally Database Agnostic ( SQL and NoSQL)

• ORM + ODM

• Same code to retrieve data from different adapters.

• Easily Customizable

Page 20: Realtime MVC with Sails.js

Realtime = Easy

• WebSockets <3

• Translates incoming socket messages to be compatible with all of your routes.

• No need to have a separate code base

Page 21: Realtime MVC with Sails.js

Blueprints

• Just like Rails’ scaffolds but for APIs.

• Built-in search, sort, pagination and complex queries.

• Can be protected / controlled via policies.

Page 22: Realtime MVC with Sails.js

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.

Page 23: Realtime MVC with Sails.js

Associations

• PostgreSQL + MongoDB. Seriously?

• Cross-connection. Different hosts, users, easy legact data integration, e.g join two PostgreSQL databases with different schemas.

Page 24: Realtime MVC with Sails.js

Other Goodies

• Flexible Asset Pipeline. Customizable, Grunt-based, can be used with all the existing plugins.

• Custom Generators

• REPL

• Internationalization

Page 25: Realtime MVC with Sails.js
Page 26: Realtime MVC with Sails.js

Thank You!@sdogruyol