Is there a simpler Couchapp than Couchapp?
Asked Answered
T

5

15

Specifically, I am finding "evently" to be a bit of a hurdle to getting started with Couchapp. I really like the idea of an App served from CouchDB, but I want to get started without having to figure out "evently" ( which looks very interesting, like something I would want to investigate, but not right now ). I just want to make a simple CouchDB App using my existing javascript skills and my new CouchDB knowlege. Is there a simpler CouchApp than CouchApp? Or can I make it simpler? Or should I just drink the kool-aid and learn the "evently" stuff?

EDIT(3 months later):

Thanks everyone for the answers -- here's what I have figured out:

You can easily use the core features of CouchApp without drinking anyone's Kool-Aid. Specifically, "evently" is absolutely not required for serving an app from CouchDB. The core goodness of CouchApp is simply the "push" function, where it builds your "design doc" from files and folders -- all the rest seems to be a whole javascript framework that you don't have to use.

Once you get past the hurdle of figuring out how to actually serve pages and javascript from CouchDB, you can build your app any way you like. It only requires simple AJAX to get documents and save documents, so the possibilities are endless!

Thermosiphon answered 1/5, 2011 at 15:26 Comment(0)
R
3

You can use the _attachments folder as the document root of your application. For example, if the contents of _id is _design/testapp and .couchapprc is:

{
  "env": {
    "default": {
      "db": "http://USERNAME:PASSWORD@localhost:5984/testdb"
    }
  }
}

then the file _attachments/index.html is at http://localhost:5984/testdb/_design/testapp/index.html.

You can then use jQuery to build your app, doing queries whith getJSON. Or you can use the included wrappers loaded from vendor/couchapp/_attachments/loader.js.

You can also serve dynamic html using show or list functions.

Regularize answered 2/5, 2011 at 8:30 Comment(0)
W
10

If you're looking for an alternative, you might want to try Kanso. There's a tutorial on the website.

Kanso can also address Dominic Barnes' concerns of working with a single-page app making AJAX calls. Instead, you can have the views rendered client-side when possible (making it fast), but also render the core content server-side if necessary, so search engines and users without javascript can still get at it :)

Washwoman answered 29/5, 2011 at 16:21 Comment(1)
Looks like kanso is gone? The posted links don't work anymore.Martinmartina
E
4

I never liked Evently either, to be honest. However, I also gave up on CouchApps a while ago because it essentially requires you to use AJAX for your entire application, which isn't good from a usability standpoint.

In any case, if you still want to use CouchApps, I would recommend using Backbone.JS instead of Evently. (there's even a 3rd-party CouchDB connector build for backbone)

Essequibo answered 2/5, 2011 at 14:23 Comment(2)
I've seen people mention it before, very interesting concept and I'll definitely be checking it out. :)Essequibo
How is AJAX not good from a "good from a usability standpoint"? Please expand.Folkrock
R
3

You can use the _attachments folder as the document root of your application. For example, if the contents of _id is _design/testapp and .couchapprc is:

{
  "env": {
    "default": {
      "db": "http://USERNAME:PASSWORD@localhost:5984/testdb"
    }
  }
}

then the file _attachments/index.html is at http://localhost:5984/testdb/_design/testapp/index.html.

You can then use jQuery to build your app, doing queries whith getJSON. Or you can use the included wrappers loaded from vendor/couchapp/_attachments/loader.js.

You can also serve dynamic html using show or list functions.

Regularize answered 2/5, 2011 at 8:30 Comment(0)
N
1

[MANY YEARS LATER]

I've tested many different "couchapp" tools during the last years. These tools are all just fancy JSON builders that bump together written Javascript and attachments into a CouchDB document and push them to the database.

Even if you're not writing strict CouchApps (that hype has faded also, although they're still doable), you still need a tool to write CouchDB design documents.

Today, many of these tools have died -- specially Kanso, which tried to do so much --, and we're left with Python Couchapp, CouchDB Bootstrap, Erica and Ddoc Lab.

It is still complicated to manage design documents, but nowadays Ddoc Lab is my go-to solution, since it runs in the browser, has many interesting features (like including and preprocessing resources) and uses PouchDB -- possibly linked to a CouchDB for storing your project.

Nix answered 25/8, 2016 at 20:17 Comment(1)
I tried today to get anything to work using Python CouchApp, but while the tool might not have died, it seems at least on life support: Documentation is more confusing than helpful, nothing works as shown in the docs and couchapp.org redirects to couchdb.apache.org. Maybe the project recovers once CouchDB 2.0 has been out for a while.Metic
W
0

I have a simple couchapp replacement called caster.py. It does support push, pull, and generate canonical directory structure for a design document. Additionally it creates running samples for test cases for map/reduce functions which can be hooked into your dev process. It is a single clean python file with no frills.

https://github.com/vivekpathak/casters/releases/latest

Not only is it a complete package for managing code in couchdb design documents - it allows using professional programming tools like debuggers, profilers, version control, etc.

Willette answered 16/12, 2013 at 4:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.