I just finished creating several models and a had to separately write all of their attributes in 1) a Rails ActiveRecord 2) a Rails database migration, and 3) a Backbone.js model. I’m not feeling very DRY. I assume the first step in DRYing up this problem would be to switch to node.js where I can use CoffeeScript on the back and front end (ideally reusing that same Backbone.js model), but what about the database schema? I realize I can create a framework that generates SQL from model attributes, but before I embark on that endeavor I was wondering if something like this already exists or is in development.
It would also be awesome if this framework could unify views and controllers so that I don’t have app/views, app/controllers, app/assets/javascripts/views, app/assets/javascripts/routers, and the like all defining similar things in different places.
Check out Derby, a node.js framework under active development, which tries to unify views and controllers (and a lot more):
I’m building a small hobby app with Derby and so far it’s been fun and mind-challenging. A unified new world has its own physics..
One thing to note is Derby is built on top of Racer, a “realtime model synchronization engine”; you may find it ‘heavy’ if you were expecting something like a light glue code that stitches together Backbone.js, express and some database layer.
Edit: other frameworks I haven’t yet looked into closely: