/template-axum-htmx-tailwind

Axum-based MPA using htmx for SPA-like functionality, styled with Tailwind.

Primary LanguageRust

Template: axum + htmx + tailwind

Backend

Frontend

Getting Started

This is an experimental template that I use as a base for my personal projects. There are a lot of opinionated and probably controversial design choices that I've made here. I cannot recommend using this template for your own projects, especially if you're new to Rust.

Notes

  • Internally caches asset files. JavaScript and CSS files are pre-compressed at startup with brotli with a max compression level.
  • Compresses HTML fragments with brotli at a lower compression level via tower-compression at runtime.
  • Sets Cache-Control headers for CSS, JS, WEBP, SVG, and WOFF2 by default.
  • Uses bun via the build.rs script to minify, hash, and bundle JS/TS/CSS.
  • Run with cargo watch -x run to automatically rebuild on asset / source changes.

Other Templates