For an ES6 version: Take a look at rutha 2016
Pure pragmatic NodeJS stack
grunt-nsp
supportrutha
to your_app_name
npm install grunt-cli -g
npm install
and then bower install
npm install
npm start
: Serves API servicenpm test
: Runs Jasmine NPM specsnpm run nsp
: Verifies modules that contains security issuesgrunt migrate:create [--name]
: Creates a migration task. Args: --name: migration name (optional)grunt migrate:up [--revision]
: Migrates up. Args: --revision: revision name (optional)grunt migrate:down [--revision]
: Migrates down. Args: --revision: revision name (optional)grunt docs
: Builds jsdoc3 documentation.npm start
: Serves frontendnpm test
: Runs Jasmine NPM specsnpm run nsp
: Verifies modules that contains security issuesgrunt test
: Runs E2E/Functional tests (Angular)grunt build
: Prepares UI assetsgrunt stagelocal
: Provisions Vagrant VMgrunt staging
: Provisions staginggrunt deploy
: Provisions productiongrunt jshinting
: Verifies javascript using jshintui/src/test/lib
contains libs require for testing. Scope.SafeApply can be added as optional (see yearofmoo blog post)
server {
# simple reverse-proxy for Rutha (Very useful!)
listen 80;
server_name localhost;
access_log dev.log;
#error_page http://here;
location /api {
proxy_pass http://127.0.0.1:3002;
proxy_redirect default;
proxy_set_header Host $host;
}
location / {
proxy_pass http://127.0.0.1:3005;
proxy_redirect default;
proxy_set_header Host $host;
}
}
Run grunt build
to generate frontend assets
Add zip file to commit e.g. git add releases/v0.1.0.zip.
In rutha-deploy, configure group_vars with your settings
# devops
domain: disrupting_app.com
ssl_name: disrupting_app
# rutha
app_name: disrupting_app
app_repo: git@github.com:molekilla/rutha.git
app_branch: release0.1.0
app_version: v0.1.0
app_env:
NODE_ENV: production
Add hosts to /etc/ansible/hosts
Enable host in ui/Gruntfile.js by adding it to deploySettings.
Configure cloud / server with SSH key to get repo (or customize rutha-deploy to fetch from somewhere else).
Run grunt deploy
grunt build
to generate frontend assetsRogelio Morrell C.
Feel free to fork.