#Node.js Starter Kit
This repo is a starter kit for working with Node.js, Handlebars (both server and client side), SASS (through node-sass), and RequireJS. Client-side dependency management is through Bower.
##Getting Started
Run the following command to download the repo and unpack it into /nodejs-starter-kit-master
.
$ curl -L https://github.com/neogeek/nodejs-starter-kit/archive/master.tar.gz | tar -xz
All client-side files are located in /static
. Bower components and compiled client-side Handlebars templates generated through grunt
are also stored here.
Server-side Handlebars templates are stored in /src/views
.
##Building
The following command will install all Node.js and Bower dependencies. Once all dependencies are installed it will run grunt
compiling Handlebars and SASS files.
$ npm install
To manually compile Handlebars and SASS files run:
$ grunt
To watch for changes to any Handlebars or SASS files run:
$ grunt watch
##Testing
Tests are powered by Jasmine and PhantomJS. To run all tests use this command:
$ npm test
A .travis.yml
configuration file is included to support automated testing through Travis CI.
##Server
If you have the Heroku Toolbelt installed you can start the sample applications with this command:
$ foreman start
If not, then the application can also be run using this command:
$ node web.js
Once the application is running you can access it at http://localhost:5000/.
##Bash Alias
Add the following to your ~/.bash_profile
and restart terminal. You will now be able to create a new project using the starter kit by typing nodejs-project test
(replacing test with your new project name).
nodejs-project-builder() {
curl -L https://github.com/neogeek/nodejs-starter-kit/archive/master.tar.gz | tar -xz
mv nodejs-starter-kit-master $1
cd $1
npm install
}
alias nodejs-project=nodejs-project-builder
##Demo
A video covering the initial setup process and basic Handlebars usage is avalible at Vimeo. http://vimeo.com/neogeek/nodejs-starter-kit-demo