Skip to content

An experimental HATEOAS web template for savvy Rust developers.

Notifications You must be signed in to change notification settings

MRGRAVITY817/ushaaa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

USHAAA stack

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.

What does "USHAAA" stand for?

  • 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.

Prerequisites

Docker & Docker Compose

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.

Fly.io account & flyctl

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

cargo-watch

For live-reloading your source code, install cargo-watch.

$ cargo install cargo-watch

Local Development

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.

Deployment

TODO: Add description