{"id":15530660,"url":"https://github.com/rvanlaak/domain-event-to-bus","last_synced_at":"2026-02-08T08:31:36.619Z","repository":{"id":179454980,"uuid":"663492382","full_name":"rvanlaak/domain-event-to-bus","owner":"rvanlaak","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-26T13:22:48.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-12T18:18:40.983Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/rvanlaak.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-07-07T12:20:21.000Z","updated_at":"2024-11-26T13:22:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"af1e340e-0533-4dd8-88ee-c389574e6df4","html_url":"https://github.com/rvanlaak/domain-event-to-bus","commit_stats":{"total_commits":4,"total_committers":2,"mean_commits":2.0,"dds":0.25,"last_synced_commit":"05de7d49ac026570b3ce9488431b3db192ca04e0"},"previous_names":["rvanlaak/domain-event-to-bus"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rvanlaak/domain-event-to-bus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvanlaak%2Fdomain-event-to-bus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvanlaak%2Fdomain-event-to-bus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvanlaak%2Fdomain-event-to-bus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvanlaak%2Fdomain-event-to-bus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rvanlaak","download_url":"https://codeload.github.com/rvanlaak/domain-event-to-bus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvanlaak%2Fdomain-event-to-bus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29225477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T06:05:31.539Z","status":"ssl_error","status_checked_at":"2026-02-08T05:58:33.853Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-10-02T11:23:32.242Z","updated_at":"2026-02-08T08:31:36.605Z","avatar_url":"https://github.com/rvanlaak.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# domain-event-to-bus\n\nThis repository demonstrates some principles and patterns around handling a Request cycle, but executing code at the correct moment.\n\n* `Controller`: The entrypoint of the application is the UserInterface layer, where controller callables receive the Request.\n\n* `Command` pattern: Let the controller callables in the UserInterface layer create and dispatch a command based on the data in\nthe request. The `CommandBus` is responsible for dispatching the command, and in practice often is handled asynchronously by one or more\nbackground processes in parallel.\n\n* `Repository`: The repositories (typically implemented through an ORM like Doctrine) are responsible for interaction between the object\nand the persistence layer. The repository interfaces on the domain layer are implemented by the infrastructure layer, and used by the\napplication layer. \n\n* `CommandHandler`: The command handlers in the application layer execute the application glueing logic, and perform the tasks that are\nneeded to call a domain method on a aggregate root entity from the Domain layer. The handler is responsible for triggering that the\nrepository flushes the changes of the aggregate root entities once all business logic was completed. \n\n* `AggregateRoot`: Representation of the most important entrypoint for state and methods to apply changes to it's own internal state. The\naggregate root is responsible for keeping track of contentful domain events that happened, but not responsible for informing others about\nthat domain event yet.\n\n* `AggregateRootDomainEventDispatcher`: The class that during compilation of the framework gets injected with both the event bus and all\nrepository implementations. The dispatcher `afterFlush` method will be called by the framework once the repository flush was successful,\nand will ask all the repositories for all instances of all aggregate roots. For all the aggregate roots the domain events will be retrieved\nand the dispatcher will dispatch those domain events to the `EventBus`.\n\nSo the eventual outcome: by calling a controller, a domain event that something intentful happened will be published to the event bus, but\nonly when the domain business rules (strong, testable domain objects) and the database transaction were successful.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvanlaak%2Fdomain-event-to-bus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frvanlaak%2Fdomain-event-to-bus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvanlaak%2Fdomain-event-to-bus/lists"}