Hapi Starter Kit

screenshot of Hapi Starter Kit

Hapi.js based REST boilerplate which uses latest ES7/ES8 features (async/await) with code coverage and follows best pratices

Overview

The Hapi Starter Kit is a lean boilerplate application for building RESTful APIs in Node.js using the hapi.js framework. It follows industry standard best practices and utilizes the latest async/await ES8 feature. This kit allows developers to bring their own front-end and plug in their own database.

Features

  • Uses latest ES8/ES2017 features (async/await): Utilizes the newest features of ES7 and ES8, including async/await for asynchronous programming.
  • Application Configuration via config: Organizes hierarchical configurations for app deployments and allows the definition of default parameters that can be extended for different deployment environments.
  • Auto Documentation via hapi-swagger: Self-documents the API interface and allows testing of APIs using the Swagger interface.
  • Unit and Integration Tests via Mocha with async/await: Incorporates unit and integration tests that utilize the latest ES7/ES8 features.
  • Code Coverage via istanbul: Supports code coverage of ES8 code using istanbul and mocha. Code coverage reports are saved in the coverage/ directory.
  • Logging via bunyan: Implements the bunyan logging library which logs in JSON format and allows turning on/off logs by setting the log level.
  • Code Linting via Standard: Uses ESLint, a pluggable linter tool, to identify and report on patterns in JavaScript.
  • API parameter validation via joi: Validates API parameters using the joi library.

Summary

The Hapi Starter Kit is a well-designed boilerplate for building RESTful APIs using the hapi.js framework in Node.js. It incorporates the latest ES8 features, provides convenient configuration and documentation tools, and includes testing and linting capabilities. This kit serves as a solid starting point for developers looking to quickly set up a robust RESTful API.

docker
Docker

A website that uses Docker for containerization to streamline development, testing, and deployment workflows. This includes features such as containerization of dependencies, automated builds and deployments, and container orchestration to ensure scalability and availability.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.