Heavy Metal Leptos Stack with Tailwind, Axum, Sqlite, and Cargo Leptos
The Heavy Metal StackLeptos stack is a powerful tool for building server-side rendered apps with hydration. It combines Axum, TailwindCSS, and Sqlite to create a basic todo app. The stack uses Leptos’ server functions to call sqlx from the client and seamlessly run it on the server. It includes an sqlite DB and can be run with cargo leptos.
To install the Heavy Metal StackLeptos stack, follow these steps:
cargo install cargo-leptos
Install TailwindCSS by following the instructions provided here.
Server Side Rendering with cargo-leptos:
cargo leptos
cargo leptos --watch
cargo run
[package.metadata.leptos] section in the project’s configuration file and set site-root to “pkg”.<StyleSheet /> component in the root component to point towards the CSS file in the root.The Heavy Metal StackLeptos stack is a powerful tool for building server-side rendered apps with Axum, TailwindCSS, and Sqlite. It offers seamless integration with Leptos for client-server communication and includes features like automatic recompilation, CSS minification, and easy deployment. Whether using cargo leptos or setting up server side rendering without it, this stack provides a flexible and efficient solution for building robust web applications.