foxbunny / create-ribcage-app-js

Template for RequireJS+Backbone+Ribcage web applications
0 stars 1 forks source link

Ribcage application template (JavaScript edition)

This is a volo-compatible Ribcage web application template.

This template is based on the basic create-template.

CoffeeScript edition

This is a template for JavaScript development. There is another template that sets everything up for people who prefer CoffeeScript.

Directory layout

Creating a project using volo

To create a project using volo, run:

volo create my_project_name foxbunny/create-ribcage-app-js

Volo will take care of installing all dependencies, so you can skip that part in the next section.

Preparing the project

To keep the template small, dependencies are not included. Install them using the following command:

volo add

You will get a few warnings about different packages trying to install a different version of jQuery, but that is expected, and you should ignore them.

You may also want to install a few Node dependencies (and, indeed, NodeJS itself) before proceeding. Installing NodeJS is outside the scope of this document. To install the development dependencies, simply run:

npm install

Although installing some of the dependencies may show some warnings on Windows, it should all just work in the end.

Building

To optimize, run:

volo build

This will run the "build" command in the volofile that is in this directory.

That build command creates an optimized version of the project in a www-built directory. The js/app.js file will be optimized to include all of its dependencies.

For more information on the optimizer: http://requirejs.org/docs/optimization.html

For more information on using requirejs: http://requirejs.org/docs/api.html

Development server

The project uses DaProxy to serve the unbuilt files. To start it, run:

volo serve

The server will be accessible at localhost:8080.

The server is a simple HTTP server with reverse proxy capability. The file is called proxy.json and is located in the tools directory. The layout of the file should be self-explanatory.

Known issues

Compiling or watch-compiling CoffeeScript will create a directory -p in the source tree (confirmed on Windows). I still haven't figured out why this happens. The directory empty and it is in .gitignore file, so it won't do any harm. I understand if you find it annoying, though.