I don't have any sample code... I'm sure theres some out there though.
I'd be very careful doing a "real" app with anything out of the box. I'm glad you're asking about validation because it all comes down to that. How do you protect your data? I just don't think you can trust allowing a JavaScript application to have direct access to the data itself. IT's too easy to tamper with. Sure DB security and readers fields and stuff are fine... but you need to keep an authorized user from manipulating the data as well.
I don't know of many examples about this. I've been looking and I've been trying to get this topic on NotesIn9 for a while. I'd like to know myself. I THINK the answer really is going to be a custom REST API in the XPages world... but I'm just not sure myself yet.
Good Luck. Please post if you find something.
Dave