Skip to content

diasalvatore/rutha

 
 

Repository files navigation

Rutha Stack - Taming HapiJS and AngularJS

Ru le T hem H apiJS A ngularJS

Build Status

Pure pragmatic NodeJS stack

Changelog: changelog

Last update: 1.0.0

Docs:

Main features

  • 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.3.x
  • Hapi 8.0.0
  • ES6 ready for service api layer (UI/Angular later mid 2015)
  • Jasmine NPM

Additional features

Installing

  1. Clone repo
  2. Rename text containing rutha to your_app_name
  3. Be sure to have node 0.10.32 or greater (e.g. nvm use 0.10.32)
  4. Run npm install grunt-cli -g
  5. Change dir to ui and run npm install and then bower install
  6. Open a new tab and change dir to service and run npm install

Deploying rutha apps with rutha_deploy

  1. Run grunt build to generate frontend assets

  2. Add zip file to commit e.g. git add releases/v0.1.0.zip.

  3. 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
  4. Add hosts to /etc/ansible/hosts

  5. Enable host in ui/Gruntfile.js by adding it to deploySettings.

  6. Configure cloud / server with SSH key to get repo (or customize rutha-deploy to fetch from somewhere else).

  7. Run grunt deploy

Deploying rutha frontend app

  1. Run grunt build to generate frontend assets
  2. Add zip file to commit e.g. git add releases/v0.1.0.zip (or customize rutha-deploy to fetch from somewhere else).
  3. In your devops workflow, unpack zip and run ui/lib/hapi/index.js

Deploying rutha service app

  1. Copy service directory or get from repo
  2. In your devops workflow, run service/lib/hapi/index.js

Grunt Help - Service tasks

  • grunt serve: Serves API service
  • grunt spec: Runs Jasmine 2.0 specs
  • grunt coverage: Runs Istanbul code coverage. Outputs HTML reports to test/coverage/reports
  • grunt auditpkg: Verifies modules that contains security issues
  • grunt 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.

Grunt Help - Frontend tasks

  • grunt serve: Serves frontend service with no auto reload
  • grunt autosync: Serves frontend service with auto reload
  • grunt spec: Runs jshint and server side / UI specs
  • grunt test: Runs E2E/Functional tests (Angular)
  • grunt build: Prepares UI assets
  • grunt stagelocal: Provisions Vagrant VM
  • grunt staging: Provisions staging
  • grunt deploy: Provisions production
  • grunt jshinting: Verifies javascript using jshint
  • grunt auditpkg: Verifies modules that contains security issues

About Angular Tests

ui/src/test/lib contains libs require for testing. Scope.SafeApply can be added as optional (see yearofmoo blog post)

Nginx routes (Optional)

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;
  }
}

Maintainers, notes

Maintain by Rogelio Morrell C. Pull Request are welcome but I might not turn around those quickly.

Disclaimer

Feel free to fork.

About

Rutha - HapiJS AngularJS Stack

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 86.5%
  • HTML 11.5%
  • CSS 1.9%
  • TypeScript 0.1%