Duality

Create response interfaces with automatic fallbacks

Why use Duality?

Write once

Many client-side JavaScript frameworks re-implement URL routing, resource fetching and executing the resulting functions for you. But if you're using CouchDB to render server-side fallbacks with show, list and update functions you're already having to follow the CouchDB API. Now you have to implement everything twice! Duality was built to capitalize on the fact that both CouchDB and the browser speak JavaScript, and re-use the code you write for CouchDB to also render your client-side pages.

Duality provides the same environment server-side and client-side. That means you can run the same field validation at either end, render the same templates dynamically in the client or pre-render on the server. Duality automatically runs your code client-side when possible, and on CouchDB when JavaScript is not available. Helping you to write responsive web-interfaces without the overhead.

Search-Engine Friendly

Duality makes it easy to write CouchApps which go beyond the "single-page" AJAX app. You get clean URLs which point to server-rendered pages containing your core content, making it easy for search-engines to index and providing a useful fall-back.

You shouldn't need to break the web with "hash-bang" URLs that won't work at all in a browser without JavaScript. You should be able to describe fall-backs easily, then enhance the experience client-side.

Example projects using Duality