Reupholster makes developing a CouchDB Application easy. One click and you have all you need to start.
Reupholster has baked in support for BDD tests, continuous integration, automated deployments, and release management.
The format reupholster uses is compatible with node.couchapp.js, another popular CouchDB development tool. We are adding support for other tools in the future.
Click on this button to download and run reupholster. It should both download and run the application.
Java Java is required to run reupholster. Most computers will already have this installed. You may need to check here.
Google Chrome Chrome will list the download on the bottom of the page, and to the right of the filename is a small drop down arrow, click it. Select 'Always open files of this type'. See here for more details.
Not Working? If you are unable to launch reupholster, you can download it here
Reupholster runs as a tray icon. ![]()
Clicking on it will bring up this menu:
| Menu Item | Action |
|---|---|
| Exit | Exit Reupholster |
| Toggle Console | Show/Hide a console. This console helps you see what reupholster is doing under the hood. |
| Run Tests Local(Firefox) | Runs all the tests in the /tests directory using the firefox browser. |
| Run Tests Local(HtmlUnit) | Runs all the tests in the /tests directory using a headless browser. This is faster than firefox, and is the same method used for continuous integration. |
| Open Test Results | After tests are run, this item will be enabled. It will show an html report of the test results in your default browser. |
| Deploy To: | Deploy the current application to a remote CouchDB. See Deployment section. |
| Open App In Browser | Open your default browser and show the Couch Application. |
| Open Project Directory | Show the project directory using your default filesystem browser. |
ProjectRoot
.couchappignore
app.js
pom.xml
README.md
reupholster.json
+docs
Test.json
+test
defaultPageStory.groovy
+html
index.html
[ ".*\\.swp$", ".*~$" ]
ddoc = {
_id: '_design/app'
, views: {}
, lists: {}
, shows: {}
}
ddoc.views.byType = {
map: function(doc) {
emit(doc.type, null);
},
reduce: '_count'
}
}
This view would be accessed at http://localhost:5984/_design/app/_view/byType
/**
* A list function that outputs the same format that you
* use to post into the _bulk_docs API
*
* @author Max Ogden
*/
ddoc.lists.bulkDocs: function(head, req) {
var row, out, sep = '\n';
start({"headers":{"Content-Type" : "application/json"}});
if ('callback' in req.query) send(req.query['callback'] + "(");
send('{"docs":[');
while (row = getRow()) {
out = JSON.stringify(row.value);
send(sep + out);
sep = ',\n';
}
send("\n]}");
if ('callback' in req.query) send(")");
}
ddoc.validate_doc_update = function (newDoc, oldDoc, userCtx) {
if (newDoc._deleted === true && userCtx.roles.indexOf('_admin') === -1) {
throw "Only admin can delete documents on this database.";
}
};
couchapp.loadAttachments(ddoc, path.join(__dirname, 'html'));This is done at the end of app.js. It defines 'html' as the folder that holds the attachments. If you change this, rename the html file as well.
Warning Reupholster only supports this being called once.
node.couchapp.js supports this with multiple calls.
{
couch : {
host : "localhost",
port : 4977,
db : "couchhtml5"
},
test-couch : {
host : "ecko-it.iriscouch.com",
port : "5984",
db : "testsample",
username : "test"
},
stages : {
qa : {
host : "ecko-it.iriscouch.com",
port : "5984",
db : "sampleqa",
username : "test"
}
}
}
couch is the local (or remote) couch that is your working copy, updated as you change files. The Run Tests Local menu options run the tests against this couch.
test-couch is used for continuous integration. On every check-in reupholster will delete it, redeploy the app, and run the test against on this db.
stages Holds a list of couchdbs that can be deployed to.