Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a simpler Couchapp than Couchapp?

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!

like image 516
Nick Perkins Avatar asked May 01 '11 15:05

Nick Perkins


4 Answers

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 :)

like image 110
Caolan Avatar answered Nov 10 '22 12:11

Caolan


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)

like image 39
Dominic Barnes Avatar answered Nov 10 '22 12:11

Dominic Barnes


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.

like image 33
Marcello Nuccio Avatar answered Nov 10 '22 13:11

Marcello Nuccio


[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.

like image 28
fiatjaf Avatar answered Nov 10 '22 13:11

fiatjaf