This is a template repository to get started with leptos + leptodon inside an axum SSR environment.
- Click the green
Use this templatebutton and create a repository using this template. - Clone your repository.
- Rename the project to your liking:
rg -l starter ./ | xargs sed -i 's/starter/yourprojectname/g'(may need to install ripgrep). - Install cargo-leptos:
cargo install --locked cargo-leptos. - Optional steps.
- Run with:
cargo leptos serve.
The starter should now be available on http://localhost:3000.
- Run
npm install. - Run Tailwind's CSS generator:
npx tailwindcss -i input.css -o style/output.css --watch.- Tailwind is configured via
tailwind.config.jsand any additional CSS can be added at the end ofinput.css.
- Tailwind is configured via
- Setup pre-commit hooks:
pre-commit install(may need to install pre-commit first).- Pre-commit is configured via .pre-commit-config.yaml.
- Run
direnv allowto enable direnv in case you use NixOS with flakes.- direnv is configured via
.envrc,flake.nixandflake.lock.
- direnv is configured via
- Run
cd end2end; direnv allowto enable the Playwright devenv, you may need to install devenv.- Run
npm install(since you also need to install Playwright here).
- Run
- Run
playwright testto execute the tests. - Run
cargo install --locked cargo-maketo enable Makefile.toml support, some useful commands include:- Run
cargo make mimic-cifor a suite of checks your CI would run. - Run
cargo make build-starterto build the project in release mode for production deployment.
- Run
- Uses Leptos SSR, and based on https://github.com/leptos-rs/start-axum
- Rust stable version 1.92
- Tailwind v3
- Runs
cargo run codegento generate.tailwindfor Tailwind's class generation. - Generates
src/generated_demolist.rscontaining a list of all demos to construct routes and sidebar entries programmatically.- Allows for easy alphabetical sorting and reduces maintenance burden of adding/removing entries.