# JKHeadley/rest-hapi

🚀 A RESTful API generator for Node.js

Repository: https://github.com/JKHeadley/rest-hapi
Canonical: https://ross.abutalabs.com/products/rest-hapi
Homepage: https://resthapi.com
Language: JavaScript
License: MIT
License Family: permissive
Topics: hapi, hapi-plugin, joi, swagger, rest, rest-api, validation, crud, mongoose, mongodb, nosql, relational, api, documentation, joi-validation, hapi-server, audit-log, crud-generator, crud-api
Last push: 2023-03-26T17:51:24+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 3595, "days_push": 1256, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1181, forks 155 (observed 2026-08-28T04:03:54.093785+00:00)

## What it is
rest-hapi is a hapi plugin that automatically generates RESTful CRUD and association API endpoints from mongoose schemas, with joi validation, route/document-level authorization, Swagger docs, and rich query parameters (search, sort, filter, paginate, embed). It combines relational-style associations with NoSQL flexibility so an API can be running in minutes.

## Use cases
- generate a REST API from mongoose schemas
- scaffold CRUD endpoints for a MongoDB backend
- build a hapi.js API with swagger docs automatically
- add relational associations to a NoSQL API
- quickly prototype an API MVP with validation and auth
- add search, sort, filtering and pagination to API endpoints

## When to choose
- you use the hapi framework with MongoDB/mongoose
- you want to go from data models to a documented API in minutes
- you need configurable CRUD, associations, validation, and swagger out of the box

## When to avoid
- you don't use hapi or MongoDB
- you need fine-grained hand-written endpoint logic for most routes
- you need a project under active development - releases are infrequent

## Facets
- artifact type: framework
- maturity: maintenance
- function: api-framework, web-framework, orm, middleware, routing, api-documentation, authorization
- domain: web-development, backend, apis, databases, developer-tools
- platform: self-hosted
- tags: hapi-plugin, mongoose, crud-generator, swagger, joi-validation, mongodb, rest-api-generator, nosql, nodejs, javascript, web-server

## Member repositories
- JKHeadley/rest-hapi (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:54.093785+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:25:00.075714+00:00, confidence not recorded.
  - readme: https://github.com/JKHeadley/rest-hapi (fetched 2026-08-28T04:03:54.093785+00:00, sha f141fb068bfd)
  - homepage: https://resthapi.com (fetched 2026-08-29T12:32:04.464756+00:00, sha 201776e3f6e3)
  - site_page: https://www.resthapi.com/docs/quick-start (fetched 2026-08-29T12:32:04.473986+00:00, sha e4f84413ce1e)
  - site_page: https://www.resthapi.com/docs/creating-endpoints (fetched 2026-08-29T12:32:04.476129+00:00, sha 7cb9a63d0776)
  - site_page: https://www.resthapi.com/docs/associations (fetched 2026-08-29T12:32:04.478144+00:00, sha 527721fc1aa2)
  - site_page: https://resthapi.com/docs/introduction (fetched 2026-08-29T12:32:04.480277+00:00, sha eb0a19a214ed)
  - site_page: https://www.resthapi.com/docs/configuration (fetched 2026-08-29T12:32:04.482151+00:00, sha f38787249a8b)
  - site_page: https://www.resthapi.com/docs/querying (fetched 2026-08-29T12:32:04.484220+00:00, sha f15ab6f52f1a)
  - site_page: https://www.resthapi.com/docs/validation (fetched 2026-08-29T12:32:04.486026+00:00, sha 2807c8c404e1)
  - site_page: https://www.resthapi.com/docs/swagger-documentation (fetched 2026-08-29T12:32:04.488033+00:00, sha fe8eb0ea0d22)
- Data as of 2026-08-30T08:39:29.467469+00:00.
