This repo contains the following members:
Crate | Description |
---|---|
sdk | Types and utilities for making Saleor Apps |
app-template | Simple template for making Saleor apps using axum |
app-template-ui | Advanced template for Saleor apps that work inside the Dashboard, using Leptos (WASM) |
sitemap-generator | Saleor App for keeping sitemap.xml uptodate |
simple-payment-gateway | Saleor App that adds payment methods: Cash on delivery, Cash on warehouse pickup, bank tranfer etc. |
bulk-price-manipulator | Saleor App which Runs a user defined expression to change all variant prices |
To use on bare-metal, clone this repo and just run build and run the apps.
To use with Docker/k8s, you can find prebuilt docker images on the right sidebar next to the code tree under "Packages".
Simply add the package to your docker-compose.yml
, for example check docker-compose.yml
file in this repo.
and set all necessary env variables according to the env.example
file.
To use, you need to have Rust environment prepared.
Every folder represents a different workspace. To add a new lib, do cargo new <project-name> --lib
or cargo new <project-name>
for binary apps. It should appear as a new member under root Cargo.toml
To run apps propery, use cargo run -c <crate name>
SDK for building Saleor Apps
to use in your project outside this repo: cargo add saleor-app-sdk
to use in your project inside this repo, create a new workspace member and add saleor-app-sdk.workspace = true
to the members Cargo.toml
If using the app-template
, create a new workspace member cargo new <project-name>
,rm -rf <project-name>/*
then cp -r app-template/* <project-name>/
.
If using the app-template-ui
, create a new workspace member cargo new <project-name>
,rm -rf <project-name>/*
then cp -r app-template-ui/* <project-name>/
.
Workspace dependencies need to be managed manually. If you wanna add a new dependency to a single member do cargo add <dep> --package <project-name>
.
If you want to use a shared dependency, add it to the root level Cargo.toml
,
then inside your member Cargo.toml
add it under depencency like: <dependency> = { workspace = true, features = [ "..." ] }
.
To have the app rebuild during development, install bacon cargo install bacon
, then run bacon run -- <app-name>
to have bacon watch your code and rerun it on save!
If developing with leptos, use cargo-leptos
CLI, like cargo leptos watch
.
Each workspace member has it's license in it's own directory, mentioned in Cargo.toml
.
- saleor-app-sdk, saleor-app-template and the root structure fall under either MIT or Apache 2.0 at your convenience.
- Rest of the apps in this repo fall under
PolyForm-Noncommercial-1.0
. If you want to use my apps commercially, each app costs 10€ (or voluntarily more). Upon payment/donation you are allowed to use the given app commercially.
To build the docker image, log into ghcr.io via docker like docker login ghcr.io -u <USER> -p <GITHUB KEY WITH PACKAGE PERMS>
run cargo make
. To publish, run cargo push-containers
. If you want to push image to your own place, modify Makefile.toml
and Dockerfile
to include your username instead of mine.