GithubHelp home page GithubHelp logo

quarry's Introduction

node-boilerplate

Structure for your non-trivial node.js project.

Quick Start

Develop

Linux/OSX running node v0.6.x, mongodb & redis

  1. Get the boilerplate:

    mkdir projectname
    git clone git://github.com/hunterloftis/node-boilerplate.git projectname
    cd projectname
  2. Check your system requirements and start local databases:

    scripts/requirements
    redis-server
    mongod
  3. Try it:

    sudo npm install
    sudo node server
  4. code, code, code

  5. Set up a git repository hosting your project (eg, on Github)

Provision

Ubuntu VPS (eg, Linode)

  1. Fill out scripts/deploy.conf - more

  2. Put your & other developers' public keys in scripts/provisioning/keys (these public keys will have root access)

  3. Provision your server as root:

    cd scripts
    sudo ./provision staging root
    

Deploy

  1. Run within /scripts:

    ./deploy staging setup
    ./deploy -T staging
    
## deploy.conf

A sharp fork of visionmedia/deploy to be used for provisioning and deployment.

deploy(1) will look for ./deploy.conf, consisting of one or more environments, [staging], [production], etc, followed by directives.

An example .conf file with all available directives:

[production]
project awesome
repo [email protected]:Skookum/awesome.git
host 123.456.789.10
private /keys/awesome.id_rsa
environment production
ref origin/master
stack node

[media]
project awesome_media
repo [email protected]:Skookum/awesome.git
host 123.456.789.11
private /keys/awesome.id_rsa
ref origin/master
stack nginx

Directives

project

The name of your project. This is also the username of your deploy user, and the location of your deployed project (/home/$projectname). Avoid using characters other than [a-z] and underscore.

project better_than_facebook

repo

Your git repository. Deploying will pull from this uri as the deploy user, $projectname.

repo git://github.com/hunterloftis/node-boilerplate.git

host

The IP address of your server.

host 123.456.789.10

private

Path to your deploy user's private key. This is necessary if you are using a private git repository. If not, just use /dev/null.

private /keys/awesome.id_rsa

environment

A string that sets NODE_ENV for this project.

environment staging

ref

The default git ref from which to deploy. Defaults to origin/master.

ref origin/staging

stack

One of: node or nginx. The stack determines what type of server deployment you'd like to do. Node deploys a node server, while nginx deploys a very simple, fast, static file server that hosts your app/public directory. It's designed to deploy media.yoursite.com.

stack node

quarry's People

Contributors

iamdustan avatar snodgrass23 avatar

Stargazers

Hunter Loftis avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.