Js-to-HTMX

js-to-HTMX

This is a project to showcase the power of HTMX. I created this small sample application for an internal engineering presenation at Spectro Cloud

The application is available in two versions: a React native version and another version using HTMX and Go. The application queries a public API endpoint for the latest prices on Bitcoin, Ethereum, and the stable coin USDC, ensuring you’re always up to date. It then presents the prices and updates them every 10 seconds. Additionally, a news section is displayed, which queries a public news API for the latest news.

Architecture

The architecture of the application is different for each application version. The React version uses a client-side rendering, Single Page Application (SPA) approach. In contrast, the HTMX version uses server-side rendering. HTMX favors server-side rendering primarily because it leverages existing web functionality, browser features, and hypermedia controls, so it doesn’t need custom JavaScript to achieve desired UX behaviors. However, using a server-side rendering architecture is not a requirement. The application can use HTMX to render the page if the API endpoint returns HTML.

Get Started 🚀

Head over to the Start Applications section in the repository for instructions on how to start the applications with Docker.

Repository

0%