For an ES6 version: Take a look at rutha 2016
Pure pragmatic NodeJS stack
Changelog: changelog
- rutha - A Hapi and Angular boilerplate stack - English
- Hapi View Partials - Spanish
- Hapi REST Authentication - Spanish
- Hapi Tutorials
- BabelJS: Learn ES6
- ECMAScript6 by Luke Hoban
- Typescript
- Taming Angular 1.3 forms by Year of Moo
- Jasmine BDD Introduction
- Rule Them All with a single environment: Both development and production environment are the same. We concat, annotate, mix some ingredients and offer you the same production environment for development.
- AngularJS 1.5.x
- Hapi 13.0.0
- Jasmine NPM
- Ionic: Try rutha-ionic
- Grunt JIT: Is JIT for Grunt. No more waits.
- Underscore for frontend server side templates: To avoid issues with AngularJS.
- Grunt ngAnnotate
- Grunt Angular Templates
- Specs and Functional Tests (Frontend): Based partially on year of moo
- Visionmedia/debug module by default
- Chris Sevilleja's 'Easy Node authentication' local and facebook sample code for HapiJS
- Basic cssmin task
grunt-nsp
support- Istanbul code coverage support
- Uses canned responses / server mocks / nobackend inspired by Euge's canned responses
- Hapi Swagger
- Grunt JSDoc3
- Clone repo
- Rename text containing
rutha
toyour_app_name
- Be sure to have node 4.5.0 or greater (e.g. nvm use 4.5.0)
- Run
npm install grunt-cli -g
- Change dir to ui and run
npm install
and thenbower install
- Open a new tab and change dir to service and run
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 jshint
ui/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
- Run
grunt build
to generate frontend assets - Add zip file to commit e.g. git add releases/v0.1.0.zip (or customize rutha-deploy to fetch from somewhere else).
- In your devops workflow, unpack zip and run ui/lib/hapi/index.js
- Copy service directory or get from repo
- In your devops workflow, run service/lib/hapi/index.js
Rogelio Morrell C.
Feel free to fork.