A boilerplate project for setting up a Saleor app using Rust with axum. It includes a file-based APL (if you only plan to support a single Saleor instance),
but you can easily add support for a more sophisticated APL backend (like sqlx) by implementing the AplStore
trait.
If you plan to make multiple apps, you might want to abstract the Saleor module away into its own library.
- Axum (as our webserver handler)
- Askama (as our template rendering)
- Templates use:
- Tailwind (as our CSS framework)
- HTMX (as our web "framework")
- Inter (as font)
- Templates use:
- Basic handlers for Saleor (
/api/manifest
and/api/register
) - Saleor types in their own module (
src/saleor.rs
andsrc/saleor/
)
This repository should easily get you started!
Install cynic-cli:
cargo install --locked cynic-cli
and then download the schema by running the introspect
command:
cynic introspect [YOUR_SALEOR_API_URL] -o schemas/saleor.graphql
It is recommended that you download the schema in any case, I don't have the time to update it with each Saleor version and you might not run the latest Saleor version anyways. You WILL have to modify the queries if you use a different schema and the current queries aren't working anymore (though the compiler will tell you about that).