On Sun, Jan 3, 2010 at 4:57 AM, Matteo Caprari <[email protected]> wrote: > Hello list. > > I've cranked up a simple couchapp that mimics stackoverflow.com (if you > squint). > > The idea is to understand couchdb better and provide the base for a > tutorial, but > before going any deeper, I'd like to hear from you what is wrong and > what is good.
This is great stuff. Really cool. I still don't understand all of how you've integrated things, but the documentation is really a great addition. I think this is a really cool use case. Thanks for sharing! One concern I have is that I don't think you need to be building custom _ids. You should be able to accomplish your lists and shows without messing with custom ids, instead using document parameters in views. Custom ids generally just add code-overhead to apps and increase the chances of spurious conflicts. To avoid double posts, PUT with a random docid should be idempotent, and fail on duplicate PUTs. If you can't do PUT from your client the _bulk_docs POST api should work to, if you specify ids. See how jquery.couch.js has an API for getting UUIDs from the Couch and then using them on new docs. Also, in trunk _show is no longer happy to have bogus ids, you'll get a 404. You can invoke with no docid at all to accomplish your use case. I'm happy to help more so that when you write your tutorial it embodies best practices. Just post any questions to this thread! Cheers, Chris > > So please have a look, but don't expect too much. > > Demo: http://caprazzi.net:5984/fortytwo/_design/fortytwo/index.html > Docs: http://caprazzi.net:5984/fortytwo/_design/fortytwo/docs/index.html > Source: http://github.com/mcaprari/fortytwo > > Docs are created with jsdoc-toolkit and a custom template. > I think we could integrate it with couchapp to obtain a "view source" feature. > > -- > :Matteo Caprari > [email protected] > -- Chris Anderson http://jchrisa.net http://couch.io
