{"id":14985668,"url":"https://github.com/mvcds/hubi","last_synced_at":"2025-04-11T22:06:37.049Z","repository":{"id":31536089,"uuid":"126417640","full_name":"mvcds/hubi","owner":"mvcds","description":"Humanitarian ubiquitous language helper","archived":false,"fork":false,"pushed_at":"2023-07-18T19:59:23.000Z","size":12867,"stargazers_count":18,"open_issues_count":39,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T22:06:26.502Z","etag":null,"topics":["agnostic","cli","code-generator","command-line","configurable","developer-tools","documentation-generator","domain-driven-design","language-agnostic","nodejs","ubiquitous-language","yml"],"latest_commit_sha":null,"homepage":"https://mvcds.github.io/hubi/","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/mvcds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-23T01:48:11.000Z","updated_at":"2024-11-02T11:26:15.000Z","dependencies_parsed_at":"2024-10-23T18:11:31.938Z","dependency_job_id":"1b910d14-c43a-4d27-b2dd-5189a62e8962","html_url":"https://github.com/mvcds/hubi","commit_stats":{"total_commits":488,"total_committers":4,"mean_commits":122.0,"dds":"0.016393442622950838","last_synced_commit":"afb8299d684b652ada39e1cdc2a6d3671ff5ee9c"},"previous_names":[],"tags_count":70,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvcds%2Fhubi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvcds%2Fhubi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvcds%2Fhubi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvcds%2Fhubi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvcds","download_url":"https://codeload.github.com/mvcds/hubi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487716,"owners_count":21112191,"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","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":["agnostic","cli","code-generator","command-line","configurable","developer-tools","documentation-generator","domain-driven-design","language-agnostic","nodejs","ubiquitous-language","yml"],"created_at":"2024-09-24T14:11:27.463Z","updated_at":"2025-04-11T22:06:37.017Z","avatar_url":"https://github.com/mvcds.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hubi [![Build Status][ci-badge]][ci] [![JavaScript Style Guide][js-standard-badge]][js-standard] [![Coverage Status][coverage-badge]][coverage] [![GitHub license][license-badge]][license][![BCH compliance](https://bettercodehub.com/edge/badge/mvcds/hubi?branch=master)](https://bettercodehub.com/)\n\n`Hubi` is like a [database migration tool][ORM] but for [ubiquitous language][ubiquitous-language] i.e. it reads some of your versioned files to write code, data schema and documents.\n\n\u003cimg src=\"./assets/hubi.gif\" alt=\"how to use hubi\" title=\"how to use hubi\" /\u003e\n\n## When to use `hubi`\n\nUse it in one or more of the following situations:\n\n1. If you want to have a documentated language for your domain, especially when it needs to be consulted by non-technical stakeholders.\n\n2. When working on a project spread into different repositories e.g. back- and front-ends, so changes in one of them needs to be repeatead in the other ones in order to make the end-result work.\n\n:warning: **`Hubi` does not connect, or tell you how to connect, the project's repositories.**\n\n3. Your repositories are modeled in a way where it is possible to share domain knowledge across them interchangeably.\n\n4. You want to reuse a repository's slice of the domain (the way you've coded the model) in another repository from different projects. This is the least advisable scenario, as each repository generally has a slightly different perspective on how the domain looks like.\n\n## Basic Use\n\nDeclare how your domain should look like in a YAML file, refered to as [domain file][domain-file], and then execute `hubi` with the options provided by its [API :star:][api].\n\nEach one of this files is responsible for a piece of the domain. Its rules can be found at `hubi`'s [domain file guide :green_book:][domain-file-guide].\n\n### Installation\n\n\u003e As `hubi` is a development tool, it is recommended that each project have it installed by using the developer flag.\n\n```\n$ npm i hubi --save-dev\n```\n\nor\n\n```\n$ yarn add hubi --dev\n```\n\n### Example\n\nIn an imaginary project, the stakeholders have decided that it is necessary to show the user's birthday in their profile page. So the file relative to the user concept is changed:\n\n```diff\n # Domain file @ project/src/domain/user.yml\n name: User\n description: A person who has an account\n attributes:\n   - name: name\n     description: How to address the person\n     required: true\n   - name: eyes\n     description: The color of the user's eyes\n+    deprecated:\n+    - message:\n+        We've discovered that this is a useless information for us.\n+        Will be deprecated soon\n+    - error: false\n-    required: true\n+    required: false\n+  - name: birthday\n+    comment: This field was added later\n+    type: date\n+    required: false\n```\n\nWith one command, it is possible to spread this change to the code, data schema and documentation. You decide which [translations][translation] `hubi` writes:\n\n```\n$ npm run my-custom-hubi-script\n\u003e hubi save --same-folder --translator joi \u0026 hubi save --output documents --translator site\n```\n\nIn the example below, a [Joi schema][joi] and an entry into the project's site were changed to reflect that change.\n\n## Contributing\n\nTake a look at our [:green_book: contributing guide][contributing] to improve `hubi`.\n\n## How does `hubi` relates to [domain driven design (DDD)][ddd]?\n\nThe only relation is that `hubi` is based on the concept of “[ubiquitous language][ubiquitous-language]”, something Eric Evans presents in his book about [DDD][ddd].\n\nI don't know if he come up with this idea or only used it as his book's initial seed. A *language-to-rule-them-all* is a communication tool that simply states that we should encode domain knowledge (terms, phrases, etc) into the codebase in order to bridge the gap between developers and domain experts.\n\nBut you can still use ubiquitous language regardless of [DDD][ddd] because it stands on its own. So, **even if you don't know/use it**, you can still use `hubi` to reap the benefits of speaking a single language - at the same time you [document your domain as code][documentation-as-code].\n\n[ci-badge]: https://travis-ci.org/mvcds/hubi.svg?branch=master\n[ci]: https://travis-ci.org/mvcds/hubi\n[js-standard-badge]: https://img.shields.io/badge/code_style-standard-brightgreen.svg\n[js-standard]: https://standardjs.com\n[coverage-badge]: https://coveralls.io/repos/github/mvcds/hubi/badge.svg?branch=master\n[coverage]: https://coveralls.io/github/mvcds/hubi?branch=master\n[license-badge]: https://img.shields.io/github/license/mvcds/hubi.svg?style=flat-square\n[license]: https://github.com/mvcds/hubi/blob/master/LICENSE\n[ORM]: https://en.wikipedia.org/wiki/Schema_migration\n[ubiquitous-language]: https://martinfowler.com/bliki/UbiquitousLanguage.html\n[domain-file]: https://mvcds.github.io/hubi#domain-file\n[api]: ./docs/api.md\n[domain-file-guide]: ./docs/domain-file-guide.md\n[translation]: https://mvcds.github.io/hubi/#translation\n[joi]: https://www.npmjs.com/package/joi\n[contributing]: CONTRIBUTING.md\n[ddd]: https://airbrake.io/blog/software-design/domain-driven-design\n[documentation-as-code]: https://developers.redhat.com/blog/2017/06/21/documentation-as-code/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvcds%2Fhubi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvcds%2Fhubi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvcds%2Fhubi/lists"}