Herman Express Generator
Just a Node/Express Yeoman generator for a basic Node/Express boilerplate, featuring:
- A component-based structure (example)
- Server-side Templating via Nunjucks
- Local Auth via Passport
- Knex query builder
- Flash Messages
- Tests
- Airbnb JavaScript Linter
- Security
Getting Started
- Install Yeoman (if necessary) -
npm install -g yo
- Install Gulp (if necessary) -
npm install -g gulp
- Install the generator -
npm install -g generator-herman-express
- Run -
yo herman-express
, go through all prompts, and thennpm install
- Create the necessary databases
- Update the variables in .env
- Create the development and test Postgres DBs:
- Run development migrations:
knex migrate:latest --env development
- Run seed:
knex seed:run --env development
- Run server
gulp
Test
All tests:
$ npm test
Leakage tests:
$ npm run leaks
Coverage:
$ npm run coverage$ npm run coverage-unit$ npm run coverage-integration
New Component?
Steps for setting up a new component:
- Add a new component directory to "src/server/components"
- Add the route to src/server/routes.js
- Add the new views to the
viewFolders
array in src/server/config/main-config.js - Add tests