{"id":20527035,"url":"https://github.com/node-ts/bus-starter","last_synced_at":"2025-04-14T04:21:27.349Z","repository":{"id":43674387,"uuid":"184724258","full_name":"node-ts/bus-starter","owner":"node-ts","description":"A starter project for @node-ts/bus for building distributed message based systems with node","archived":false,"fork":false,"pushed_at":"2022-02-24T18:47:49.000Z","size":395,"stargazers_count":40,"open_issues_count":10,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T18:13:04.610Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://node-ts.github.io/bus/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/node-ts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-03T08:41:45.000Z","updated_at":"2022-11-21T06:27:34.000Z","dependencies_parsed_at":"2022-08-23T04:51:04.468Z","dependency_job_id":null,"html_url":"https://github.com/node-ts/bus-starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-ts%2Fbus-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-ts%2Fbus-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-ts%2Fbus-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-ts%2Fbus-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/node-ts","download_url":"https://codeload.github.com/node-ts/bus-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248819650,"owners_count":21166516,"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":[],"created_at":"2024-11-15T23:17:01.705Z","updated_at":"2025-04-14T04:21:27.321Z","avatar_url":"https://github.com/node-ts.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @node-ts/bus-starter\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/node-ts/bus-starter.svg)](https://greenkeeper.io/) [![CircleCI](https://circleci.com/gh/node-ts/bus-starter/tree/master.svg?style=svg)](https://circleci.com/gh/node-ts/bus-starter/tree/master) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\nA starter project for @node-ts/bus for building distributed message based systems with node.\n\n## Why?\n\n[@node-ts/bus](https://node-ts.gitbook.io/bus/) is focused on helping build distributed systems in node based on messaging patterns that are reliable, scalable and fault tolerant. Applications built this way can:\n\n* survive restarts and downtime\n* handle bursty loads\n* scale in and out easily\n* survive network interruptions\n* tolerate external API outages\n* easily be refactored from monolith to microservice\n\nAll without losing data. This makes message based systems a great choice where reliability and data integrity is key.\n\nHowever, building distributed message based applications isn't simple. At its heart, this project uses the service bus from [@node-ts/bus](https://node-ts.gitbook.io/bus/) that encapsulates many of the complexities when dealing with messaging technologies and approaches.\n\nYour code stays cleaner, as only business logic related code needs to be written. Concerns on how a message is dispatched, routed, received, processed, retried etc are all handled by the underlying framework. This remains true regardless if the app operates in a single process in memory, or runs with many services and instances across many compute instances.\n\n### What's included\n\nThis starter project contains the following packages preconfigured and in a runnable state:\n\n* `@node-ts/bus-core` - The core service bus that manages sending, routing, dispatch, retries etc\n## Installation\n\nThis repository should be cloned or forked into your own repository:\n\n```bash\ngit clone https://github.com/node-ts/bus-starter my-bus-app\ncd my-bus-app\ngit remote set-url origin \u003cyour git repo\u003e\n```\n\nThen install the dependencies\n```bash\nnpm i\n```\n\nStart a local RabbitMQ container\n```bash\ndocker run -d -p 8080:15672 -p 5672:5672 rabbitmq:3-management\n```\n\nRun the following command and observe the log output:\n```bash\nnpm run dev\n```\n\nAt this point you can remove the existing messages/handlers/workflows and start implementing your own. Before moving to production, be sure to do the following tasks:\n\n* configure a different [transport](hhttps://node-ts.gitbook.io/bus/reference/transports)\n* install a [durable persistence](https://node-ts.gitbook.io/bus/reference/persistence)\n\nThese steps are crucial to ensuring your application is resilient and scalable\n\n## Scripts\n\nThe following scripts are available as part of the starter project:\n\n* `build` - transpiles the code to `/dist`\n* `dev` - transpiles, runs and watches for code changes\n* `lint` - runs linting based on [@node-ts/code-standards](https://github.com/node-ts/code-standards)\n* `lint:fix` - attempts to fix linting violations\n* `test` - run all tests\n* `test:watch` - run tests in watch mode\n\n## Running\n\nA small implementation of a distributed application has been made to demonstrate a generic project structure. This should be removed and replaced with your implementation.\n\nThe example used is testing sirens for correct operation (such as in a building fire alarm test). When a siren is tested, it publishes an event depending on success or failure. If a failure event is published, a workflow coordinates the sending of an email to the maintenance team to fix the siren.\n\nThis is a basic demonstration, but it shows how distributed systems can stay decoupled. By publishing an event that the siren is broken and orchestrating the remediation steps in a workflow, all commands of the system can adhere to the single responsibility principle and be reused without side effects.\n\n## Further Information\n\nFor more information on how to use the service bus, visit [@node-ts/bus](https://node-ts.gitbook.io/bus/).\n\nIf you're interested in Domain Driven Design to help design your code that reduces complexity, have a look at [@node-ts/ddd](https://github.com/node-ts/ddd) which integrates seamlessly with the service bus.\n\n## License\n\nThe MIT License (MIT)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-ts%2Fbus-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnode-ts%2Fbus-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-ts%2Fbus-starter/lists"}