USHAAA is my preferred stack for developing web apps with Rust.
I'm still doing experiments with this template, so please use it at your own risk.
- UnoCSS, as a lightweight CSS with superpowers
- SurrealDB, as a multi-purpose database
- Htmx, for building a hypermedia-driven app
- Alpine, to get a bit of power to manipulate clientside state
- Axum, as a backend library
- Askama, for easy templating in Rust project
Well, for now, I will use the name USHAAA, but I cannot promise that I'll still stick to this name once I switch some of the tools inside the stack.
This template uses Docker primarily for managing both local and remote infrastructure.
The instructions to install Docker for each platform can be found here. For installing Docker Compose, here.
I've found that Fly.io is currently the easiest platform to deploy Dockerized apps.
If you don't have a Fly.io account, head to their website and create one.
You'll also need to install flyctl
, which is a CLI tool for managing Fly.io apps.
The instruction to install flyctl
for each platform can be found here.
Once you installed it, run this command to log in to your Fly.io account.
$ fly auth login
For live-reloading your source code, install cargo-watch
.
$ cargo install cargo-watch
First you should run SurrealDB. Run this script.
$ ./scripts/local_db.sh up
# The command above will use "surreal" as default DB user & password.
# To provide custom user & password, run
# $ SURREAL_USER=<custom user> SURREAL_PASS=<custom password> ./scripts/local_db.sh up
local_db.sh
accepts up
or down
option.
When you want to stop database, replace the command above with down
options.
TODO: Add description