10
votes

I'm building an webapp using Node.js+Express.js+socket.io.js on the backend.

Do any of the popular front-end frameworks (Agility, Angular, Backbone, Closure, Dojo, Ember, GWT, jQuery, Knockback, Knockout, Spine, YUI, etc) integrate well with this backend for "real-time" applications?

I want my application to have a very "real-time" feel. Specifically, when a user submits a form I want the information to be sent using web sockets to the backend for validation and (if validation passes) to be updated in the database. Then, the server-side will use web sockets to send a confirmation that the data was saved or some list of errors. I will use the server's response to update the page using JavaScript.

I know all this can be done with any of the listed frameworks. I'm interested in features of particular frameworks that will help the framework integrate better with the Node-based backend than the other frameworks.

3
WebSockets are cool and everything, but if you do it right you can get very high performance for "ordinary" applications from plain old HTTP.Pointy
I can say that Backbone, Knockout and CanJS do a good job here. I don't think that there's any difference in working with any of these you cited if you use a RESTfull JSON backend.Ricardo Souza
Seconding @Pointy - your application may well be a great use case for websockets, but at least the scenario you described in your question sounds like a job for the good ol' xmlhttprequest. This is of course beside the point of your question, just had to go and say it anyway.jevakallio
Just a note from my preference: Take a look at canjs.us. It's fast, easy and reliable.Ricardo Souza

3 Answers

3
votes

Ember also does really fit.

See Charles Jolley's convoy which can be very helpful for client-side assets integration.

NPM's Ember package also comes with a sample app which may be a good start (based on convoy).

1
votes

Depends on the app and your use-case. I tend to generate html server side, so I still get the benefits of seo -- backbone and other js-rich frameworks on the client side have the unfortunate side effect of not being crawlable by Googlebot.

If you require authentication to use your app, then backbone or another one of the frameworks showcased at TODOMVC can be a good solution.

Typically when using socket.io on the server side, you would use it on the client side as well.

1
votes

I think angular.js is best for real-time applications.

  • Data Binding and Dependency Injection
  • Testing tools
  • Easy REST

Here is some information about framework.