

- A Rust workspace with Just commands; to lint, build, clean, test, and run each crate.
- Rust linters, Docker, Docker Compose, Alpine development images, and Distroless production images.
- Axum async web framework skeleton with environment-based configurations.
- Production-ready middleware including CORS, Timeout, Structured JSON logging, and Request ID tracking via Tower components.
- Toasty ORM with PostgreSQL support to manage database migrations and type-safe queries.
- Garde to validate forms and requests.
- Utoipa to generate OpenAPI v3 specifications.
- Serde to serialize and deserialize requests.
- Modern time and date handling using Jiff with full timezone and Serde integration.
- Cryptographically secure and fast UUIDv7 generation for database primary keys.
{
"errors": {
"title": "Must be at least 1 character long",
"image_url": "Must be a valid URL"
}
}
- dev: rust:1.96.0 slim
- prod: distroless cc-debian13:nonroot
| Environment |
Rust Image Size |
Postgres Image Size |
| Development |
900 MB |
300MB |
| Production |
70 MB |
|
$~/dev/learning-rust/axum just
🚀AXUM
help # List available commands
lint # Run lints on the workspace members (cargo fmt and clippy)
check # Run cargo check on the workspace members
build # Run cargo build on the workspace members
clean # Run cargo clean on the workspace members
test # Run cargo test on the workspace members
book ... # Forward to the BOOK-SERVICE
📖BOOK SERVICE
help # List available commands
lint # Run lints (cargo fmt and clippy)
check # Run cargo check
build # Run cargo build
clean # Run cargo clean on the book_service package
test # Run cargo test
migration *cmd # Run DB migrate
app # Run server app
docker *cmd # Run docker commands
build-for-prod # Build production distroless image
.
├── Cargo.toml
├── Cargo.lock
├── crates
│ ├── book_service
│ │ ├── justfile
│ │ ├── openapi.yaml
│ │ ├── compose.yml
│ │ ├── Dockerfile
│ │ ├── prod.Dockerfile
│ │ ├── Cargo.toml
│ │ ├── src
│ │ │ ├── lib.rs
│ │ │ ├── state.rs
│ │ │ ├── routes.rs
│ │ │ ├── config.rs
│ │ │ ├── errors.rs
│ │ │ ├── openapi.rs
│ │ │ ├── bin
│ │ │ │ ├── app.rs
│ │ │ │ ├── migration.rs
│ │ │ │ └── apidoc.rs
│ │ │ ├── app
│ │ │ │ ├── mod.rs
│ │ │ │ ├── book
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ ├── handler.rs
│ │ │ │ │ └── payload.rs
│ │ │ │ └── shared
│ │ │ │ ├── mod.rs
│ │ │ │ ├── pagination.rs
│ │ │ │ └── validation.rs
│ │ │ └── models
│ │ │ ├── mod.rs
│ │ │ ├── author.rs
│ │ │ └── book.rs
│ │ ├── toasty
│ │ │ ├── history.toml
│ │ │ ├── migrations
│ │ │ │ └── 0000_migration.sql
│ │ │ └── snapshots
│ │ │ └── 0000_snapshot.toml
│ │ └── Toasty.toml
│ └── README.md
├── justfile
├── rustfmt.toml
└── LICENSE