Brick.JS
Scalable Web Development, One Brick at a Time!
Brick.JS is a HMVC style Web Application Framework for Node.js. The entire Web App is break down into a collection of interactive bricks.
- CommonJS environment for browser-side JavaScript.
- Template partials are associated with controllers.
- Automatic CSS modularization.
See Brick.JS Wiki Page for tutorials.
Demo
brick-js/brick-demo is a minimal demo project for Brick.JS
Usage
var express = ;var brickJs = ;var Liquid = ; var brk = ;brk; var app = ;app; app;
Options
root
Type: String
Default: path.join(__dirname, 'bricks')
Optional. The root directory containing your bricks.
view
Type: String
or Array<String>
Default: 'view.html'
Optional. Template file entry(s) of your brick.
Can be Array of Strings, eg: ['index.hbs', 'view.html']
.
Brick.JS will look for corresponding template engine when rendering.
router
Type: String
Default: 'router.js'
Optional. Server-side Router, which exports
a ExpressJS compliant url
,
and REST Routers including get
, post
, put
, delete
which accepts 4 arguments: (req, done, fail, res)
.
Template Engines
Template engines can be registered via .engine(<ext>, <lib>)
.
Available Template Engines:
- brick-hbs: Handlebars template engine for brick.js
- brick-liquid: Liquid template engine for brick.js
Template Engine Development Guide: Template Engine Interface
Static Assets
Static assets for your bricks can be generated by brick-asset.
brick-asset support CSS Pre-Processors like LESS.
Typically, you need brick-asset all
before node app.js
.