Heavy Metal Leptos Stack with Tailwind, Axum, Sqlite, and Cargo Leptos

Overview

Heavy Metal Stack

Leptos stack with Axum, TailwindCSS, and Sqlite

This example creates a basic todo app with an Axum backend that uses Leptos' server functions to call sqlx from the client and seamlessly run it on the server. It has an sqlite DB and can be run with cargo leptos

Install Cargo Leptos

cargo install --locked cargo-leptos

Install TailwindCSS

See instructions here.

Run The Site

  1. Build the Tailwind CSS
npx tailwindcss -i styles/tailwind.css -o static/styles/output.css --watch
  1. In another window, run
cargo leptos serve

Run The Site in Dev Mode and Watch for Changes

  1. Build the Tailwind CSS and Watch
npx tailwindcss -i styles/tailwind.css -o static/styles/output.css --watch
  1. In another window, run
cargo leptos watch

Running without cargo-leptos

This template can still be used even without installing cargo-leptos, using the below process.

  1. Build the Tailwind CSS
npx tailwindcss -i styles/tailwind.css -o static/styles/output.css --watch
  1. Build the Client Side WASM
wasm-pack build --target=web --no-default-features --features=hydrate
  1. Start the server to serve the content
cargo run --no-default-features --features=ssr

You will have to rerun 2 if the client side WASM changes and 3 if the server code does. It might be safer to do both

Sources

Setup Tailwind using the instructions from here: gbj/leptos#125

You might also like...
Experiments with Rust CRDTs using Tokio web application framework Axum.

crdt-genome Synopsis Experiments with Rust CRDTs using Tokio web application framework Axum. Background Exploring some ideas of Martin Kleppmann, part

Axum web framework tutorial for beginners.

Axum Tutorial For Beginners Hello web developers! This tutorial will cover how to write simple web applications in rust with axum framework. If you ar

Yew + Axum + blog = Yab

Yew + Axum + blog = Yab

Rust Axum+SQLx Sample

rust-axum-sqlx-sample Install git clone https://github.com/web3ten0/rust-axum-sqlx-1.git cd rust-axum-sqlx-1/local docker-compose up -d sh scripts/exe

🪪 Session-based user authentication for Axum.

axum-login 🪪 Session-based user authentication for Axum. 🎨 Overview axum-login is a Tower middleware providing session-based user authentication for

🔎 Prometheus metrics middleware for Axum

Axum-Prometheus A Prometheus middleware to collect HTTP metrics for Axum applications. axum-prometheus relies on metrics_exporter_prometheus as a back

Provides json/csv/protobuf streaming support for axum

axum streams for Rust Library provides HTTP response streaming support for axum web framework: JSON array stream format JSON lines stream format CSV s

A crate built on top of `axum-sessions`, implementing the CSRF Synchronizer Token Pattern

Axum Synchronizer Token Pattern CSRF prevention This crate provides a Cross-Site Request Forgery protection layer and middleware for use with the axum

Rate Limiting middleware for Tower/Axum/Tonic/Hyper utilizing the governor crate

A Tower service and layer that provides a rate-limiting backend by governor. Based heavily on the work done for actix-governor. Works with Axum, Hyper

Owner
Ben Wishovich
I'm passionate about React, Typescript, Python, and Rust. I build unique experiences on the web. Full stack engineer with a background in SQA and Hardware
Ben Wishovich
Simple example of axum, sqlx with sqlite and utoipa (swagger) - without auth

axum_crud_api Simple example to learn creating CRUD rest apis in Rust with axum, sqlx with sqlite and utoipa (swagger) - without auth Also shows how t

null 2 Nov 12, 2022
Starter template for use with the Leptos web framework and Axum.

Leptos Axum Starter Template This is a template for use with the Leptos web framework and the cargo-leptos tool using Axum. Creating your template rep

Leptos 10 Mar 4, 2023
Leptos Axum Prisma starter with Admin dashboard and SSR/SPA website

LAPA - Leptos Axum Prisma starter with Admin dashboard and SSR/SPA website Motivation I want to have practical full-stack setup to build websites and

Alexi Chepura 2 Jul 10, 2023
axum-serde is a library that provides multiple serde-based extractors and responders for the Axum web framework.

axum-serde ?? Overview axum-serde is a library that provides multiple serde-based extractors / responses for the Axum web framework. It also offers a

GengTeng 3 Dec 12, 2023
Bare-metal software for the sounding rocket payload.

CanSat Software for the sounding rocket payload. Prerequisites cargo-make cargo-embed - Requires libusb, see cargo-embed's README.md for instructions.

COSMO PK Group 2 Dec 19, 2022
Demo of Rust and axum web framework

Demo of Rust and axum web framework Demonstration of: Rust: programming language that focuses on reliability and stability. axum: web framework that f

Joel Parker Henderson 115 Dec 29, 2022
Layers, extractors and template engine wrappers for axum based Web MVC applications

axum-template Layers, extractors and template engine wrappers for axum based Web MVC applications Getting started Cargo.toml [dependencies] axum-templ

Altair Bueno 11 Dec 15, 2022
Rust server with Axum, GraphQL and SurrealDb

??️ Article on my web Axum server, Async-GraphQl, SurrealDB template Run without any prior setup, DB is in memory: cargo run To use routes other than

null 15 Jun 26, 2023
Htmx extractors and request guards for axum.

axum-htmx axum-htmx is a small extension library providing extractors and request guards for the various htmx headers within axum. Additionally, the l

Rob 5 Aug 14, 2023
🥠 Sessions as a `tower` and `axum` middleware.

tower-sessions ?? Sessions as a `tower` and `axum` middleware. ?? Overview This crate provides sessions, key-value pairs associated with a site visito

Max Countryman 48 Oct 11, 2023