{"id":31799816,"url":"https://github.com/hirannor/oms-hexagonal-architecture-ddd","last_synced_at":"2026-05-17T02:47:50.939Z","repository":{"id":301968631,"uuid":"628703249","full_name":"hirannor/oms-hexagonal-architecture-ddd","owner":"hirannor","description":"An Order Management System with Spring Boot example implementing Ports \u0026 Adapters / Hexagonal Architecture with Domain-Driven Design (DDD) principles.","archived":false,"fork":false,"pushed_at":"2025-10-05T11:26:29.000Z","size":840,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-05T13:19:28.762Z","etag":null,"topics":["architecture","clean-architecture","ddd","ddd-patterns","event-driven","eventbus","hexagonal-architecture","java","jdk21","messaging","messaging-queue","port-and-adapters","rabbitmq","rest","software-architecture","software-development","spring-boot","spring-data-jpa","springframework"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hirannor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-16T19:01:36.000Z","updated_at":"2025-10-05T11:26:33.000Z","dependencies_parsed_at":"2025-06-29T21:41:51.327Z","dependency_job_id":"3c5df0fb-30f0-454c-90a1-414c681af5ca","html_url":"https://github.com/hirannor/oms-hexagonal-architecture-ddd","commit_stats":null,"previous_names":["hirannor/springboot-hexagonal-ddd","hirannor/oms-hexagonal-architecture-ddd"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hirannor/oms-hexagonal-architecture-ddd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirannor%2Foms-hexagonal-architecture-ddd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirannor%2Foms-hexagonal-architecture-ddd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirannor%2Foms-hexagonal-architecture-ddd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirannor%2Foms-hexagonal-architecture-ddd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hirannor","download_url":"https://codeload.github.com/hirannor/oms-hexagonal-architecture-ddd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirannor%2Foms-hexagonal-architecture-ddd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005458,"owners_count":26083902,"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-10-10T02:00:06.843Z","response_time":62,"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":["architecture","clean-architecture","ddd","ddd-patterns","event-driven","eventbus","hexagonal-architecture","java","jdk21","messaging","messaging-queue","port-and-adapters","rabbitmq","rest","software-architecture","software-development","spring-boot","spring-data-jpa","springframework"],"created_at":"2025-10-10T22:50:08.681Z","updated_at":"2025-10-10T22:50:10.637Z","avatar_url":"https://github.com/hirannor.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧩 Order Management System (OMS)\n\n| CI Status                                                                                                                                                                                               | License                                                                                                                                                                                                          |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [![CI](https://github.com/hirannor/oms-hexagonal-architecture-ddd/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/hirannor/oms-hexagonal-architecture-ddd/actions/workflows/ci.yml) | [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Commons Clause](https://img.shields.io/badge/Commons-Clause-red.svg)](https://commonsclause.com/) |\n\n---\n\n## 🧭 Overview\n\nThe **Order Management System (OMS)** is a **full-stack demo project** that showcases  \nmodern enterprise application design using **Hexagonal Architecture**, **Domain-Driven Design (DDD)**,  \nand **event-driven communication** between bounded contexts.\n\n### Tech Highlights\n\n- **Backend:** Spring Boot 3 · Java 21 · Hexagonal Architecture · DDD · RabbitMQ · PostgreSQL\n- **Frontend:** Angular 20 (Nx Monorepo + NgRx) · PrimeNG · TypeScript\n- **API Contract:** Centralized [OpenAPI 3.0.3](openapi/) definitions shared between backend \u0026 frontend\n\n\u003e 📘 For in-depth domain and architecture documentation:\n\u003e\n\u003e - **Backend:** [oms-backend/README.md](oms-backend/README.md) — Spring Boot + DDD + Hexagonal Architecture\n\u003e - **Frontend:** [oms-frontend/README.md](oms-frontend/README.md) — Angular 20 + Nx + NgRx Modular Monorepo\n\n## ⚙️ Architecture Overview\n\n### Backend — Hexagonal (Ports \u0026 Adapters)\n\n| Layer           | Responsibility                                                       |\n|:----------------|:---------------------------------------------------------------------|\n| **Domain**      | Core business logic, aggregates, and domain events.                  |\n| **Application** | Use-case orchestration and coordination between domain and adapters. |\n| **Adapters**    | Persistence, messaging, web, and external system integrations.       |\n\nThe architecture enforces clear separation through **ArchUnit** tests and follows a strict dependency flow:\n\n### Frontend — Nx Modular Architecture\n\nThe Angular workspace mirrors backend bounded contexts and enforces clear separation of concerns:\n\n- `libs/\u003cdomain\u003e/\u003cdomain\u003e-feature` → **Feature-specific UI modules**  \n  Contain routed feature shells, smart/presentational components, and domain-focused UI implementations.  \n  **e.g.** `libs/product/product-feature`\n\n\n- `libs/\u003cdomain\u003e/\u003cdomain\u003e-data-access` → **State management and domain data layer**  \n  Encapsulates NgRx store, actions, reducers, selectors, effects, facades, and a service layer.  \n  Effects use the service layer, which wraps the generated OpenAPI client and maps API responses into domain models.  \n  **e.g.** `libs/product/product-data-access`\n\n\n- `libs/openapi/\u003cdomain\u003e-data-access` → **Generated OpenAPI clients for backend APIs**  \n  Auto-generated TypeScript clients containing raw API methods and models (no business logic).  \n  **e.g.** `libs/openapi/product-data-access`\n\n\n- `libs/shared` → **Reusable shared infrastructure and UI**  \n  Provides cross-cutting components, interceptors, guards, layout, and common utilities.\n\n\n- `libs/models` → **Core domain model definitions**  \n  Contains type-safe interfaces and value objects shared across all frontend libraries.\n\n\n## 🧩 Domain Model\n\n| Aggregate     | Responsibility                                                                                                           |\n|---------------|--------------------------------------------------------------------------------------------------------------------------|\n| **Customer**  | Represents a system user; handles registration, authentication, and profile management.                                  |\n| **Order**     | Full order lifecycle (creation → payment → shipment → delivery → refund); emits events like `OrderCreated`, `OrderPaid`. |\n| **Basket**    | Shopping cart per customer; add/remove products and initiate checkout.                                                   |\n| **Product**   | Catalog item with immutable attributes (id, name, price, currency).                                                      |\n| **Inventory** | Tracks stock; supports `reserve`, `release`, `deduct`; prevents overselling.                                             |\n| **Payment**   | Lifecycle via Stripe (`INITIALIZED → SUCCEEDED/FAILED/CANCELED`); emits events like `PaymentSucceeded`.                  |\n\nAll aggregates emit **domain events**, which are persisted and published asynchronously for eventual consistency.\n\n---\n\n## 📡 Messaging \u0026 Event Flow\n\nThe backend leverages an **Outbox Pattern + RabbitMQ** setup for guaranteed, reliable delivery:\n\n1. Domain events are persisted in the **Outbox** table (same transaction).\n2. A scheduled job publishes messages from Outbox → RabbitMQ exchange.\n3. Rabbit listeners consume messages and re-emit them as in-app events.\n\nThis ensures **exactly-once semantics** and stable inter-module communication.\n\n---\n\n## 🌐 Frontend (Angular + Nx + NgRx)\n\n### Key Concepts\n\n- Modular feature libraries for each domain (`auth`, `basket`, `order`, `product`, etc.)\n- Typed REST clients generated from `/openapi` using:\n  ```bash\n  npm run generate:apis\n\n![APP_1](img/app_1.gif)\n![APP_1](img/app_2.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhirannor%2Foms-hexagonal-architecture-ddd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhirannor%2Foms-hexagonal-architecture-ddd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhirannor%2Foms-hexagonal-architecture-ddd/lists"}