{"id":19710565,"url":"https://github.com/rootstrap/rails-modular-monolith-with-ddd","last_synced_at":"2025-02-27T15:30:10.842Z","repository":{"id":37260923,"uuid":"419807526","full_name":"rootstrap/rails-modular-monolith-with-ddd","owner":"rootstrap","description":"Full Modular Monolith Rails application with Domain-Driven Design approach. Inspired by https://github.com/kgrzybek/modular-monolith-with-ddd","archived":false,"fork":false,"pushed_at":"2023-06-22T19:29:07.000Z","size":3932,"stargazers_count":99,"open_issues_count":0,"forks_count":11,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-10T14:05:51.098Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/rootstrap.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":"2021-10-21T16:58:41.000Z","updated_at":"2024-12-11T06:52:59.000Z","dependencies_parsed_at":"2023-02-16T20:00:33.463Z","dependency_job_id":null,"html_url":"https://github.com/rootstrap/rails-modular-monolith-with-ddd","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/rootstrap%2Frails-modular-monolith-with-ddd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Frails-modular-monolith-with-ddd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Frails-modular-monolith-with-ddd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Frails-modular-monolith-with-ddd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootstrap","download_url":"https://codeload.github.com/rootstrap/rails-modular-monolith-with-ddd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241029230,"owners_count":19896880,"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-11T22:07:44.765Z","updated_at":"2025-02-27T15:30:10.673Z","avatar_url":"https://github.com/rootstrap.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rails Modular Monolith with DDD\n\nFull Modular Monolith Rails application with Domain-Driven Design approach. This is the Rails version of the [.NET application](https://github.com/kgrzybek/modular-monolith-with-ddd).\n\n## Repository Structure\n\nThis repository makes use of branches to organize different versions of the above-mentioned app. The branches with stable versions are prefixed with `main-` and each of them will have their own README with the appropriate details.\n\n### [main-packwerk](https://github.com/rootstrap/rails-modular-monolith-with-ddd/tree/main-packwerk)\n\nThis version of the app is a Rails monolith using [packwerk](https://github.com/Shopify/packwerk) to structure its domains into isolated components.\n\nComponents can communicate with each other in two different ways:\n1. Making use of events. This is accomplished using [ActiveSupport::Notifications](https://api.rubyonrails.org/classes/ActiveSupport/Notifications.html) which is a pub/sub system integrated into Rails, that works in a synchronous fashion.\n2. Calling methods on the public API of another component. This would be analogous to performing an HTTP API call to another service in a microservices architecture.\n\n### [main-transactional-outbox](https://github.com/rootstrap/rails-modular-monolith-with-ddd/tree/main-transactional-outbox)\n\nThis version of the app extends `main-packwerk` to replace `ActiveSupport::Notifications` for [Kafka](https://kafka.apache.org/) for sending and consuming events. This means that events are now processed asynchronously, and a step towards a microservices architecture.\n\nIt implements the [Transactional Outbox pattern](https://microservices.io/patterns/data/transactional-outbox.html) to guarantee delivery of all the events, and makes use of [Kafka Connect](https://docs.confluent.io/platform/current/connect/index.html) to do the log tailing on the DB and pushing the events to `Kafka`.\n\n`Kafka` is used through the [Karafka gem](https://github.com/karafka/karafka) which simplifies its usage.\n\nThe app and all the required services are dockerized to make it easy to work with.\n\n### [main-multi-dbs](https://github.com/rootstrap/rails-modular-monolith-with-ddd/tree/main-multi-dbs)\n\nThis version of the app extends `main-transactional-outbox` and splits the single database into multiple databases, one per domain. To achieve this, it uses [Rails Multi DB support](https://guides.rubyonrails.org/active_record_multiple_databases.html)\n\n### [main-saga](https://github.com/rootstrap/rails-modular-monolith-with-ddd/tree/main-saga)\n\nThis version of the app extends `main-multi-dbs` and implements the [Saga pattern](https://microservices.io/patterns/data/saga.html) to coordinate a transaction across the multiple DBs. It uses a Choreography-based Saga so that each local transaction publishes domain events that trigger local transactions in other domains.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootstrap%2Frails-modular-monolith-with-ddd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootstrap%2Frails-modular-monolith-with-ddd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootstrap%2Frails-modular-monolith-with-ddd/lists"}