How to Combine Backbone with Meteor
I'm currently working on a complex single page web app. It's something
like a charting program: you can select or add objects on a white page.
There's many types of objects. If you select some of type A objects, then
it will add/remove B/C/D objects based on a complex logic. I'm currently
using Backbone.Model for these objects. And Backbone.View for displaying.
It's a pretty standard MVC structure, with models for objects data,
controllers for managing models and views, and views for displaying. It's
all using DOM elements. The views are added, removed or updated (with CSS)
based on model data.
It works great and now I'm trying to add server side to save and load all
data to/from the server. I planned to write a REST API server with restify
for all the models.
Then I find meteor.js, the 'realtime', 'reactivity' and 'database
everywhere' features intrigue me. So it will greatly simplify my app if I
can save and load my models directly and let meteor to do the sync. And
the real time feature can be a great plus for my future features, such as
adding realtime collaboration.
But it seems meteor has a very different idea from Backbone on how a web
app is structured. How can I combine meteor with my current Backbone code?
Do you have any great suggestions? Thanks.
No comments:
Post a Comment