Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Hanami and htmx

Hanami and htmx

This talk is focused on the Hanami Ruby web framework and the htmx JavaScript library to craft simple and more streamlined Hypermedia REST applications which don't require large teams, tons of communication, complicated JavaScript stacks, and convoluted deployments. Instead, you are empowered to design, architect, and implement features that not only are a joy to develop and maintain but deliver happiness to your customer base as well.

Brooke Kuhlmann

April 18, 2024
Tweet

More Decks by Brooke Kuhlmann

Other Decks in Programming

Transcript

  1. Software Stack Svelte React Angular Ember Vue Node Webpack SASS

    Bun Post CSS Parcel esbuild alchemists.io
  2. Software Stack Svelte React Angular Ember Vue Node Webpack SASS

    Docker Kubernetes Bun Post CSS Parcel esbuild alchemists.io
  3. "Whenever you find yourself on the side of the majority,

    it is time to pause and reflect." -- Mark Twain alchemists.io
  4. Conway's Nightmare youtube.com/watch?v=5IUj1EZwpJY 👩💼 Backend Engineers 👨💼 Manager 🧑💼 Team

    Lead 👨🎨 Designers 🧟 SCRUM Master 🦹 Quality Assurance 🧑💻 Frontend Engineers 🧙 Architect 🧑🚒 Product 🧑🔧 DevOps alchemists.io
  5. "This façade can't stay up forever Someone's gonna come along

    and knock it down." -- Henry Rollins Rollins Band: Get Some Go Again L.A. Money Train 🎶 🎶 A Return to Simplicity 🤵 Full Stack Engineers htmx Hanami alchemists.io
  6. Ecosystem htmx Hanami Dry RB ROM Functional core Persistence layer

    and object mapper Web framework alchemists.io
  7. Ecosystem htmx Hanami Dry RB ROM Functional core Persistence layer

    and object mapper Web framework Hypermedia REST alchemists.io
  8. Primary Focus "If you’re looking for new ways to build

    maintainable, secure, faster and testable Ruby applications, you’re in for a treat. Hanami is built for people like you." "The goal of [htmx] is not less JavaScript, but less code, more readable and hypermedia-friendly code." alchemists.io
  9. Quick Start gem install hanami hanami new demo hanami server

    alchemists.io/projects/hanamismith alchemists.io
  10. Quick Start gem install hanami hanami new demo hanami server

    gem install hanamismith hanamismith build --name demo overmind start --proc fi le Proc fi le.dev alchemists.io/projects/hanamismith alchemists.io
  11. Quick Start gem install hanami hanami new demo hanami server

    gem install hanamismith hanamismith build --name demo overmind start --proc fi le Proc fi le.dev alchemists.io/projects/hanamismith 🚫 alchemists.io
  12. Structure the.exa.website RSpec (rspec.info) Dotenv (github.com/bkeepers/dotenv) Reek (github.com/troessner/reek) Puma (puma.io)

    RuboCop (docs.rubocop.org) SimpleCov (github.com/simplecov-ruby/simplecov) alchemists.io
  13. Providers • Prepare: Basic setup and dependency requirement. • Start:

    Any startup code necessary to make your component usable at runtime. • Stop: Any cleanup or code to properly shutdown a component. Lifecycles alchemists.io the.exa.website
  14. Providers • Prepare: Basic setup and dependency requirement. • Start:

    Any startup code necessary to make your component usable at runtime. • Stop: Any cleanup or code to properly shutdown a component. Lifecycles alchemists.io the.exa.website
  15. Providers • Prepare: Basic setup and dependency requirement. • Start:

    Any startup code necessary to make your component usable at runtime. • Stop: Any cleanup or code to properly shutdown a component. Lifecycles alchemists.io the.exa.website
  16. Providers • Prepare: Basic setup and dependency requirement. • Start:

    Any startup code necessary to make your component usable at runtime. • Stop: Any cleanup or code to properly shutdown a component. Lifecycles alchemists.io the.exa.website
  17. Providers • Prepare: Basic setup and dependency requirement. • Start:

    Any startup code necessary to make your component usable at runtime. • Stop: Any cleanup or code to properly shutdown a component. Lifecycles alchemists.io the.exa.website
  18. Providers • Prepare: Basic setup and dependency requirement. • Start:

    Any startup code necessary to make your component usable at runtime. • Stop: Any cleanup or code to properly shutdown a component. Lifecycles Dry System dry-rb.org/gems/dry-system alchemists.io the.exa.website
  19. History Roy Fielding REpresentational State Transfer (REST) 2000 Carson Gross

    2020 Tim Berners-Lee HTML/Hypermedia 1990 htmx alchemists.io
  20. History Roy Fielding REpresentational State Transfer (REST) 2000 Carson Gross

    2020 Tim Berners-Lee HTML/Hypermedia 1990 ~30 Years htmx alchemists.io
  21. History htmx 2020 Unpoly 2014 Hotwire 2021 hotwired.dev htmx.org unpoly.com

    Phoenix LiveView 2019 www.phoenixframework.org alchemists.io
  22. History htmx 2020 Unpoly 2014 Hotwire 2021 hotwired.dev htmx.org unpoly.com

    Phoenix LiveView 2019 www.phoenixframework.org alchemists.io
  23. History htmx 2020 Unpoly 2014 Hotwire 2021 hotwired.dev htmx.org unpoly.com

    Phoenix LiveView 2019 www.phoenixframework.org 🚫 alchemists.io
  24. History htmx 2020 Unpoly 2014 Hotwire 2021 hotwired.dev htmx.org unpoly.com

    🚫 Phoenix LiveView 2019 www.phoenixframework.org 🚫 alchemists.io
  25. Hypermedia As The Engine Of Application State (HATEOAS) en.wikipedia.org/wiki/HATEOAS •

    1990: HTML • 2011: JSON Hypertext Application Language format (HAL) • 2011: Siren • 2014: JSON Linked Data (JSON-LD) • 2015: JSON:API • 2017: Hydra History alchemists.io
  26. Data API (NOT REST) Browser POST: /article Host: wikipedia.org HTTP

    Server 200 OK {...} JSON JSON alchemists.io
  27. Data API (NOT REST) Browser POST: /article Host: wikipedia.org HTTP

    Server 200 OK {...} JSON JSON alchemists.io
  28. Hemo git clone https://github.com/bkuhlmann/hemo cd hemo bin/setup overmind start --proc

    fi le Proc fi le.dev alchemists.io github.com/bkuhlmann/hemo
  29. alchemists.io/articles/git_rebase Added project skeleton 📖 📄 Added tasks migration 📄

    Added database seeds 📄 Added user relation 📄 Added user factory 📄 Git Rebase alchemists.io