{"id":15190611,"url":"https://github.com/pankajpatel/get-it-ready","last_synced_at":"2025-10-02T06:31:57.033Z","repository":{"id":48172552,"uuid":"68502317","full_name":"pankajpatel/get-it-ready","owner":"pankajpatel","description":"Generate Joi Validation, Mongoose Model and basic API endpoint routes for hapijs","archived":true,"fork":false,"pushed_at":"2017-09-25T15:00:44.000Z","size":33,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-29T01:32:21.340Z","etag":null,"topics":["hapijs","joi-validation","mongodb","mongoose","mongoose-model","mongoose-schema","rest-api"],"latest_commit_sha":null,"homepage":"https://runkit.com/pankaj/get-it-ready","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pankajpatel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-18T06:48:30.000Z","updated_at":"2023-01-28T04:21:54.000Z","dependencies_parsed_at":"2022-09-13T03:02:26.248Z","dependency_job_id":null,"html_url":"https://github.com/pankajpatel/get-it-ready","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pankajpatel/get-it-ready","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankajpatel%2Fget-it-ready","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankajpatel%2Fget-it-ready/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankajpatel%2Fget-it-ready/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankajpatel%2Fget-it-ready/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pankajpatel","download_url":"https://codeload.github.com/pankajpatel/get-it-ready/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankajpatel%2Fget-it-ready/sbom","scorecard":{"id":719236,"data":{"date":"2025-08-11","repo":{"name":"github.com/pankajpatel/get-it-ready","commit":"835cfce25b3a77480d41c6fc4624994f4d7d913c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"36 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-8462-q7x7-g2x4","Warn: Project is vulnerable to: GHSA-4jwp-vfvf-657p","Warn: Project is vulnerable to: GHSA-v8w9-2789-6hhr","Warn: Project is vulnerable to: GHSA-p84x-5xx8-hff9","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-446m-mv8f-q348","Warn: Project is vulnerable to: GHSA-8hfj-j24r-96c4","Warn: Project is vulnerable to: GHSA-wc69-rhjr-hc9g","Warn: Project is vulnerable to: GHSA-mh5c-679w-hh4r","Warn: Project is vulnerable to: GHSA-8687-vv9j-hgph","Warn: Project is vulnerable to: GHSA-f825-f98c-gj3g","Warn: Project is vulnerable to: GHSA-h8hf-x3f4-xwgp","Warn: Project is vulnerable to: GHSA-9m93-w8w6-76hh","Warn: Project is vulnerable to: GHSA-m7xq-9374-9rvx","Warn: Project is vulnerable to: GHSA-vg7j-7cwx-8wgw","Warn: Project is vulnerable to: GHSA-h466-j336-74wx","Warn: Project is vulnerable to: GHSA-p92x-r36w-9395","Warn: Project is vulnerable to: GHSA-45q2-34rf-mr94","Warn: Project is vulnerable to: GHSA-w9mr-4mfr-499f","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-w5p7-h5w8-2hfq"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T10:46:03.137Z","repository_id":48172552,"created_at":"2025-08-22T10:46:03.137Z","updated_at":"2025-08-22T10:46:03.137Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277513079,"owners_count":25831036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-29T02:00:09.175Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hapijs","joi-validation","mongodb","mongoose","mongoose-model","mongoose-schema","rest-api"],"created_at":"2024-09-27T20:43:04.149Z","updated_at":"2025-10-02T06:31:56.675Z","avatar_url":"https://github.com/pankajpatel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# get-it-ready\n\nGenerate Joi Validation, Mongoose Model and basic API endpoint routes for hapijs\n\n[![Code Climate](https://lima.codeclimate.com/github/pankajpatel/get-it-ready/badges/gpa.svg)](https://lima.codeclimate.com/github/pankajpatel/get-it-ready) [![Test Coverage](https://lima.codeclimate.com/github/pankajpatel/get-it-ready/badges/coverage.svg)](https://lima.codeclimate.com/github/pankajpatel/get-it-ready/coverage) [![Issue Count](https://lima.codeclimate.com/github/pankajpatel/get-it-ready/badges/issue_count.svg)](https://lima.codeclimate.com/github/pankajpatel/get-it-ready)\n\n## Inspiration\n\nWhile doing hapijs app with mongoose, there was a problem with Mongoose schemas and Joi validations; they were most of the times same. And the REST API was surely going to have few predefined routes; why not have a constructor to do all this at once.\n\n![Let me wrap it for ya!](http://i.giphy.com/107vXbGSNNMakg.gif \"Let me wrap it for ya!\")\n\n----\n\nOnce constructor will bridge the problem of multiple configurations for Mongoose and Joi. And also quicky return the controller methods and Routes to easily plug into Hapijs app.\n\n## Description\n\nThis lib can be used to generate the schema, model, necessary controllers and routes that can be directly plugged into Hapijs app.\n\nFew restrictions:\n* Mongoose models and schemas can/will be used\n* Output controllers and routes are for Hapijs\n* Controllers are named as\n  * getAll\n  * getOne\n  * create\n  * update\n  * remove\n* Routes\n  * GET all\n  * GET one\n  * POST one\n  * PUT one\n  * DELETE one\n\n## Usage\n\n### Automatic\n\nFor automatic/quick usage, the method will need all following four parameters.\n\n* __*object*__ schemaDefinitionObject This object is a mixture of Mongoose Schema Definition and Joi validation object. The keys which you wanna put in Joi validation, create a `joi` named key in the value object\n* __*string*__ routeBaseName Route base in plurals\n* __*string*__ modelName Model name\n* __*string*__ singularRouteName Route base in singular\n\nIt returns a Collection object containing ingredients of REST which are ready to be plugged to hapijs\n\n#### Example\n\n```\nvar Joi = require('joi');\nvar getItReady = require('get-it-ready');\n\nvar personDefinition = {\n  name: {\n    type: String,\n    required: true\n  },\n  firstName: {\n    type: String,\n    required: true,\n    joi: Joi.string()\n  },\n  lastName: {\n    type: String,\n    required: true,\n    joi: Joi.string()\n  },\n  createdOn: {\n    type: Date,\n    required: false,\n    default: Date.now,\n    joi: Joi.date()\n  }\n};\n\nvar person = getItReady(personDefinition, 'persons', 'Person', 'person');\n\nconsole.log(person.validations, person.schema, person.model, person.controller, person.routes);\n```\n\nSee above code in action at [https://runkit.com/pankaj/get-it-ready](https://runkit.com/pankaj/get-it-ready)\n\n### Manual\n\nFor manual opration of this lib, the order of execution of methods is very important. The order of execution should be\n* `separateJoiValidationObject`\n  * @param  {object} _config_ The mixture of Schema Config and Joi config object\n  * @return {object}\n* `getSchema`\n  * @param  {object} _schema_ definition object\n  * @return {object} mongoose schema\n* `getModel`\n  * @param  {string} _modelName_ The Mongoose Model name\n  * @param  {object} _schema_ The Mongoose Schema object\n  * @param  {object} _db_ The Mongoose DB conection object, if pased, use this otherwise use Mongoose. The connection object should be created with `Mongoose.createConnection`\n  * @return {object} model The Mongoose model\n* `getControllers`\n  * @param  {object} _model_ The Mongoose model object\n  * @param  {object} _joiValidationObject_ The Joi validation objects\n  * @return {object} object containing controller methods\n* `getRoutes`\n  * @param  {object} _controllers_ The object containing controller methods\n  * @param  {string} _routeBaseName_ The string which should be used for routebase\n  * @param  {string} _singularRouteName_ The singular entity name for routes\n  * @return {object} The routes object which can be plugged in hapijs or can be extended more\n\n#### Example\n\n```\nvar Joi = require('joi');\nvar getItReady = require('get-it-ready');\n\nvar personDefinition = {\n  firstName: {\n    type: String,\n    required: true,\n    joi: Joi.string()\n  },\n  lastName: {\n    type: String,\n    required: true,\n    joi: Joi.string()\n  },\n  createdOn: {\n    type: Date,\n    required: false,\n    default: Date.now,\n    joi: Joi.date()\n  }\n};\n\nvar validations = getItReady.separateJoiValidationObject(personDefination);\nvar schema      = getItReady.getSchema(validations.schema);\nvar model       = getItReady.getModel(modelName, schema);\nvar controllers = getItReady.getControllers(model, validations);\nvar routes      = getItReady.getRoutes(controllers, routeBaseName, singularRouteName);\n\nconsole.log(validations, schema, model, controller, routes);\n```\n\n## Built With\n\n* Joi - For repharsing the validatons on POST and PUT requests\n* Boom - Errors of Hapijs\n* Mongoose - MongoDB Schema and Models for routes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpankajpatel%2Fget-it-ready","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpankajpatel%2Fget-it-ready","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpankajpatel%2Fget-it-ready/lists"}