I'm currently building an application framework that I can use with a variety of applications. The framework is written in PHP and has a RESTful API. I want the framework to enable single page applications using a combination of jQuery and my API.
I've looked into backbone.js but the problem I have with it and some others like it is the fact that you're essentially duplicating your business logic in js. Not only does this effectively double the size of your codebase, it also represents a security risk of sorts. By duplicating your business logic in js, you're showing the entire world what your back-end looks like which makes the jobs of malicious users that much easier.
That said I'm certainly not a front-end/js guru and I've really only seriously looked at backbone.js for this. My thinking is that there must be a good way to define dynamic js functions which accomplish essentially the same thing. What I'm looking for is a point in the right direction, even it's telling me how wrong I am.