Node.js Starter Kit

by neogeek

GitHub Readme.md

Node.js Starter Kit

This repo is a starter kit for working with Node.js, Handlebars (both server and client side), Sass (via node-sass), and Babel (via spire-of-babel).

Build Status Dependency Status devDependency Status Greenkeeper badge

Install to Heroku

Deploy

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.

Both client and server-side Handlebars templates are stored in /src/views.

Building

The following command will install all Node.js dependencies. Once all dependencies are installed it will run make build compiling Handlebars and Sass files.

$ npm install

To manually compile Handlebars and Sass files run:

$ make build

To watch for changes to any Handlebars or Sass files run:

$ make watch

Testing

Tests are powered by mocha. 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:

$ make serve

Once the application is running it can be accessed 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 create-nodejs-starter-kittest (replacing test with your new project name).

create-nodejs-starter-kit() {

    curl -L https://github.com/neogeek/nodejs-starter-kit/archive/master.tar.gz | tar -xz
    mkdir -p "${1}"
    mv nodejs-starter-kit-master/{*,.[^.]*} "${1}"
    rm -d nodejs-starter-kit-master
    cd "${1}" || exit
    npm install

}

Demo

A video covering the initial setup process and basic Handlebars usage is available at Vimeo. http://vimeo.com/neogeek/nodejs-starter-kit-demo