{"id":20567351,"url":"https://github.com/sombriks/sample-htmx-spring","last_synced_at":"2026-04-09T07:02:31.201Z","repository":{"id":227359384,"uuid":"771179188","full_name":"sombriks/sample-htmx-spring","owner":"sombriks","description":"Simple htmx project using spring boot with thymeleaf as backend","archived":false,"fork":false,"pushed_at":"2024-06-23T11:23:56.000Z","size":177,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-06T09:23:00.341Z","etag":null,"topics":["bld","gradle","htmx","java","liquibase","maven","spring","spring-webflux","study-project","thymeleaf"],"latest_commit_sha":null,"homepage":"","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/sombriks.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}},"created_at":"2024-03-12T20:40:00.000Z","updated_at":"2024-06-23T11:23:59.000Z","dependencies_parsed_at":"2024-03-12T22:46:42.726Z","dependency_job_id":"d91d1a73-9d94-400c-97f9-881f8ba70e73","html_url":"https://github.com/sombriks/sample-htmx-spring","commit_stats":null,"previous_names":["sombriks/sample-htmx-spring"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sombriks/sample-htmx-spring","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sombriks%2Fsample-htmx-spring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sombriks%2Fsample-htmx-spring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sombriks%2Fsample-htmx-spring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sombriks%2Fsample-htmx-spring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sombriks","download_url":"https://codeload.github.com/sombriks/sample-htmx-spring/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sombriks%2Fsample-htmx-spring/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266076449,"owners_count":23872757,"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":["bld","gradle","htmx","java","liquibase","maven","spring","spring-webflux","study-project","thymeleaf"],"created_at":"2024-11-16T04:46:26.387Z","updated_at":"2025-12-30T22:07:04.451Z","avatar_url":"https://github.com/sombriks.png","language":"Java","readme":"# [sample-htmx-spring][repo]\n\n[![Java CI with Maven](https://github.com/sombriks/sample-htmx-spring/actions/workflows/maven.yml/badge.svg)](https://github.com/sombriks/sample-htmx-spring/actions/workflows/maven.yml)\n\n[![Java CI with Gradle](https://github.com/sombriks/sample-htmx-spring/actions/workflows/gradle.yml/badge.svg)](https://github.com/sombriks/sample-htmx-spring/actions/workflows/gradle.yml)\n\n[![Java CI with bld](https://github.com/sombriks/sample-htmx-spring/actions/workflows/bld.yml/badge.svg)](https://github.com/sombriks/sample-htmx-spring/actions/workflows/bld.yml)\n\nSimple [htmx][htmx] project using spring boot with thymeleaf as backend.\n\nGenerated by [spring initializr][initializr].\n\nSee [HELP.md][help] for further details.\n\n## Requirements\n\n- maven 3.9\n- java 17\n- htmx 2.0 (webjar)\n- spring 3.2 with webflux\n\n## How to build\n\n```bash\n./mvnw clean package\n```\n\n## How to test\n\n```bash\n./mvnw test\n```\n\n## How to run\n\n```bash\n./mvnw spring-boot:run\n```\n\nOr:\n\n```bash\njava -jar target/sample-htmx-spring-0.0.1-SNAPSHOT.jar\n```\n\n## Noteworthy\n\n- Used [functional endpoints][webflux] instead of traditional [web mvc][webmvc]\n  to make this sample more similar to the [other][javalin] [ones][koa].\n- `RouterFunctions` demands specific routes to be declared first, this is why\n  the configuration function looks slightly different from its kotlin and node\n  counterparts.\n- Spring webflux is built on top of [project reactor][reactive] and demands a\n  functional thinking way, therefore the difference in controller code.\n- [Spring repositories][repository] are a formidable abstraction.\n- Liquibase defaults in spring configuration renders a broken project because it\n  does [assume a root changelog][changelog-master] but it does not assume the\n  [changelog format][changelog-format].\n- [Thymeleaf is a little picky][thymeleaf-include] regarding the templates\n  \"includes\".\n- Added additional java build tooling, so we can compare maven, gradle and\n  [bld][bld]. It's a nice comparison and all three tools can produce a valid\n  spring boot jar.\n\n## Benchmark results\n\nThe following results for the same test applied\n[against the other versions][k6-benchmark].\n\n```bash\n \n\n          /\\      |‾‾| /‾‾/   /‾‾/   \n     /\\  /  \\     |  |/  /   /  /    \n    /  \\/    \\    |     (   /   ‾‾\\  \n   /          \\   |  |\\  \\ |  (‾)  | \n  / __________ \\  |__| \\__\\ \\_____/ .io\n\n     execution: local\n        script: benchmark-javalin.js\n        output: -\n\n     scenarios: (100.00%) 1 scenario, 10 max VUs, 1m0s max duration (incl. graceful stop):\n              * default: 10 looping VUs for 30s (gracefulStop: 30s)\n\n\n     ✓ 200 ok\n\n     checks.........................: 100.00% ✓ 153779    ✗ 0     \n     data_received..................: 121 MB  4.0 MB/s\n     data_sent......................: 12 MB   410 kB/s\n     http_req_blocked...............: avg=3.01µs  min=992ns    med=2.66µs   max=693.98µs p(90)=3.89µs  p(95)=4.87µs \n     http_req_connecting............: avg=15ns    min=0s       med=0s       max=308.55µs p(90)=0s      p(95)=0s     \n     http_req_duration..............: avg=1.84ms  min=377.23µs med=934.47µs max=1.15s    p(90)=2.44ms  p(95)=6.02ms \n       { expected_response:true }...: avg=1.84ms  min=377.23µs med=934.47µs max=1.15s    p(90)=2.44ms  p(95)=6.02ms \n     http_req_failed................: 0.00%   ✓ 0         ✗ 153779\n     http_req_receiving.............: avg=40.23µs min=12.31µs  med=34.68µs  max=4.91ms   p(90)=53.7µs  p(95)=68.91µs\n     http_req_sending...............: avg=12.65µs min=4.27µs   med=11.03µs  max=5.88ms   p(90)=17.57µs p(95)=21.96µs\n     http_req_tls_handshaking.......: avg=0s      min=0s       med=0s       max=0s       p(90)=0s      p(95)=0s     \n     http_req_waiting...............: avg=1.78ms  min=348.98µs med=887.93µs max=1.15s    p(90)=2.36ms  p(95)=5.92ms \n     http_reqs......................: 153779  5125.8185/s\n     iteration_duration.............: avg=1.93ms  min=446.6µs  med=1.02ms   max=1.15s    p(90)=2.57ms  p(95)=6.23ms \n     iterations.....................: 153779  5125.8185/s\n     vus............................: 10      min=10      max=10  \n     vus_max........................: 10      min=10      max=10  \n\n\nrunning (0m30.0s), 00/10 VUs, 153779 complete and 0 interrupted iterations\ndefault ✓ [======================================] 10 VUs  30s\n```\n\n[repo]: https://github.com/sombriks/sample-htmx-spring\n[htmx]: https://htmx.org/\n[initializr]: https://start.spring.io/#!type=maven-project\u0026language=java\u0026platformVersion=3.2.3\u0026packaging=jar\u0026jvmVersion=17\u0026groupId=sample.htmx\u0026artifactId=sample-htmx-spring\u0026name=sample-htmx-spring\u0026description=Demo%20project%20for%20HTMX%20with%20Spring%20Boot%20%2F%20Thymeleaf\u0026packageName=sample.htmx.spring\u0026dependencies=webflux,thymeleaf,data-jpa,h2,liquibase\n[help]: ./HELP.md\n[webflux]: https://docs.spring.io/spring-framework/reference/web/webflux-functional.html\n[webmvc]: https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#web\n[javalin]: https://github.com/sombriks/sample-htmx-javalin\n[koa]: https://github.com/sombriks/sample-htmx-koa\n[reactive]: https://projectreactor.io/docs/core/release/reference/#intro-reactive\n[repository]: https://docs.spring.io/spring-data/jpa/reference/jpa/query-methods.html#jpa.query-methods.query-creation\n[changelog-master]: ./src/main/resources/db/changelog/db.changelog-master.yaml\n[changelog-format]: https://docs.liquibase.com/concepts/changelogs/home.html\n[thymeleaf-include]: https://stackoverflow.com/a/77436286/420096\n[k6-benchmark]: https://github.com/sombriks/node-vs-kotlin-k6-benchmark\n[bld]: https://rife2.com/bld\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsombriks%2Fsample-htmx-spring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsombriks%2Fsample-htmx-spring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsombriks%2Fsample-htmx-spring/lists"}