Documentation

The CEAN stack is based on the following components:

  • Couchbase Server / Couchbase Node.js module: A highly scalable distributed KV-Store and Document Database System
  • Express: A web application framework for Node.js
  • AngularJS: A client side JavaScript MVC web application framework
  • Node.js: A JavaScript oriented web service/application platform which is designed to build scalable network application

The tooling is based on:

  • YEOMAN: The web's scaffolding tool for modern webapps
  • Grunt: The JavaScript Task Runner
  • cean-cli: A node module which provides a simplified command line interface on top of YEOMAN (TODO!)

Requirements

  • Install the following on your development machine. For instance for Ubunut 14.04:
sudo apt-get install gcc sudo apt-get make sudo apt-get git sudo apt-get nodejs sudo apt-get nodejs-legacy sudo apt-get npm

How to use

  • Install the CEAN command line tool and all the dependencies
npm install cean-cli
  • Add the command line tool to your execution path
#Add to the end of your $HOME/.profile or $HOME/.bash_profile export PATH=$HOME/node_modules/cean-cli:$PATH
  • Create a new project directory
cd -- mkdir myapp cd myapp
  • Scaffold a new Couchbase application
cean-cli create myapp
  • Answer the questions regarding 'Couchbase Host', 'Couchbase Bucket', 'Couchbase Password'! Please also make sure that the bucket is existent and accessible with this password. For instance:
== This is the Couchbase CEAN generator == appname = myapp [?] Your Couchbase Host: 192.168.7.160 192.168.7.160 [?] Your Couchbase Bucket: cean cean [?] Your Couchbase Bucket Password: test test ...
  • Wait until all dependencies are downloaded!
  • Start the application
cean-cli start
  • Open the example application in your browser, E.G:
http://192.168.7.162:9000/
  • Click on the 'Add Test Document' button
  • Also inspect the log output of your application
  • If everything worked fine then you get a success message:
Successfully added a document to your Couchbase bucket!
  • Reload the page and you should see the just inserted message:
Hello Couchbase!

Sub-Generators

The following sub-generators are currently available

  • angular-controller: Adds an Angular controller to your project
  • angular-view: Adds an angular view to your project
  • angular-route: Adds a route by glueing the controller and the view together
  • angular-service: Adds a service wrapper, which means a client side REST client for an existing Express router
  • express-route: Adds an express router. This is used for implementing server side REST services those are bound to specific paths.

Here an example which adds a controller which is named 'TestCtrl' to the application called 'myapp'. In the next step a new view with the name 'test' is created. Afterwards a route is added in order to make sure that the test controller is used together with the test view.

cean-cli add angular-controller TestCtrl myapp cean-cli add angular-view test cean-cli add angular-route test.html TestCtrl

Important: Files have CEAN markers in them in order to make this work. Markers are realized as source code comments. So you should not remove something like '--cean: ${Marker}' in your source code. This would basically break some sub-generator funtionality.

Screenshots

alt tag

TODO-s

Please have a look here: https://github.com/dmaier-couchbase/cean/issues

Comments