A simple todo app created with HTMX and Rust, using axum as the web framework, Maud for HTML templating, SQLx for database queries and Tailwind CSS for styling.
-
Install Rust, Node.js and Docker Compose
-
Run
npm ci
(required for Tailwind CSS generation and TypeScript compilation) -
Install the SQLx CLI for compile-time verification of SQL queries:
cargo install sqlx-cli --no-default-features --features postgres,rustls
-
Copy
.env.example
to a file named.env
in the repo root- This is required for SQLx compile-time verification to work, as it needs the
DATABASE_URL
environment variable in a.env
file
- This is required for SQLx compile-time verification to work, as it needs the
-
Run
docker compose up
to start Postgres -
Run
sqlx migrate run
to create our database tables -
Run
cargo run
(this runs Tailwind and TypeScript as part of the build process)
For live reload in development, install cargo-watch and run
cargo watch -c -w src -x run
.