The new couchapp.

72 views
Skip to first unread message

Benoit Chesneau

unread,
Apr 5, 2011, 3:25:43 AM4/5/11
to CouchApp
Hi all,

I've been busy last 2 months and didn't do much work except
solving bugs, but I've now a more cleaner view of my planning and the
goals I want to achieve.

My plan is to replace in the coming month the Python version and
replace
it by a fully executable application in Erlang. Last Python version
will
be released this week. Main advantage to use an erlang version is to
provide you only one executable on different platform. So installation
will be a lot easier. Since it's also depending on Erlang, we could
also
reuse some existing tools that will make support CouchDB easier.

The erlang version will be also different from the Python version.
While
it will still provide clone, generate, push, pushapps & pushdocs
commands, some features will be completely rewritten or improved based
on
the feedback I had:

- generate command: you will have the possibility to write your own
templates
to generate application folders or functions. By default it will now
create an empty application.
- vendor command: vendor will be improved to install any vendor
registred in an
online repository:
- vendor list: will list all vendors
- vendor search name : will search a vendor bt its name
- vendor install name : will install a vendor
- vendor update name : will update a vendor
- vendor uninstall : will uninstall a vendor
Vendor repository urls will be customizable. Also vendor will now be
abble to provide
their views/shows/... .
- sync command: new command will sync back and forth CouchDB
- check command: will check your application, and basic syntax errors.
- hook system. Completely rewritten. Old system won't be supported.
There
will be post/pre hoock that you put in your configuration file. Each
hooks is attached to a command name, and you pass to this hoock a
command line that will be executed in the shell::

hooks = [{pre, compile, "some file to execite}],

You will be abble to serialize different commands.
- configuration file. It's unclear now if the format of the
configuration
file will stay in json. It make it really difficult to edit, so
format will be probably changed to some erlang config format (my
preference) or ini (let me know what you prefer);

More probably, depending on timing.

The Erlang branch have been created and is mostly working. You can
find
it on my repo [1]. Currently implemented commands are clone, push,
generate .

Don't hesitate to help me on the development, also any feedback is
appreciated.

- benoît

[1] https://github.com/benoitc/couchapp/tree/erlang

Andrew Rabon

unread,
Apr 5, 2011, 4:08:43 AM4/5/11
to couc...@googlegroups.com
Sounds great Benoit! Moving to Erlang will certainly help with some of the cross platform issues, and probably increase speed too. I haven't wrapped my head around the whole vendor idea, though, but I'm sure I'll learn to love it.

Nicolas Steinmetz

unread,
Apr 5, 2011, 4:39:19 AM4/5/11
to couc...@googlegroups.com
Hi Benoit,

2011/4/5 Benoit Chesneau <bche...@gmail.com>

- configuration file. It's unclear now if the format of the
configuration
 file will stay in json. It make it really difficult to edit, so
 format will be probably changed to some erlang config format (my
 preference) or ini (let me know what you prefer);

As you try to be erland compliant, why not promote a erlang config format ? It would be a way for being more "homogenous".

Rest of your message sounds definitely great.

As alwaysdata (my current shared hosting provider) is also to provide support for CouchDB, I will definitely need to go back to my pieces of code I never finished so far :-/

Nicolas
-- 
Nicolas Steinmetz
http://www.steinmetz.fr - http://nicolas.steinmetz.fr/

Benoit Chesneau

unread,
Apr 5, 2011, 5:36:24 AM4/5/11
to CouchApp


On Apr 5, 10:39 am, Nicolas Steinmetz <nsteinm...@gmail.com> wrote:
> Hi Benoit,
>
> 2011/4/5 Benoit Chesneau <bchesn...@gmail.com>
>
> > - configuration file. It's unclear now if the format of the
> > configuration
> >  file will stay in json. It make it really difficult to edit, so
> >  format will be probably changed to some erlang config format (my
> >  preference) or ini (let me know what you prefer);
>
> As you try to be erland compliant, why not promote a erlang config format ?
> It would be a way for being more "homogenous".
>
I would like to do that, this is really my preffered way. Just want to
make sure it wouldn't make the config difficult for users.


> Rest of your message sounds definitely great.
>
> As alwaysdata (my current shared hosting provider) is also to provide
> support for CouchDB, I will definitely need to go back to my pieces of code
> I never finished so far :-/
>

didn't know alwaysdata was doing that. Do you know how they do that?
> Nicolas
> --
> Nicolas Steinmetzhttp://www.steinmetz.fr-http://nicolas.steinmetz.fr/

Dale Harvey

unread,
Apr 5, 2011, 8:25:30 AM4/5/11
to couc...@googlegroups.com, Benoit Chesneau
Hey Benoit

This is awesome news, good work.

as you know I wrote an erlang version of couchapp which I discontinued when I seen yours was started, a view issues I wanted to bring up where

couchapp clone should generate a .couchapprc, couchapp init / generate should both also generate a .couchapprc (init currently does?) I think I forced having a .couchapprc to exist before pushing as it made it explicit where the root was, the amount of times I have seen people be confused and push from the wrong directory, pretty much every time I see somebody start using couchapp (myself included)

I considered switching the config format but ended up sticking with json, the cost of adding mochihson and dealing with an uglier structure was worth it I felt to keep compatibility, thats a toss up though and moving to an erlang config does make sense.

Dealing with multiple design docs, this is currently a nightmare with couchapp, I moved to a format where

+ root
   + designdoc1
      + _attachments
   + designdoc2

this added an extra folder in the vast majority of times where people only had 1 design doc, however made dealing with multiple design docs pleasant, I wasnt "that" worried about changing the fs format because its easy to convert with a push / clone.

I started building a set of templates so people could get started with their library of choice, I will add evently / sammy / backbone + a few more
http://taxi.couchone.com/taxi/_design/taxi/index.html
It would be nice to revamp the site a little and make these things easy to find for people

I will switch to the erlang version today and help out with patches where I can, cheers for the awesome work
Dale

--
You received this message because you are subscribed to the Google Groups "CouchApp" group.
To post to this group, send email to couc...@googlegroups.com.
To unsubscribe from this group, send email to couchapp+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/couchapp?hl=en.


Peter Nolan

unread,
Apr 5, 2011, 8:49:41 AM4/5/11
to couc...@googlegroups.com
Sounds great man.

Regarding the taxi setup - is it possible to show/create a template that allows the user to create couchapps that work on both pc and mobile.  As in, when the couchapp starts it figures out what platform is loading the app and the app loads the appropriate jquery/jqueryMobile and css.

You'll probably have to open the jquery script and rip out the code for browser testing or something.  

either way,

keep it guys, sounds great.

-Pete

Nicolas Steinmetz

unread,
Apr 6, 2011, 4:57:12 AM4/6/11
to couc...@googlegroups.com
2011/4/5 Benoit Chesneau <bche...@gmail.com>

 
didn't know alwaysdata was doing that. Do you know how they do that?

I don't know for the details - It was just announced that support for CouchDB/MongoDB was the next step to be delivered. Tests will start from next week and it should be available this summer I think.

Cf : http://blog.alwaysdata.com/en/2011/03/29/database-administration/#comment-13107

Nicolas

tux_advocate_hpu

unread,
Apr 5, 2011, 8:49:32 AM4/5/11
to CouchApp
What advice would you give for migrating an old Python-based CouchApp
to the new Erlang-based CouchApp? Is there going to be a migration
path?

Secondly, should I wait to write a new CouchApp until the Erlang-based
CouchApp is ready? (This kind of goes hand-in-hand with a migration
path.)

Thanks a lot!

Benoit Chesneau

unread,
Apr 6, 2011, 11:45:27 AM4/6/11
to couc...@googlegroups.com, tux_advocate_hpu
On Tue, Apr 5, 2011 at 2:49 PM, tux_advocate_hpu <eca...@highpoint.edu> wrote:
>Is there going to be a migration
> path?
>
no

> Secondly, should I wait to write a new CouchApp until the Erlang-based
> CouchApp is ready?  (This kind of goes hand-in-hand with a migration
> path.)

use the python version for now


- benoît

Luciano Ramalho

unread,
Apr 6, 2011, 1:12:29 PM4/6/11
to couc...@googlegroups.com, Benoit Chesneau, tux_advocate_hpu
2011/4/6 Benoit Chesneau <bche...@gmail.com>:

> On Tue, Apr 5, 2011 at 2:49 PM, tux_advocate_hpu <eca...@highpoint.edu> wrote:
>> What advice would you give for migrating an old Python-based CouchApp
>> to the new Erlang-based CouchApp?  Is there going to be a migration
> path?
> no

I assumed there would me no problem, bacause couchapp (the tool) does
not interfere with the .js, .html, .css files that make up a CouchApp
(your application), and the layout of the files in the filesystem
pretty much follows the organization of the components within CouchDB.
It would be like switching from svn to git.

Have I missed something, Benoit?

BTW, congrats and thanks for the Erlang version of couchapp, Benoit. I
am a big fan of couchapp

--
Luciano Ramalho
supervisor de desenvolvimento || software development lead
BIREME/OPAS/OMS || BIREME/PAHO/WHO

Dave Cottlehuber

unread,
Apr 6, 2011, 11:12:48 PM4/6/11
to couc...@googlegroups.com, Benoit Chesneau

Firstly, without couchapp (the tool) I probably wouldn't have gotten
into CouchDB as much as I seem to have - including going to couchcamp
-woot! So thank-you Benoît and J Chris for the work that has & is
going into this. Having a native erlang couchapp tool will undoubtedly
allow us to do more cool stuff in future, and I agree its one less
thing people need to install. It will be a Good Thing :-)

CouchApps and CouchDB is an awesome way to introduce people to json,
jquery, ajax and web apps, with a very low barrier to entry, and to
extend through to clustering and real-world issues around CAP theorem,
bandwidth and latency constraints again without needing the complexity
of (say) Oracle RAC or MySQL clustering, or tackling Erlang to
illustrate the points. It's an absolutely awesome way to bring web
application programming to students.

So I still think there's space for a simple multiplatform executable
couchapp tool to allow people to start learning CouchDB, and building
and sharing P2P Couch Apps, possibly without even a local CouchDB.

Imagine schools, universities just having couchapp.exe installed, and
providing students a hosted CouchDB for their project. The current
couchapp tool in python, with the packaging Benoît has added for
windows and mac, does provide most of the core functionality people
need already. If it had direct support for ddocs of a different name
it would probably be perfect "as is". Docs for evently and $.couch are
improving all the time - it's coming together nicely.

Long story short, my gut feel is that having erlang + all its glorious
syntax is an additional hurdle that beginners shouldn't need until
later on - futon for admin, basic javascript and a simple push/pull
tool is a *great* starting place. Is there interest in the community
maintaining the python-based couchapp to support an easy on-ramp to
CouchDB?

Cheers
Dave

J Chris a

unread,
Apr 6, 2011, 11:39:57 PM4/6/11
to couc...@googlegroups.com
The hope is that we can connect it with the server so that users can just point a file dialog at a directory, and Couch will keep it synced with your design doc.

Chris

Typed on glass.

Dave Cottlehuber

unread,
Apr 6, 2011, 11:45:53 PM4/6/11
to couc...@googlegroups.com
FTW!!! sounds awesome!

Benoit Chesneau

unread,
Apr 9, 2011, 8:23:30 AM4/9/11
to couc...@googlegroups.com
On Thu, Apr 7, 2011 at 5:39 AM, J Chris a <jch...@couchone.com> wrote:
> The hope is that we can connect it with the server so that users can just point a file dialog at a directory, and Couch will keep it synced with your design doc.
>
> Chris
>
> Typed on glass.
>

I'm confused it's a little different from the couchapp tool. That was
my idea at couchcamp but since i didn't see real any support in...

On the other hand couchapp can be seen as a library and a tool, the
library would manage the transformations from fs to json, and the tool
could be used to deploy from anywhere and not only to send design docs
(it's already used to send any docs) . Is this what you mean?

- benoît.

Anup Bishnoi

unread,
Apr 7, 2011, 2:40:43 AM4/7/11
to couc...@googlegroups.com, Dave Cottlehuber
+1

Benoit Chesneau

unread,
Apr 9, 2011, 9:22:37 AM4/9/11
to couc...@googlegroups.com
On Thu, Apr 7, 2011 at 5:12 AM, Dave Cottlehuber <da...@muse.net.nz> wrote:
> Long story short, my gut feel is that having erlang + all its glorious
> syntax is an additional hurdle that beginners shouldn't need until
> later on - futon for admin, basic javascript and a simple push/pull
> tool is a *great* starting place. Is there interest in the community
> maintaining the python-based couchapp to support an easy on-ramp to
> CouchDB?
>

I'm not sure to follow :) I don't want to force people to learn
erlang. couchapp in Erlang won't change anything for users and since
the config format will be kept in JSON it will be the same thing but
improved. My point here is to ease the usage of Couchapp so people can
extend it not only in Python but using any languages via hooks.

Why Erlang?

First, because, I really like the tool you could design with Erlang.
The code is a lot more simple than the python one, and pattern
matching help a lot in this case.

Second the Erlang version version like the Python one could be
extended easily (plugins will exists) and we could imagine people to
design their own command/extension tool. As an example , adding
compass to current Couchapp is a just a matter of 10-20 lines of
codes, adding compression is also easy (see the compress hook) ,
autopush is a Couchapp extension too, and you can even write your own
layer on top:

- Eclipse extension
- Coffeeapp https://github.com/joshbohde/coffeeapp

This will be the same in the Erlang version. And even better you will
have the possibility to write it in the language you want, not only in
python.

Third, maybe we could imagine to distribute Couchapp with CouchDB and
some elements of Couchapp could be used to manage the system described
by jchris.

About the Python version, I'm speaking about it in another thread.

Did I answer to your questions ?


- benoit

Dave Cottlehuber

unread,
Apr 9, 2011, 10:08:58 AM4/9/11
to couc...@googlegroups.com
On 10 April 2011 01:17, Benoit Chesneau <bche...@gmail.com> wrote:
On Thu, Apr 7, 2011 at 5:12 AM, Dave Cottlehuber <da...@muse.net.nz> wrote:
> Long story short, my gut feel is that having erlang + all its glorious
> syntax is an additional hurdle that beginners shouldn't need until
> later on - futon for admin, basic javascript and a simple push/pull
> tool is a *great* starting place. Is there interest in the community
> maintaining the python-based couchapp to support an easy on-ramp to
> CouchDB?
>


Salut Benoît!

Sorry I wasn't clear here; I was thinking mainly of 2 things:

- the config file. I agree its not a big issue to learn erlang syntax for the couchapp file

- more was, today you can start with CouchDB using a hosted couch, and just have couchapp.exe on your mac/pc/whatever. so it's really quick to get going. If you need to install erlang/couchdb as well we make it more difficult to get started. but what jchris posted, saying we can get couchdb to "watch" a folder from the browser sounds much better.

Thanks yes. Also the erlang version is going to have lots of benefits from sharing same codebase as couch, I agree its a very good from from that perspective for people more comfortable with couchdb.

Thanks again for all the effort you put into developing this!

A+
Dave

A+
Dave

Benoit Chesneau

unread,
Apr 9, 2011, 10:14:48 AM4/9/11
to couc...@googlegroups.com
---------- Forwarded message ----------
From: Benoit Chesneau <bche...@gmail.com>
Date: Sat, Apr 9, 2011 at 3:55 PM
Subject: Re: The new couchapp.
To: Dave Cottlehuber <da...@muse.net.nz>


On Sat, Apr 9, 2011 at 3:38 PM, Dave Cottlehuber <da...@muse.net.nz> wrote:
> On 10 April 2011 01:17, Benoit Chesneau <bche...@gmail.com> wrote:
>>
>> On Thu, Apr 7, 2011 at 5:12 AM, Dave Cottlehuber <da...@muse.net.nz> wrote:

>> > Long story short, my gut feel is that having erlang + all its glorious
>> > syntax is an additional hurdle that beginners shouldn't need until
>> > later on - futon for admin, basic javascript and a simple push/pull
>> > tool is a *great* starting place. Is there interest in the community
>> > maintaining the python-based couchapp to support an easy on-ramp to
>> > CouchDB?
>> >
>>
>

> Salut Benoît!
> Sorry I wasn't clear here; I was thinking mainly of 2 things:
> - the config file. I agree its not a big issue to learn erlang syntax for

> the file however.
this issue is now fixed :)

> - more was, today you can start with CouchDB using a hosted couch, and just
> have couchapp.exe on your mac/pc/whatever. so it's really quick to get
> going. If you need to install erlang/couchdb as well we make it more

> difficult to start.

That's indeed a good point.

>but what jchris posted, saying we can get couchdb to
> "watch" a folder from the browser sounds much better.

from the browser isn't really possible since the browser don't have
direct access to the filesystem (or at least shouldn't be), probably
possible by an extension though. I think the is idea is to have a
couchdb installed and with a switch in the config tell him to watch a
folder as a design doc.

- benoît

Reply all
Reply to author
Forward
0 new messages