It's not only a boiler plate. ITS A MEGA BOILER PLATE. With things... NOT SUPPOSED TO BE PART OF THE BOILER PLATE. bwahaha
This boilerplate is setup for the ff:
- JADE (because clean)
- LESS (because its more maintainable)
- SEQUELIZE (because ORM)
- BOWER (because everything is in bower)
- GRUNT (for easieness ONLY)
- NODEMON.JS (configurations for nodemon)
- Some file architecture
- Controller System
npm install && npm install -g grunt-cli && npm install -g nodemon
If you don't want to install the cli stuff, you have to change start.sh
npm start
runs start.sh
which runs nodemon +g grunt watch in the background
$terminal1: grunt watch
$terminal2: nodemon
bower-components\
assets\
style\
api\
model\
controller\
config\
templates\
assets\style\**.less
- compiles files less files on the flyassets\lib\**.*
- maps to bower-componentsassets\**
- returns files as is
api\controller\Foo.js
- Maps to host/fooapi\controller\BarController.js
- Maps to host/bar
WARNING: Do NOT name your controller ControllerController
. You dick.
bower example usage
- Do
bower install jquery
- Find
bower_components\jquery\dist\jquery.min.js\
- Include
<script src="assets\lib\jquery\dist\jquery.min.js"></script>
- Are just json objects. Which are directly plugged into
(new Hapi.Server).route(...)
- See http://hapijs.com/tutorials/routing
- But they are auto included if they are in api/controller/
- If no path is given it auto generates one from the filename
- Are just json objects. Which are directly plugged into
sequelize.define(...,{...})
- See http://docs.sequelizejs.com/en/latest/
- But they are auto included if they are in api/model/
- The filename becomes a global. Ie.
api/model/User
can be accessed viaglobal.User
- The grunt watch simply concatenates all the files in this pattern
assets/**/*.js
- It moves it into
.tmp/js/app.min.js
( in dev mode, its not minified )
npm build
Runs grunts tasks that builds the minis and shit like that