{"id":15630643,"url":"https://github.com/mp911de/cleanarchitecture","last_synced_at":"2025-04-13T06:42:27.463Z","repository":{"id":9825156,"uuid":"11811136","full_name":"mp911de/CleanArchitecture","owner":"mp911de","description":"CleanArchitecture Example","archived":false,"fork":false,"pushed_at":"2020-06-13T10:08:05.000Z","size":160,"stargazers_count":232,"open_issues_count":3,"forks_count":69,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-03-24T11:56:58.150Z","etag":null,"topics":["architecture","cleanarchitecture","hexagonal","java","onion-architecture"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/mp911de.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":"2013-08-01T07:49:59.000Z","updated_at":"2025-03-04T00:24:11.000Z","dependencies_parsed_at":"2022-09-17T16:50:34.437Z","dependency_job_id":null,"html_url":"https://github.com/mp911de/CleanArchitecture","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/mp911de%2FCleanArchitecture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mp911de%2FCleanArchitecture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mp911de%2FCleanArchitecture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mp911de%2FCleanArchitecture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mp911de","download_url":"https://codeload.github.com/mp911de/CleanArchitecture/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248675440,"owners_count":21143763,"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":["architecture","cleanarchitecture","hexagonal","java","onion-architecture"],"created_at":"2024-10-03T10:34:19.569Z","updated_at":"2025-04-13T06:42:27.437Z","avatar_url":"https://github.com/mp911de.png","language":"Java","readme":"Sampler for Clean Architecture/Onion-Architecture [![Build Status](https://snap-ci.com/mp911de/CleanArchitecture/branch/master/build_image)](https://snap-ci.com/mp911de/CleanArchitecture/branch/master)\n========================\nAuthor: Mark Paluch\u003cbr/\u003e\nTechnologies: CDI, JSF, JPA, EJB, JPA, JAX-RS\u003cbr/\u003e\nSummary: Example Application built using an Onion-Architecture that incorporates multiple technologies\u003cbr/\u003e\nSource: \u003chttps://github.com/mp911de/CleanArchitecture\u003e\u003cbr/\u003e\n\nMore Information: \u003cbr/\u003e\n* https://www.paluch.biz/blog/80-clean-your-architecture-databases-the-web-and-service-interfaces-are-just-plugins.html\n* https://www.paluch.biz/blog/83-clean-architecture-code-examples-for-an-onion-architecture.html\n\nWhat is it?\n-----------\nThis simple application consists of a few use cases. The purpose of the application is to show how to\napply clean architecture patterns in a Multi-Module Maven/Java environment.\n\nIt all starts with the data structures/entities/application model. These models are independent of business logic and delivery mechanisms. The models are specific to your domain, but not necessary specific to your application. They live within the `application-model` module. Business rules and use cases, the specific things your application does, reside within the `use-cases` module. They depend on the `application-model` and perhaps on external things that are represented by boundaries, located in `contracts`. Those boundaries are an agreement between the use case and the other side that provides a specific implementation. The `contracts` depend only on the `application-model`. No ORM entities or external-specific API/entities.\nORM, caching implementations, clients to external services implement a contract that is located in `external` and its sub-modules.\n\nAll parts are tied together by the delivery mechanism that\nintegrates the externals and connects the use cases by supplying dependencies to come the system to life.\n\nIf you need a different implementation for any external, so you can easily change that specific part without\naffecting other parts of the system.\n\nThese patterns are verified by real life projects.\n\nA word on Clean Architecture\n----------------------------\n\nAs soon as you dig into the code, you'll notice comments on the one or other class. Subject of these comments is to help\nto understand the structure and the different styles, which are possible.\n\nYou'll notice soon, there are many different styles and ways to approach the Clean Architecture style. There are use cases\nwhich are built much more simple, e. g. without input/output boundaries and direct usage of dependency injection and\nthere are use-cases which implement input boundaries and use output boundaries. \n\nIn the end it's up to you, how much you're willing to invest in your architecture. This is, however, only a variety of\nexamples to give you an impression, how to express Clean Architecture with Java.\n\n\nWhat does it?\n---------\nThe use cases are:\n\n* CreateOrUpdateItem\n* CreateOrUpdateUser\n* ListItems\n* ListOrders\n* PlaceOrder\n* PlaceOrderValidator\n\nand a few business entities:\n\n* User\n* OrderItem\n* Order\n* Item\n\nThese use cases can be accessed by REST or Web UI (JSF) and are persisted using JPA within an in-memory H2 Database\n(everything you need is included).\n\nRequirements to run the App\n-------------------\n\nAll you need to build this project is Java 6.0 (Java SDK 1.6) or better, Maven 3.0 or better.\n\nThe application this project produces is designed to be run on JBoss AS7, WildFly 8 or better.\nYou could easily change the delivery mechanism to a console application with only providing a new delivery mechanism\nand a different approach how to wire the dependencies.\n\n\nBuild and Deploy the Quickstart\n-------------------------\n\n_NOTE: The following build command assumes you have configured your Maven user settings. If you have not, you must include Maven setting arguments on the command line._\n\n1. Open a command line and navigate to the root directory of this project.\n2. Type this command to build and deploy the archive:\n\n        mvn clean package wildfly:run\n\n3. This will start a WildFly 10 instance and deploy `target/clean-architecture.war` to the newly started instance.\n \n\nAccess the application \n-------------------------\n\nThe application will be running at the following URL: \u003chttp://localhost:8080/clean-architecture/\u003e.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmp911de%2Fcleanarchitecture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmp911de%2Fcleanarchitecture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmp911de%2Fcleanarchitecture/lists"}