5. App Template

Most of the time, you will use couchapp generate to create a new CouchApp with the default directory layout, example functions, and vendor directories. If you find yourself creating multiple CouchApps that always contain the same third-party or in-house files and libraries, you might consider creating a custom app template containing these files and using the --template option of the generate command to create your customized CouchApps.

After creating a new couchapp, you will have a project structure that looks something like this template project. The following libraries are included with your new CouchApp by default.


Custom templates are stored as subdirectories under the ~/.couchapp/templates directory. The name of the subdirectory is used in the --template option to specify which template files are to be used in the couchapp generate command. The default template name is app, so by creating ~/.couchapp/templates/app and placing files and directories under that path, you can replace almost all of the default files created by couchapp generate.


CouchDB API jquery.couch.js

The JQuery library included with CouchDB itself for use by the Futon admin console is used to interact with couchdb.


CouchApp Loader jquery.couch.app.js

A utility for loading design document classes into your Javascript application


A simple template framework