{"id":20567347,"url":"https://github.com/sombriks/sample-htmx-rife2","last_synced_at":"2026-05-16T11:04:24.950Z","repository":{"id":238046711,"uuid":"795758516","full_name":"sombriks/sample-htmx-rife2","owner":"sombriks","description":"study project to understand rife2","archived":false,"fork":false,"pushed_at":"2024-05-06T02:48:14.000Z","size":82,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T13:12:16.685Z","etag":null,"topics":["bld","h2","htmx","java","rife2","study-project"],"latest_commit_sha":null,"homepage":"https://sombriks.com/blog/0070-build-with-bld-and-why-it-matters/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","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":"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":"2024-05-04T01:27:48.000Z","updated_at":"2024-05-06T02:58:05.000Z","dependencies_parsed_at":"2024-05-04T02:28:26.597Z","dependency_job_id":"c23e8ad8-77e7-43a6-922f-bc17b25759d6","html_url":"https://github.com/sombriks/sample-htmx-rife2","commit_stats":null,"previous_names":["sombriks/sample-htmx-rife2"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sombriks/sample-htmx-rife2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sombriks%2Fsample-htmx-rife2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sombriks%2Fsample-htmx-rife2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sombriks%2Fsample-htmx-rife2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sombriks%2Fsample-htmx-rife2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sombriks","download_url":"https://codeload.github.com/sombriks/sample-htmx-rife2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sombriks%2Fsample-htmx-rife2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33100321,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bld","h2","htmx","java","rife2","study-project"],"created_at":"2024-11-16T04:46:26.339Z","updated_at":"2026-05-16T11:04:24.922Z","avatar_url":"https://github.com/sombriks.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [sample-htmx-rife2][repo]\n\nSample [rife2][rife2]/[htmx][htmx] todos app\n\n## Requirements\n\n- java 17\n- htmx 1.9\n- rife2's [bld][bld] build system\n\n## Project setup\n\n```bash\nbld create-rife2 sample.htmx todoapp\nmv todoapp sample-htmx-rife2\ncd sample-htmx-rife2\n# that's it, ready for coding a web service\n```\n\n## How to run\n\n```bash\n./bld clean download compile run\n```\n\nOr:\n\n```bash\n./bld clean download compile uberjar\njava -jar build/dist/todoapp-0.1.0-uber.jar\n```\n\n## How to test\n\n```bash\n./bld clean download compile test\n```\n\nyou can perform a few requests too:\n\nSelect\n\n```bash\ncurl localhost:8080/todos?q=a\n```\n\nFind:\n\n```bash\ncurl localhost:8080/todos/3\n```\n\nInsert: (look! no json!)\n\n```bash\ncurl -X POST -d 'description=wash the cat' localhost:8080/todos\n```\n\nUpdate:\n\n```bash\ncurl -X PUT -d 'description=wash the cat\u0026done=true' localhost:8080/todos/4\n```\n\nDelete:\n\n```bash\ncurl -X DELETE localhost:8080/todos/5\n```\n\n## Noteworthy\n\n- Rife2 is quite complete when compared to other api frameworks, in java and\n  other languages/platforms out there.\n- The framework it's quite opinionated, and i am still trying to figure out the \n  best idiom to perform things.\n- Bld is fantastic, fastest, cleanest java build i've seen so far.\n- Like previous experiments using htmx, simplicity is promising but looking\n  through several implementations of the \"same thing\"(TM), proper template\n  construction needs a shift from the component-ish to a pipeline-ish approach.\n  distinct operations might end up having to deliver similar output and endpoint\n  terminators should be capable of composite operations to deliver final state\n  properly built for the requester scenario.\n- [Hierarchical Properties][hierarchical-properties] and fields injection makes\n  things even cleaner, [see this][update-element] for reference.\n\n## Small [k6][benchmark] benchmark:\n\n10 virtual users, during 30 seconds, on the following hardware:\n\n```bash\n[sombriks@lucien ~]()$ inxi --cpu --memory\nMemory:\n  System RAM: total: 16 GiB available: 15.31 GiB used: 8.75 GiB (57.2%)\n  Message: For most reliable report, use superuser + dmidecode.\n  Array-1: capacity: 16 GiB slots: 8 modules: 8 EC: None\n  Device-1: Controller0-ChannelA type: LPDDR4 size: 2 GiB speed: 4267 MT/s\n  Device-2: Controller0-ChannelB type: LPDDR4 size: 2 GiB speed: 4267 MT/s\n  Device-3: Controller0-ChannelC type: LPDDR4 size: 2 GiB speed: 4267 MT/s\n  Device-4: Controller0-ChannelD type: LPDDR4 size: 2 GiB speed: 4267 MT/s\n  Device-5: Controller1-ChannelA type: LPDDR4 size: 2 GiB speed: 4267 MT/s\n  Device-6: Controller1-ChannelB type: LPDDR4 size: 2 GiB speed: 4267 MT/s\n  Device-7: Controller1-ChannelC type: LPDDR4 size: 2 GiB speed: 4267 MT/s\n  Device-8: Controller1-ChannelD type: LPDDR4 size: 2 GiB speed: 4267 MT/s\nCPU:\n  Info: 10-core (2-mt/8-st) model: 12th Gen Intel Core i7-1255U bits: 64\n    type: MST AMCP cache: L2: 6.5 MiB\n  Speed (MHz): avg: 550 min/max: 400/4700:3500 cores: 1: 1111 2: 400 3: 400\n    4: 400 5: 400 6: 776 7: 630 8: 400 9: 400 10: 560 11: 503 12: 628\n```\n\nResults:\n\n```bash\n$ k6 run benchmark-javalin.js \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% ✓ 53526       ✗ 0    \n     data_received..................: 269 MB  8.9 MB/s\n     data_sent......................: 4.3 MB  143 kB/s\n     http_req_blocked...............: avg=10.85µs  min=1.81µs   med=8.87µs   max=5.82ms   p(90)=13.95µs p(95)=17.15µs\n     http_req_connecting............: avg=56ns     min=0s       med=0s       max=579.88µs p(90)=0s      p(95)=0s     \n     http_req_duration..............: avg=5.21ms   min=1.07ms   med=4.47ms   max=330.57ms p(90)=8.36ms  p(95)=10.36ms\n       { expected_response:true }...: avg=5.21ms   min=1.07ms   med=4.47ms   max=330.57ms p(90)=8.36ms  p(95)=10.36ms\n     http_req_failed................: 0.00%   ✓ 0           ✗ 53526\n     http_req_receiving.............: avg=492.18µs min=36.79µs  med=251.22µs max=20.09ms  p(90)=1.08ms  p(95)=1.58ms \n     http_req_sending...............: avg=47.16µs  min=9.68µs   med=37.82µs  max=15.81ms  p(90)=65.01µs p(95)=82.28µ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=4.67ms   min=948.82µs med=3.97ms   max=312.58ms p(90)=7.59ms  p(95)=9.38ms \n     http_reqs......................: 53526   1784.008926/s\n     iteration_duration.............: avg=5.55ms   min=1.3ms    med=4.81ms   max=331.44ms p(90)=8.76ms  p(95)=10.78ms\n     iterations.....................: 53526   1784.008926/s\n     vus............................: 10      min=10        max=10 \n     vus_max........................: 10      min=10        max=10 \n\n\nrunning (0m30.0s), 00/10 VUs, 53526 complete and 0 interrupted iterations\ndefault ✓ [======================================] 10 VUs  30s\n```\n\nFaster than [this one][spring] (9552), [this one too][javalin] (20688),\n[this][chi] (29358) and [this][koa] (7370) and only losing losing for\n[this one][fiber] (112398).\n\nImportant to say, those numbers change a lot depending on the hardware: throw\nmore cores and better ssd and spring version get better.\n\n## Further reading\n\n- https://github.com/rife2/rife2/wiki\n- https://github.com/rife2/bld/wiki\n- https://www.h2database.com/html/quickstart.html\n- https://htmx.org/docs/\n- https://k6.io/docs/examples/\n\n[repo]: https://github.com/sombriks/sample-htmx-rife2\n[rife2]: https://rife2.com/\n[htmx]: https://htmx.org/\n[bld]: https://rife2.com/bld\n[hierarchical-properties]: https://github.com/rife2/rife2/wiki/Hierarchical-Properties#property-field-injection\n[update-element]: src/main/java/sample/htmx/elements/UpdateTodoElement.java\n[benchmark]: https://github.com/sombriks/node-vs-kotlin-k6-benchmark\n[javalin]: https://github.com/sombriks/sample-htmx-javalin\n[spring]: https://github.com/sombriks/sample-htmx-spring\n[fiber]: https://github.com/sombriks/my-golang-handbook/tree/main/exercises/0015-rest-htmx\n[chi]: https://github.com/sombriks/sample-htmx-chi\n[koa]: https://github.com/sombriks/sample-htmx-koa\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsombriks%2Fsample-htmx-rife2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsombriks%2Fsample-htmx-rife2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsombriks%2Fsample-htmx-rife2/lists"}