• Stars
    star
    269
  • Rank 152,636 (Top 4 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created over 13 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

tool to manage couchapps

Erica

Making CouchDB development easy

Erica is a tool that helps you to create couchdb design docs, and web applications (couchapps), and generally get files in and out of CouchDB.

Requirements

Runtime

  • Erlang R14B04 or higher with crypto support

Compiling

  • gcc
  • rebar
  • git
  • erlang-src

Installing Dependencies on Debian/Ubuntu

sudo apt-get install rebar erlang-src erlang-xmerl erlang-parsetools

Installing Dependencies on Fedora

sudo yum install erlang-rebar

Download

  • Signed releases are available from dch's site.
  • Unix users will need to chmod +x erica and ensure it is on your PATH.
  • Windows users should use erica.cmd and simply drop it into your %COUCHDB%/bin directory.

Installation

To install it from source you will have to clone the repository from github. Dependencies will be fetched during the build.

$ git clone git://github.com/benoitc/erica.git

You can also download the latested tarball available on the download page:

$ curl -L -O https://github.com/downloads/benoitc/erica/erica-<vsn>.tar.gz

Then build the sources:

$ cd erica
$ make

Then you can use the generated script erica .

To install it on your system, run the command line:

$ make install

Upgrade from the source repository

When you want to upgrade from the source repository, run the following commands:

$ git pull --rebase
$ make upgrade
$ make install

Quick Start: Design Docs

So need to make and mange design docs for couchdb?

# erica create-app
# cd myapp
# erica push myapp

Go ahead and create views, shows, lists, etc.

Quick Start: Webapps

To create a webapp, follow this pattern.

# erica create-webapp
# cd myapp
# erica push myapp

This is an 'attachment first' style couchapp. Anything related to the design doc lives in _ddoc.

After any changes, push it to your couchdb node

$ erica push http://127.0.0.1:5984/testdb

Then visit the result on

http://127.0.0.1:5984/testdb/_design/myapp/_rewrite/

That's it.

Note: By default the CouchDB Node uri is 127.0.0.1:5984 so you could just use the db name in push command line if you want:eri

$ erica push testdb

Detailed Usage:

# erica command

Where available commands are:

push           [options...] [dir]    dest  push anything to couchdb
create-webapp  [appid=myapp] ...     Create a webapp. Default:
                                     appid=myapp, lang=javascript
create-ddoc    [appid=myapp] ...     Create a blank ddoc, Default:
                                     appid=myapp, lang=javascript
create-app     appid=AppID lang=Lang Create a blank couchapp, Default:
                                     appid=myapp, lang=javascript
create         template= [vars...]   create an application using a
                                     template
init                                 initialize a .couchapprc
clone          [option] source dir   clone a document from couchdb
browse                               display the erica in the
                                     browser.
web            port=Port [dir]       launch the web ui
help                                 Show the program options
version                              Show version information

And more general options

$ erica -h
Usage: erica [-h] [-c] [-v] [-f] [-V] [--is-ddoc <is_ddoc>] [--docid <docid>] [--atomic <atomic>] [...] <command,...>

  -h, --help		Show the program options
  -c, --commands	Show available commands
  -v, --verbose		Be verbose about what gets done
  -f, --force		Force
  -V, --version		Show version information
  --is-ddoc		Tell to push command if you send a design document or not.
  --docid		Set docid with push command
  --atomic		Send attachments inline with push command
  command		Command to run (e.g. push)

1 . About the Design Doc

You can use a template to create your design doc. It will create a simple project that you can use for a start:

$ erica create-ddoc appid=myapp lang=javascript
==> tmp (create-app)
Writing myapp/_id
Writing myapp/language
Writing myapp/.couchapprc

$ ls -fla myapp/
total 24
drwxr-xr-x   6 benoitc  wheel  204 Jun  7 11:13 .
drwxrwxrwt  13 root     wheel  442 Jun  7 11:13 ..
-rw-r--r--   1 benoitc  wheel   18 Jun  7 11:13 .couchapprc
drwxr-xr-x   2 benoitc  wheel   68 Jun  7 11:13 _attachments
-rw-r--r--   1 benoitc  wheel   13 Jun  7 11:13 _id
-rw-r--r--   1 benoitc  wheel   10 Jun  7 11:13 language

Erica has created an _attachments folder in the myapp folder. This is where you can put all the attachments. You can put your views functions in views/viewname/{map,reduce}.js , shows in shows folder, lists in lists, ... See the wiki for more info (soon).

  • _id is where you set the document id
  • languages is where you set the language of your application
  • .couchapprc is where you set some config infos for your app.

Note: erica is language agnostic, so if you want to create your couchapp in coffescript, just replace javascript by coffescript or use the language you want if an couchapp server exists for it.

2. Clone

Did you see an interesting couchapp you want to reuse? Or just working with a friend on the same couchapp ? With the clone command you can replicate a couchapp on your filesystem, edit it and push the results after:

$ erica clone http://127.0.0.1:5984/testdb/_design/myapp

This command will clone the couchapp myapp in the myapp folder. If you want to clone it to another folder, just do:

$ erica clone http://127.0.0.1:5984/testdb/_design/myapp mynewapp

More

Add an .ericaignore file to the root of your app, as a JSON array of regular expressions of files or folders to be excluded from pushes.

["passwords.txt", "^\.ssh", "^\.*"]

When using templates, follow this format

# erica create template=name

Provided templates are for now:

  • web (the template used with the create-web command)
  • ddoc (the default create used for create-ddoc command)
  • example: a simple couchapp example
  • couchapp: a simple template with the good old couchapp javascript library.

You can add your own template in ~/.erica/templates.

Getting Help

If you have any questions contact us on irc freenode #couchapp or on the mailing-list: http://groups.google.com/group/couchapp .

More Repositories

1

gunicorn

gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX, fast clients and sleepy applications.
Python
9,757
star
2

hackney

simple HTTP client in Erlang
Erlang
1,322
star
3

restkit

an HTTP resource kit for Python
Python
405
star
4

offset

Python
377
star
5

gaffer

control, watch and launch your applications and jobs over HTTP.
Python
363
star
6

http-parser

HTTP request/response parser for python in C
C
337
star
7

tproxy

simple TCP routing proxy
Python
265
star
8

couchdbkit

CouchDB python framework
Python
265
star
9

couchbeam

Apache CouchDB client in Erlang
Erlang
238
star
10

flower

collection of modules to build distributed and reliable concurrent systems in Python.
Python
207
star
11

socketpool

Generic socket pool
Python
163
star
12

cowboy_revproxy

simple TCP routing proxy (layer 7) in erlang
Erlang
86
star
13

econfig

simple Erlang config handler using INI files
Erlang
79
star
14

hooks

generic plugin & hook system for Erlang applications
Erlang
72
star
15

erlang-metrics

A generic interface to different metrics systems in Erlang.
Erlang
70
star
16

dj-webmachine

Django REST layer
Python
59
star
17

erlang-nat

implements NAT handling facilities for Erlang applications
Erlang
57
star
18

couchdbproxy

Simple multinode couchdb proxy
Erlang
57
star
19

dnssd_erlang

Erlang interface to Apple's Bonjour DNS Service Discovery implementation
Erlang
46
star
20

nat_upnp

Erlang library to map your internal port to an external using UNP IGD
Erlang
42
star
21

uzmq

libuv interface for ZeroMQ
Python
34
star
22

ejson

EJSON - decode and encode JSON into/from Erlang terms (from CouchDB project)
C
32
star
23

mochicow

mochiweb adapter for cowboy.
Erlang
29
star
24

dj-revproxy

simple reverse proxy for django.
Python
28
star
25

hroute

simple HTTP proxy based on tproxy
Python
28
star
26

inet_cidr

CIDR erlang library
Erlang
27
star
27

mimerl

library to handle mimetypes
Erlang
27
star
28

sieve

sieve is a simple TCP routing proxy (layer 7) in erlang
Erlang
26
star
29

opencouch

A embeddable document oriented database compatible with Apache CouchDB
Erlang
22
star
30

gunicorn-recipes

Collection of recipe and examples to help in gunicorn deployement, installation and configuration.
19
star
31

nymphormation

Nymphormation is a Couchapp that allow people to share links or news .
JavaScript
19
star
32

rebar3_path_deps

A rebar plugin to specify path dependencies.
Erlang
19
star
33

couch_zmq

zeromq endpoint for couchdb.
Erlang
18
star
34

noddycouch

minimal couchdb toolkit for nodejs.
JavaScript
17
star
35

afgwardiary

couchapp to render afgwardiary data from wikileaks
JavaScript
16
star
36

upnp

Erlang UPNP Module
Erlang
14
star
37

couchc

minimal couchdb internal API wrapper
Erlang
14
star
38

couchapp-ng

Couchapp Engine
Erlang
14
star
39

couchdb

My CouchDB hack repository
JavaScript
14
star
40

cbt

multi-layer MVCC log append-only database library based on the Apache CouchDB btree.
Erlang
14
star
41

inet_ext

inet extensions library
Erlang
13
star
42

hackney_lib

WEB toolkit including miscellaneous modules to play with HTTP and Web protocols
Erlang
11
star
43

memdb

Erlang memory backend K/V store
Erlang
10
star
44

rebar3_protobuffs

rebar3 protobuffs provider using protobuffs from Basho
Erlang
10
star
45

unicode_util_compat

unicode_util compatibility library for Erlang < 20
Erlang
10
star
46

fserve

simple file server in python on unix systems with sendfile support using pistil
Python
8
star
47

pywebmachine

Python port of Basho's WebMachine
Python
8
star
48

hypercouch

Full text indexing of CouchDB via HyperEstraier
Python
7
star
49

natpmp

Erlang Nat-PMP client
Erlang
7
star
50

rcouch_template

Rebar templates for generating custom couchdb releases
Shell
7
star
51

dotfiles

repository of dotifile in my home
Vim Script
6
star
52

hackney_disp

Load-balanced Pool dispatcher based on dispcount for hackney.
Erlang
6
star
53

benoitc.org

My own site
JavaScript
6
star
54

couchdb_internals

Miscelleaneous docs about the couchdb protocol and couchdb implementation
6
star
55

dcouch

an Alternative to Mnesia with Unique Features
5
star
56

backbone.py

just some code to initiate construction of objects from any remote repo.
Python
5
star
57

nplib

library collecting modules to decode a bunch of network protocoles
Erlang
5
star
58

qrkit

simple and stupid qr code binding extracted from qrurl
Python
5
star
59

couchdocs

Documentation for CouchDB
Objective-C
5
star
60

lhttpc-old

GIT clone of http://bitbucket.org/etc/lhttpc/
Erlang
4
star
61

blanket

couchdb/refuge client.
4
star
62

couch_randomdoc

simple couchdb module to add support of random document fetching.
Erlang
4
star
63

erlang-pbkdf2-nif

PBKDF2 NIF implementation
C
4
star
64

couchdb-old

Couchdb mirror repo to handle some custom dev
Erlang
4
star
65

rebar3_cargo

Erlang
4
star
66

erl_stun

Erlang
4
star
67

hackney_pooler

Experiment an API to limit the number of hackney requests launched concurrently
Erlang
4
star
68

emonk_helper

Some extensiosn to ease the use of emonk (http://github.com/davisp/emonk)
Erlang
3
star
69

couchjs

rebar couchjs version for CouchDB
JavaScript
3
star
70

dj-cookieauth

Secure Cookie Auth module for Django
Python
3
star
71

cablesgate

Script to put wikileaks diploamatic cables in a couchdb
Python
3
star
72

echohttp

simple service echoing any requests made to http://echohttp.com/echo
Erlang
3
star
73

mt-compono

minimalist cms using Django
JavaScript
3
star
74

dj-pages

minimal content cms/renderer
JavaScript
3
star
75

build-android

Shell
3
star
76

vrac

Simple app to manage all data fragments in vurt
JavaScript
3
star
77

erlang-idna-nif

C
3
star
78

esync

simple tool to sync files
Erlang
3
star
79

epygments

Simple wrapper to Pygments - prettify source code in your erlang program.
Erlang
3
star
80

libcouch

Pure Erlang CouchDB Store library.
Erlang
3
star
81

overlay

CSS
3
star
82

buildout_couchdb

zc buildout recipe for Apache CouchDB server
Python
3
star
83

dummy_app

Erlang
2
star
84

hello_world

Erlang
2
star
85

wineoverip

JavaScript
2
star
86

foodoverip

Handle #foodoverip
JavaScript
2
star
87

couchit_experiment

Standalone couch.it powered by CouchDB
Erlang
2
star
88

benoitc.github.com

Github Homepage
2
star
89

dataporn

intensive data usage
2
star
90

qrurl

C
2
star
91

enki

Document-oriented database framework
2
star
92

mod_percept2

percept2 ejabberd module
JavaScript
1
star
93

tiptoe

1
star
94

mz_counter

simple atomic counter for erlang applications
C
1
star
95

enki--multimedia.org

1
star
96

unicode_extra

Extra function not available in Erlang unicode_util module
Erlang
1
star
97

erlang-ucs

1
star
98

osdc2013_demo

demo for OSDC 2013
Erlang
1
star