Build custom CloudWall

CloudWall is a set of components, that are compiled to a bundle of files (or single CouchDB doc, or .tar archive) when you create a build.

Source code

To get CloudWall sources, first create new clean DB and then update it from dump http://cloudwall.me/os/dl/cloudwall-source-1.9.json – it’s a repo containing latest stable dev version of CloudWall source.

To update from dump, start app Apply DB dump, paste URL and click Apply. After several seconds you will see prompt with doc list. Select docs to save – just keep them all checked.

After dump save your new DB with CloudWall sources might look like this:

They all are sky blue first, because they are not yet read.

You may need to reload CloudWall 1–2 times to force interferring system components to rearrange.

Builder

Main doc, that builds CloudWall, is  /os 1.9. Open it – first thing you see is readme, that explains its structure. This doc is linked with all other docs and apps in the DB and compiles them into ready-to-use CloudWall bundle.

Compilation is explicit – it runs when you click Save or Publish. Compilation can take significant time and is very CPU and RAM extensive. Errors are generally put to console – so keep it open.

Process ends when you see popup message, that everything is ok.

The doc /os 1.9 itself – if replicated to CouchDB – is ready-to-use site with full-featured CloudWall. If you have your CouchDB at http://domain.name/dbname, your cloudwall is at http://domain.name/dbname/143563378008cw190src/index.html

Also you can build CloudWall as .tar archive:

  • Save doc to force rebuild
  • Click Get .tar button

Tar contains set of files, suitable for any static hosting.

Making custom build

Before making custom build, clone doc /os 1.9 – click its icon and then click Clone. You will get cloned doc immidiately opened – change its name (button with wrench) and save.

To make custom build you may change components’ code and list of components to include in your fork.

For example, if you do not want your users to have App editor, just remove it from your custom bundle. See screenshot rightside, lines to remove are highlighted.

These two lines are include directives, they insert snippets, that are linked with two DB docs. Also you can delete snippets themselves – to avoid unnecessery processing.

After you click Save, you can get .tar without these components.

Replication interval and compaction

The doc with build has a lot of attaches, and they are somehow heavy for noBackend world. If you local DB is synced with remote Couch, to avoid excessive replication traffic set sync interval to 5–10 minutes, do not set it to zero.

Also do not forget to perform compaction time to time – both local and remote DBs grow rapidly on every save of build doc.