Quick boilerplate for setting up a basic Coffeescript driven app, with Stylus and Jade for the frontend.
- Clone this repo
- Copy all files to your new project
- Check out the docs for each file at the
/docs
folder - Start hacking!
- Coffeescript by @jashkenas
- Express by @visionmedia
- Jade by @visionmedia
- Stylus by @learnboost
- Vows by @cloudhead
app.js
: Main app file, runnode app.js
to start apppublic/
: Public folder, all front-end files go herecss
images
js
lib/
: All backend files go heretest/
: Where all tests are. Currently uses Vows as exampleviews/
: Where all Jade templates aresrc/
: Source files, where all Coffeescript and Stylus file resides. The file structure withinsrc/
folder mirrors the root folder, saves time trying to hunt for filesdocs/
: Docco generated documentation files
There are a couple of helper functions defined within the Cakefile
, which are:
cake watch # Watches all Coffeescript(JS) and Stylus(CSS) files
cake watchJS # Watches all coffeescript files for changes
cake watchCSS # Watches all CSS files for changes
cake compileJS # Compiles all Coffeescript files into JS
cake test # Runs all tests
cake docs # Create documentation using Docco
To run Cakefile
remember to install coffee-script
as a global module,
npm install coffee-script -g
To compile the CSS you need to install stylus
as a global module too in order to run the executable:
npm install stylus -g
Then, at the root folder, just do
cake watch
And magic happens! :)
I love Coffeescript. No doubt to that. So everytime I start a new project I find myself doing all the same steps over and over, creating folders, copying files, installing modules, setting up Cakefile tasks and all those trivial tasks.
So I thought, why not create a template that I can use over? And then I thought, why not share it with everyone?
Cham is not meant to be a definitive guide to the universe of Express or Node.JS. It is a combination of ideas, regarding my personal approach of developing with Express and Coffeescript.
- CoffeeScript, Express, Jade and Stylus enthusiasts
- Developers that wanted a quick base to start working with
- Node.js beginners that want to learn more about Node.js with a more approachable example
Fellow developers, please do share with me what are your thoughts, I would love to hear from you and see how we can do better!
Trivia: "Cham" is also a Malaysian/Singaporean drink that mixes coffee, hot chocolate, tea, sugar, milk and a bunch of other stuff. It's awesome. :3