designeditor

Couchdb _design documents editor, and some other nice features.

Note this editor uses parts or full code from:

Introduction

This application was build to leverage the basic code editor that is built in CouchDB. We started using CouchDB in 2012 and we faced an inflation of _design docs with associated views, list, shows etc and the actual tool was no more answering to our needs so we build a tool that is simple, included in CouchDB and allows to manage _design docs globally.

Enjoy using it, as we do!

How to install?

  1. Install Appzip https://github.com/dragos-constantin-stoica/designeditor/tree/appzip
  2. Clone this repository (git clone git://github.com/dragos-constantin-stoica/designeditor.git)
  3. Publish design.zip with Appzip
  4. Open you favorite web browser and go to: http://localhost:5984/designeditor/_design/editor/index.html
  5. Enjoy!

How to use it?

The application has 3 main tabs:

There is a clickable icon on the right most side with a menu:

Aftre susccessfully loading the applcation, you will see the list of databases loaded intro the database grid. You have a contextual menu for each database row. You have a global database menu:

The context menu for database

The content of Design Documents Editor

On the left side you have a collapsible panel with a tree grid contanting the list of all design documents from selected database. The following document types are recognized: views (map and reduce functions), lists, shows, updates, filters, validate_doc_update, and fulltext (index functions - used by Lucene). On the center - main area, you have a code editing zone. Each function (the code) is displayed in a new tab. Only for wiews you may rebuild the indexe from the context menu of the tree grid.

The tree grid is strucured as follows:

The tree grid has a main menu: Refresh, Collapse All, Expand All, Collapse level 1 (at design documents level) and Expand level 1

The context menu for design documents grid:

Level 0: database -- create new design document

Level 1: design document -- rename, duplicate, delete design document; change programming language; add new design document element (view, list, show, update, filter, fulltext, validate doc update)

Level 2: design document element -- new function element, delete function element, rebuild index and compact view available only for views. Validate doc update is a single function per design document so it is stored here and has the contextual menu of a function (see Level 3).

Level 3: function level -- rename, duplicate and delete function. For code editing just click on the leaf.

Replicator

The replication mechanism is similar with Futon and extended with design document ids to replicate and filters with parameters.

Basic replication:

Introduce database names for source and destination. Check if you want to create the destination database and if you want continuous replication.

Replication of selected documents only

Same as basic and you should check "Only selected documents". For local source database you may select the design documents, and you can introduce as a list of coma "," separated values the doc._id of documents you wanto to replicate.

Filtered replication

Same as basic replication and you should check "Replicate with Filter". For local source database you may select the filter. Optionaly you may complete query parameters in JSON format e.g. {"key":"value"}.

TODO

  1. implement security management (authentication, user and rights management)
  2. support for file attachment management
  3. display a list with all documents from a database
  4. display results for views, lists, shows
  5. IDE for couchapps - create and modify atteched web application files
  6. cancel replication (continuous) function

That's all for the moment. Please fork the code and help to complete this tool.

Thank you!

Happy CouchDB codding!