{"id":27594368,"url":"https://github.com/apache/causeway-app-petclinic","last_synced_at":"2025-04-22T10:30:20.139Z","repository":{"id":65979275,"uuid":"195791429","full_name":"apache/causeway-app-petclinic","owner":"apache","description":"Apache Causeway™ software is a framework for rapidly developing domain-driven apps in Java. This repo contains a sample app to use as a template for getting you started.","archived":false,"fork":false,"pushed_at":"2024-09-16T15:55:10.000Z","size":3788,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-10T11:58:37.453Z","etag":null,"topics":["ddd","domain-driven-design","java","naked-objects","rad","rapid-application-development","restful-objects","web-framework"],"latest_commit_sha":null,"homepage":"https://causeway.apache.org/","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2019-07-08T10:39:04.000Z","updated_at":"2024-09-02T14:34:43.000Z","dependencies_parsed_at":"2024-05-22T23:24:21.288Z","dependency_job_id":"91c4d665-39ab-48cd-a154-c466655b16c2","html_url":"https://github.com/apache/causeway-app-petclinic","commit_stats":null,"previous_names":["apache/causeway-app-petclinic"],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcauseway-app-petclinic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcauseway-app-petclinic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcauseway-app-petclinic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcauseway-app-petclinic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/causeway-app-petclinic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248666832,"owners_count":21142320,"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":["ddd","domain-driven-design","java","naked-objects","rad","rapid-application-development","restful-objects","web-framework"],"created_at":"2025-04-22T10:30:19.054Z","updated_at":"2025-04-22T10:30:20.084Z","avatar_url":"https://github.com/apache.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= SimpleApp\n:toc:\n:toc-placement!:\n\nimage:https://github.com/apache/causeway-app-simpleapp/workflows/Build%20w/%20Maven%20+%20Jdk%208/badge.svg[]\nimage:https://github.com/apache/causeway-app-simpleapp/workflows/Build%20w/%20Maven%20+%20Jdk%2015/badge.svg[]\n\nThis is a simple link:https://causeway.apache.org[Apache Causeway] application, structured so that it can be used as a starting point for developing your own applications.\n\nIt consists of:\n\n* a single module, which you can refactor for your own domain, or take a copy of in order to ensure that your application is properly modular\n* configuration to bring in some of the more commonly used extensions: secman, command log, audit trail, execution log, session logger, flyway,quartz and excel download.\n\nYou can easily remove these extensions (or add others) in the `AppManifest`.\n\n[TIP]\n====\nIf all you want is get a feel for what the framework is all about, then take a look at the link:https://github.com/apache/causeway-app-helloworld[HelloWorld] starter app, which has the bare minimum of configuration.\n====\n\ntoc::[]\n\n== Quick start\n\n* install prereqs:\n\n** Java 11 LTS (eg link:https://adoptopenjdk.net/[Adopt OpenJDK] distribution)\n** Maven 3.6 or later (http://maven.apache.org/download.cgi[download])\n* download and unzip\n+\n[source,bash]\n----\nAPP=simpleapp\nBRANCH=master\n\nREPO=causeway-app-$APP\ncurl \"https://codeload.github.com/apache/$REPO/zip/$BRANCH\" | jar xv\nmv $REPO-$BRANCH $REPO\ncd $REPO\n----\n\n* Build using Maven:\n+\n[source,bash]\n----\nmvn clean install\n----\n\n* Download the `spring-instrument.jar` for load-time weaving (discussed in more detail xref:#orm-support[below]):\n+\n[source,bash]\n----\nmvn dependency:get -DgroupId=org.springframework -DartifactId=spring-instrument -Dversion=XXX\n----\n+\nChange \"XXX\" to the value that `${spring-framework.version}` resolves to in the webapp `pom.xml`\n\n* Run using Maven:\n+\n[source,bash]\n----\nmvn -pl webapp spring-boot:run\n----\n\n* Browse to http://localhost:8080.\n\n* Login using:\n\n** either the secman superuser:\n\n*** username: `secman-admin`\n*** password: `pass`\n\n** or as a regular user:\n\n*** username: `sven`\n*** password: `pass`\n\n+\nThe app runs with H2 running in-memory, with sample data set up using fixture scripts.\n\n* Build a Docker image\n+\n[source,bash]\n----\nexport REVISION=...                 #\u003c.\u003e\nexport DOCKER_REGISTRY_USERNAME     #\u003c.\u003e\nexport DOCKER_REGISTRY_PASSWORD     #\u003c.\u003e\n\nmvn -pl webapp -Ddocker jib:build\n----\n\u003c.\u003e used as the image tag\n\u003c.\u003e Docker Hub registry username\n\u003c.\u003e Docker Hub registry password\n+\nTo push to another container registry, change the `\u003cimage\u003e` tag in the pom.xml\n\n== Application Structure\n\nThe following table explains the contents of each of the directories:\n\n[width=\"100%\",options=\"header,footer\",stripes=\"none\",cols=\"2a,4a\"]\n|====================\n|Directory\n|Description\n\n|`module-petowner`\n|Holds the \"petowner\" module, consisting of the `PetOwner` entity and supporting services.\n\n|`module-simple`\n|Holds the \"simple\" module, consisting of the `SimpleObject` entity and supporting services.\n\n[TIP]\n====\nLarger applications should consist of multiple modules; each such module can be copied from this starter module.\n====\n\n|`module-simple-tests`\n|Holds the unit- and integration tests for `module-simple`.\n\n\n|`webapp`\n|Holds the bootstrapping classes, along with application-level scoped services and home page.\n\nThe `pom.xml` also provides goals to run the app from the command line, or to be assembled into a Docker image.\n\n|`webapp-tests`\n|Contains application-wide integration tests.\n\n|====================\n\nIt's more common for tests to reside within the same module, but we moved them into their own Maven modules because it makes them easier to be temporarily excluded, eg during initial explorations/prototyping.\n\n\n[#orm-support]\n== ORM Support\n\nThis version of the application uses EclipseLink JPA as its ORM, configured with load-time weaving.\nThis requires that the application be run with a Java agent.\n\nThe spring-boot plugin is configured to run with this agent already.\nIf you want to run from an IDE:\n\n* first, you might wish to copy the file locally:\n+\n[source,bash]\n----\ncp ~/.m2/repository/org/springframework/spring-instrument/XXX/spring-instrument-XXX.jar lib/spring-instrument.jar\n----\n+\nChange \"XXX\" to the value that `${spring-framework.version}` resolves to in the webapp `pom.xml`\n\n* Then specify the agent as a VM option:\n+\n[source,bash]\n----\n-javaagent:lib/spring-instrument.jar\n----\n\n\n\n//This version of the application uses DataNucleus as its ORM, which requires that any entities are \"enhanced\", a post-compile process.\n//\n//Normally this is done as part of a \"mvn clean install\", but the entities can also be enhanced explicity using:\n//\n//[source,bash]\n//----\n//mvn -pl module-simple datanucleus:enhance -o\n//----\n//\n//This is useful to know if the application or integration test fails to bootstrap, complaining of \"unenhanced entities\".\n//\n//TIP: You can also use `enhance-all.sh`\n\n\n== Testing\n\nThe application has both unit tests and integration tests.\n\n.Testing types\n[cols=\"5a,12a,6a,3a\", options=\"header\"]\n|===\n\n| Test type\n| Report\n| Phase\n| Skip using\n\n| Unit test\n| `target/surefire-unittest-reports`\n| `test`\n| `-DskipUTs`\n\n| Integ test\n| `target/surefire-integtest-reports`\n| `integration-test`\n| `-DskipITs`\n\n\n|===\n\n\nThese outputs can for example be processed within/published by a continuous pipeline.\n\n\n\n== Translations\n\nApache Causeway supports i18n using link:https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html[GNU .po file]s.\nThe `WEB-INF/translations.po` is the fallback (an empty value means that the key is used \"as-is\"), while `WEB-INF/translations-XX.po` files provide translations for each \"XX\" locale.\n\nTranslations are required for all domain classes and all members (actions, properties and collections) of all classes.\nThis information is available from the metamodel, and so a new template `translations.po` is generated as a side effect of running the integration tests (through a log4j2 logger).\nA good integration test to run is `ValidateDomainModel_IntegTest`.\n\nIn addition, translations are required for any validation messages triggered by the test.\nRunning an integration tests that trigger validations will result in these messages being captured as keys, for example `Smoke_IntegTest`.\n\nThe generated file should be merged with any existing translations in `WEB-INF/translations.po`, and translations obtained for any new keys (there are numerous online services that support the format).\n\n\n== Flyway\n\nThe application also demonstrates how to use Flyway to migrate the database schema.\n\nBy default the app runs using an in-memory database.\nThe Flyway example is activated using the \"SQLSERVER\" Spring Boot profile, eg:\n\n[source,bash]\n----\nmvn -Dspring.profiles.active=SQLSERVER -pl webapp install\nmvn -Dspring.profiles.active=SQLSERVER -pl webapp spring-boot:run\n----\n\nThis causes the properties defined in  `config/application-SQLSERVER.properties` file to be used in preference to those in the default `config/application.properties` file.\nIt defines the following:\n\n* `spring.flyway.url`, `spring.flyway.user` and `spring.flyway.password`\n+\nThe presence of these is enough to enable the Flyway integration\n\n* `spring.flyway.enabled`\n+\nThis is explicitly set to `true`, to override the value in the default `config/application.properties`.\n\n* `causeway.persistence.jdo-datanucleus.impl.datanucleus.schema.autoCreateAll`\n+\nThis is set to `false`, also overriding the value in the default `config/application.properties`.\nIt instructs the JDO/DataNucleus object store not to automatically create any tables etc.\n\nThe Spring Boot profile is also used to add the dependency to the SQL Server driver is included (it is hidden behind a Maven profile).\n\nThe prerequisites to try this out are a SQL Server database running on `localhost` and with the credentials as specified in `config/application-SQLSERVER.properties`; adjust as necessary.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fcauseway-app-petclinic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fcauseway-app-petclinic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fcauseway-app-petclinic/lists"}