/axum_tailwind_template

A tamplate to quickly start development on a server driven website.

Primary LanguageRustMIT LicenseMIT

Axum-Tailwind-Template

A simple template using Axum and Tailwind to speed up your Rust development. Deploy-ready with a Dockerfile so that you can host this anywhere you can a container.

No Node/npm needed!

Based on my blog (code here).

Stack

Template Features

Comes with a configured Github CI, Dependabot, server telemetry, and basic tests.

To Do

Important

You'll need to download and install the following to begin working:

Make it your own:

  • Update the package name in the Cargo.toml
  • Update the Dockerfile with that same name
  • Update the site name and description in templates/base.html
  • Find and replace all instances in the source code of 'axum_tailwind_template' with your package name.
  • Update this README.md!

Developing

Included is a bash script in a justfile that can be run with:

just dev

This will start the Axum server and Tailwind binary in watch modes so that saves will trigger rebuilds while you're developing. On exiting this process, the Tailwind binary will minify its outputted css.

Building the Tailwind CSS separately

  • Run:
just build-tailwind
  • Or as developing, in another tab run:
just run-tailwind

to automatically compile the tailwind as you're making changes.

Also included in the justfile is:

just update

which will update dependancies and then run the tests.