Live data from Hacker News

Sails.js: Realtime MVC framework for Node.js

balderdashy.github.com

31–40 of 107 posts

Re: Sails.js: Realtime MVC framework for Node.js

#31
post #19

Earlier quoted context omitted.

This is pretty standard presentation for Node.js packages.

Oh really? As a non-Node.js guy, I would love to see some others. Can you show me some examples please? Thanks!

Node.js packages are usually small and self-contained. Without typing/APIs Node relies heavily on documentation, so packages which are not well-documented will fall into oblivion quickly. Who'd write a OSS library which nobody can use?

My personal favorite, interactive docs!

http://coffeescript.org/

I like these ones because of the straightforwardness:

http://socket.io/

http://jade-lang.com/

http://mongoosejs.com/

And many more:

http://visionmedia.github.com/mocha/

http://meteor.com/

http://derbyjs.com/

http://compoundjs.com/

http://learnboost.github.com/stylus/

Almost all packages without a website have a README (npm spits out warnings if missing README):

https://npmjs.org/package/request

https://npmjs.org/package/browserify

https://npmjs.org/package/formidable

https://npmjs.org/package/forever

Re: Sails.js: Realtime MVC framework for Node.js

#32
post #4

This looks incredibly cool, but if there is one thing that I've learned, it's that less magic is generally better when building a real production application (vs a weekend project). While typing something like 'sails generate model User' is nice, I literally have no idea what that just did. In the video it then shows a user creating new attributes on the model via a REST API - what??(he even mistakenly adds a bad att…

Couldn't agree more. On a different topic, I've been toying with various JS MVC frameworks, but a lot of them tries to do their "magic" without actually explaining why the magic is necessary. These so called "conventions" at times hide way too many things, it actually makes it frustrating to understand. In the end, my choice came back to Backbone, which is the minimalistic framework.

Having said that, I'm trying to pick up NodeJS soon, what frameworks would you recommend to start off with? Express?

Re: Sails.js: Realtime MVC framework for Node.js

#33
post #7
post #6

Earlier quoted context omitted.

I can see the desire to be able to execute non-GET commands via the browser's address bar. Another way Sails could accomplish that would be to accept "?method=PUT|POST|DELETE" to mimic the desired HTTP method.

I don't think that solves the underlying problem of side effect-ful/dangerous GET requests that may be easily exploited via CSRF attacks. You really don't want to expose POST/PUT/DELETE actions via GET.

Avoiding GET requests is not a fool proof way to mitigate CSRF. If your website has just one XSS vulnerability an attacker can send POST requests. It's much better to use some kind of token that is always sent with your forms.

Re: Sails.js: Realtime MVC framework for Node.js

#34
post #24
post #23

Earlier quoted context omitted.

I guess you mean hard realtime. What usually on the web is called realtime is soft realtime IMHO.

Sure I get, but I think it just dilutes the meaning of the term "real-time" to use it in a soft context.

> Sure I get, but I think it just dilutes the meaning of the term "real-time" to use it in a soft context.

Soft realtime isn't a new thing. Chat has always been soft realtime.

Re: Sails.js: Realtime MVC framework for Node.js

#35
post #13

I think that there is some abuse of the term real-time these days: http://en.wikipedia.org/wiki/Real-time_computing

> I think that there is some abuse of the term real-time these days:

From your link:

Soft

The usefulness of a result degrades after its deadline, thereby degrading the system's quality of service.

A lot of web applications are soft realtime. Chat, Stock updates, news updates...hell twitter and fb updates are soft realtime

Re: Sails.js: Realtime MVC framework for Node.js

#36
post #4

This looks incredibly cool, but if there is one thing that I've learned, it's that less magic is generally better when building a real production application (vs a weekend project). While typing something like 'sails generate model User' is nice, I literally have no idea what that just did. In the video it then shows a user creating new attributes on the model via a REST API - what??(he even mistakenly adds a bad att…

Couldn't agree more. On a different topic, I've been toying with various JS MVC frameworks, but a lot of them tries to do their "magic" without actually explaining why the magic is necessary. These so called "conventions" at times hide way too many things, it actually makes it frustrating to understand. In the end, my choice came back to Backbone, which is the minimalistic framework. Having said that, I'm trying to p…

Yes, express is very simple, and easy to learn and write. It's also the most popular web framework for node.js.

It's less like rails/django and more like sinatra/flask.

Re: Sails.js: Realtime MVC framework for Node.js

#37
post #18

Judging from the description it does what the other 1000+ Node MVC frameworks do. What's the advantage of Sails over them? CRUD scaffolding is nothing new in Node's ecosystem. Apparently their edge is that users can manipulate the database on their own in the default scaffold? EDIT: Downvote without a comment is not constructive. This is a legitimate question. Care to explain?

I agree with you, seems that there are a million different frameworks but not enough community around one to make any of them really stick. If all the devs for those different projects could just put their heads together into one project...

It looks a lot like TowerJS or CompoundJS or FlatIron, but I'm still going to try it because there is still something lacking in those frameworks that I can't quite put my finger on.

Overall, though, I love CompoundJS with JugglinDB... but I tend to really love any framework I spend a lot of time with.

Re: Sails.js: Realtime MVC framework for Node.js

#38

This looks great! The automatic API generation is a killer feature that makes me want to try this out sometime soon. Only thing that seems strange to me is adding the /create, /update, and /destroy GET endpoints -- why not keep it RESTful?

Maintainer seems to be aware of the need to keep a conventional RESTful approach. The default state for `routes.js` includes a commented section about setting up HTTP verb routing.

Re: Sails.js: Realtime MVC framework for Node.js

#39
post #7

Earlier quoted context omitted.

I don't think that solves the underlying problem of side effect-ful/dangerous GET requests that may be easily exploited via CSRF attacks. You really don't want to expose POST/PUT/DELETE actions via GET.

Avoiding GET requests is not a fool proof way to mitigate CSRF. If your website has just one XSS vulnerability an attacker can send POST requests. It's much better to use some kind of token that is always sent with your forms.

There's nothing stopping anyone from sending POST requests to wherever he wants, even without an XSS. the same-domain origin policy only forbids you from reading the response, not from sending the request. CSRF-wise, POST requests are just as vulnerable as GET requests.

Also, if someone does manage to find an XSS vulnerability, using a CSRF token won't be any good - the attacker can simply read the token from your website and use it.

Re: Sails.js: Realtime MVC framework for Node.js

#40
post #31

Earlier quoted context omitted.

Oh really? As a non-Node.js guy, I would love to see some others. Can you show me some examples please? Thanks!

Node.js packages are usually small and self-contained. Without typing/APIs Node relies heavily on documentation, so packages which are not well-documented will fall into oblivion quickly. Who'd write a OSS library which nobody can use? My personal favorite, interactive docs! http://coffeescript.org/ I like these ones because of the straightforwardness: http://socket.io/ http://jade-lang.com/ http://mongoosejs.com/ An…

To be fair only one of these has a video
Post reply on HN