~couch/aaa-todoapp

91c40ed2 — Andrew Dona-Couch 1 year, 1 month ago
print url on start
dcbe5645 — Andrew Dona-Couch 1 year, 1 month ago
upgrade to aykroyd v0.3
cfe316bd — Andrew Dona-Couch 1 year, 2 months ago
304 for etag match on assets

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~couch/aaa-todoapp
read/write
git@git.sr.ht:~couch/aaa-todoapp

You can also use your local clone with git send-email.

#AAA Stack TodoMVC

This application showcases the so-called Triple-A stack for Rust web development: Axum, Askama, and Aykroyd. Axum is the web framework, fielding requests, routing them, and managing responses. Askama is the templating engine, turning our Rust data structures into HTML markup. Aykroyd is the ORM layer, making it easy to query Postgres to load and save our Rust data structures.

#Askama templates

The template files are in the directory templates. Under this directory you'll find the main index.html template as well as each of the partials.

The templates are parsed by Askama at compile time. The derive macros used in src/view.rs bring in the templates and bind them to data.

#Aykroyd queries

The PostgreSQL queries are located in the file src/db/query.rs. The derived macros used there bind each query to the input parameters and the output row. The output rows themselves are located in src/model.rs.

#Axum routing

The various HTTP routes are defined under the directory src/routes. Each handler retrieves a database connection from the application state, performs whatever actions are appropriate, then loads and returns the view appropriate for the request context.

Do not follow this link