A complete breakdown of the architecture, tooling, and paradigms involved when returning to a server-driven architecture using HTMX, Tailwind, and Vanilla JS. This highlights how drastically the frontend footprint shrinks when the server reclaims state and routing.
- Hypermedia: HTMX (HTML attributes, out-of-band swaps, lazy-loading partials)
- Language: Vanilla JS
- Component Paradigms: Server-side templating (partials, fragments, includes), standard HTML elements
- Application Type: MPA (Multi-Page Application) / Hypermedia-Driven Application (HDA)
- Bundling: Minimal to none (Tailwind CLI for CSS generation)
- Environment Management:
mise(handles server and client tools, removing the need for dedicated frontend package management)
- Linting: Optional. ESLint can be present, but the frontend is intentionally kept dumb—focused on behaviors by design rather than complex logic.
- Formatting: Prettier
- Testing: E2E Testing (Playwright/Cypress) heavily prioritized over client component unit tests
- Request Client: Native HTML forms, HTMX attributes (
hx-get,hx-post) - Data Fetching & Caching: Server handles data fetching; relies on standard browser cache and HTMX history cache
- State Management: Server-managed state (Sessions, Database); the DOM/URL is the single source of truth on the client (HATEOAS)
- Side Effect Management: HTMX Out-of-Band (OOB) swaps,
HX-Triggerresponse headers, and Vanilla JS event listeners
- SSR (Server-Side Rendering): Pure server-rendered HTML returning full pages or targeted HTML fragments
- Routing: Standard backend framework routing, HTMX history API integration (
hx-push-url,hx-boostfor SPA-like navigation)
- Utility CSS: Tailwind CSS (built directly via Tailwind CLI)
- SVG: Inline HTML SVGs vs. actual assets
- Component Library: HTML/Tailwind snippet libraries (e.g., DaisyUI, Preline) vs. rolling your own markup
- Authorization: Standard server-side session/cookie authentication, or token-based auth (requires token syncing logic)
- Repository Management: Standard repositories (frontend is integrated directly alongside the backend server code)
- Deployment: Deploy backend server, serve minimal static assets (CSS/JS files)