Skip to content
davidjamesstone edited this page Sep 24, 2016 · 2 revisions

Scaffold

Scaffold a new vsd project

vsd -c myapp (Linux/MAC only).

The command will create a new vsd-web project.

Basics

A hapi-based nodejs web server enterprise-ready project boilerplate.

It's a simple bash script that clones a base repository, makes some minor replacements, installs npm dependencies and runs the build. It should take about 30 seconds.

You can run these steps yourself if you wish but the scaffold makes it much easier.

There are 6 different boilerplate types. Use the -t argument.

E.g. vsd -c myapp -t api Will create an api project called myapp.

  1. api
  • Minimal use for simple hapi api service projects
  1. web
  • For simple a hapi website
  1. gov.uk web
  • For a gov.uk themed hapi website
  1. gov.uk flood web
  • For a gov.uk (flood) themed hapi website
  1. Admin LTE dashboard
  1. VSD Web (Default)
  • Like number 2. but with a demo DB, mongoose components and a starter routing table.

The boilerplates come with these opinions out-of-the-box:

The above are only intended as a baseline, nothing is mandated. For example, if you'd rather use grunt or gulp or would like to use a different templating language it's easy to change.

Principles

  • Production-ready & enterprise quality
  • hapi.js is super simple but elegant and powerful too. It and it's family of plugins and libraries give you everything you need to build web applications and services. NPM has a wealth of great packages but always be aware that your dependencies are your responsibility. Relying on hapijs components where possible, with its strict testing approach with 100% code coverage gives you confidence in your enterprise application.
  • Keep it Simple. Write modular code. TODO: Lot's of links here...