ie, would a user be able to alter the application themselves, and not just their data?
ie, would a user be able to alter the application themselves, and not just their data?
For those that are still confused a bit, couchapp takes advantage of the fact that couchdb is accessed via a RESTful interface. Documents and databases are identified and accessed with URLs.
Typically your client and couchdb speak JSON to each other. When you GET a resource, you just get back a JSON object.
However:
1. You can change the format of what you get back. You can also return back XML, HTML, XHTML, etc., instead of JSON.
2. You can add attachments to documents. Attachments can be images, html pages, anything. You can specify the content type and couchdb will happily serve those when you click the attachment resource URL.
CouchApp takes advantage of those 2 things. It renders html page templates saved as document attachments, and fills those in with data from some view (read: query), and then returns HTML.
It basically cuts out the traditional middle layer by performing that work inside the database.
Combined with the fact that replication works so well in couchdb, you can just move your web app just by replicating a database: a one-step process.
However, when the user attempts to replicate changes to another server (maybe the original source server, maybe another server not under their control) it is the validation functions on the target server that control which writes are allowed to proceed.
So if my http://jchrisa.net server only allows updates from me (for instance for blog posts), you can still replicate my blog to your machine, and edit posts there, but when you replicate the changes back to my server, they will be rejected by my validation function.
So any app written on couchapp can be considered to be modified by the end user if it's replicated to their machine. Then any application where you don't want users fiddling around with your 'source' is out of the question.
That said, there's plenty of applications that you'd want to pass along with the user's own data that you'd want the end users to fiddle with and improve.
With that in mind then, I'm guessing you can have validation functions that allow you to selectively update the design documents that you want from another person's changes, just as I can selectively replicate data from another person's copy of the couchapp.