Monorepo for Saleor App SDK and some apps
Find a file
djkato a9b3b102d7
Some checks failed
clippy / clippy (push) Has been cancelled
work with sdks bridge better
2024-11-15 01:39:05 +01:00
.github/workflows gh 2024-03-18 19:55:13 +01:00
app-template Fix all AppBridge payloads, split to actions and events etc 2024-11-08 01:10:59 +01:00
app-template-ui work with sdks bridge better 2024-11-15 01:39:05 +01:00
sdk Create settings manager 2024-11-15 01:38:40 +01:00
simple-payment-gateway Fix all AppBridge payloads, split to actions and events etc 2024-11-08 01:10:59 +01:00
sitemap-generator Fix all AppBridge payloads, split to actions and events etc 2024-11-08 01:10:59 +01:00
.dockerignore fix logging, docker building- sitemap args 2024-03-18 16:12:39 +01:00
.env Fix all AppBridge payloads, split to actions and events etc 2024-11-08 01:10:59 +01:00
.env.example final sitemap I think 2024-09-25 22:25:15 +02:00
.gitignore init app-template-ui 2024-06-12 16:22:08 +02:00
.neoconf.json ditch xml, let's just use sitemap.txt 2024-07-10 23:51:59 +02:00
.tokeinore add regeneration to sitemap, other fixes 2024-03-09 19:59:15 +01:00
apl.json Fix all AppBridge payloads, split to actions and events etc 2024-11-08 01:10:59 +01:00
app logo template.xcf reorganised into a workspace 2024-02-27 17:50:48 +01:00
bacon.toml refactor 2024-02-21 22:37:06 +01:00
Cargo.lock Remove Anyhow completely, slight refactoring 2024-11-15 01:37:52 +01:00
Cargo.toml Bridge progress 2024-09-27 19:11:10 +02:00
docker-compose.yml fix logging, docker building- sitemap args 2024-03-18 16:12:39 +01:00
docker-gateway.env clippy refactor, payment gateway payment flow revertion 2024-04-03 19:47:23 +02:00
docker-sitemap.env clippy refactor, payment gateway payment flow revertion 2024-04-03 19:47:23 +02:00
Dockerfile clippy refactor, payment gateway payment flow revertion 2024-04-03 19:47:23 +02:00
FUNDING.yml Prepare for publishing 2024-02-27 20:05:09 +01:00
LICENSE.md Typo 2024-03-11 17:39:13 +01:00
Makefile.toml final sitemap I think 2024-09-25 22:25:15 +02:00
README.md rename image prefix from "saleor" to "saleor-app" 2024-05-17 16:19:39 +02:00
rust-toolchain.toml Remove Anyhow completely, slight refactoring 2024-11-15 01:37:52 +01:00
schema.graphql packages 2024-06-17 22:18:48 +02:00
tests-compose.yml ditch xml, let's just use sitemap.txt 2024-07-10 23:51:59 +02:00

Buy Me a Coffee at ko-fi.com

This repo contains the following members:

Crate Description
saleor-app-sdk Types and utilities for making Saleor Apps
saleor-app-template Simple template for making Saleor apps using axum
saleor-app-sitemap Saleor App for keeping sitemap.xml uptodate
saleor-app-simple-payment-gateway Saleor App that adds payment methods: Cash on delivery, Cash on warehouse pickup, bank tranfer etc.

Using the apps

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 like so:

services:
  app-payment-gateway:
    image: ghcr.io/djkato/saleor-app-simple-payment-gateway:0.1.1
    env_file:
      - docker-gateway.env
    networks:
      - saleor-app-tier
    depends_on:
      - redis-apl
    ports:
      - 3001:3001

  app-sitemap-generator:
    image: ghcr.io/djkato/saleor-app-sitemap-generator:0.1.0
    env_file:
      - docker-sitemap.env
    networks:
      - saleor-app-tier
    depends_on:
      - redis-apl
    ports:
      - 3002:3002
    volumes:
      - sitemaps:/sitemaps

  redis-apl:
    image: bitnami/redis:latest
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
      - DISABLE_COMMANDS=FLUSHDB,FLUSHALL,CONFIG
    ports:
      - 6380:6379
    networks:
      - saleor-app-tier
    volumes:
      - redis-apl:/bitnami/redis/data

volumes:
  redis-apl:
    driver: local
    driver_opts:
      type: none
      device: ./temp/volumes/redis/
      o: bind
  sitemaps:
    driver: local
    driver_opts:
      type: none
      device: ./temp/docker-sitemaps/
      o: bind

networks:
  saleor-app-tier:
    driver: bridge

and set all necessary env variables in app-simple-gateway.env according to the env.example file.

Using this repo

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>

Unofficial Saleor App SDK

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

Unofficial Saleor App Template

Creating a new Saleor App from template

If using the saleor-app-template, create a new workspace member cargo new <project-name>,rm -rf <project-name>/* then cp -r app-template/* <project-name>/.

Adding new dependencies

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.tomladd it under depencency like: <dependency> = { workspace = true, features = [ "..." ] }.

Developing

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!

License

Each workspace member has it's license in it's own directory, mentioned in Cargo.toml.

TL;DR:

  • 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.

Docker images

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.