@jtl-software/cloud-app-template-backend-php
v0.1.1
Published
PHP (Slim 4 + JWT) backend template for JTL Platform cloud apps
Keywords
Readme
PHP Backend Template
Slim 4 + JWT verification (Ed25519, via libsodium)
Requirements
PHP 8.5+ with the sodium, curl, and json extensions (all bundled with modern PHP), plus Composer on your PATH.
No local PHP? Use the container workflow instead.
Configuration
Copy .env.example to .env and add your Client ID and Secret.
Scripts
npm run dev— installs Composer deps if needed, then serves on port 3005 via PHP's built-in servernpm run build— installs production Composer deps (--no-dev)
You can also run the server directly:
composer install
php -S localhost:3005 -t public public/index.phpAlternative: container workflow
If you don't have a local PHP setup, run everything inside a container via the Makefile. No local PHP or Composer required.
make help # list all targets
make install # composer install --no-dev
make install-dev # composer install (with dev deps)
make update # composer update
make shell # open a shell inside the composer container
make clean # remove vendor/Set CONTAINER=docker (or podman) to enable containerized mode:
CONTAINER=docker make install-dev
CONTAINER=docker make testbuild and run targets require a container runtime:
CONTAINER=docker make build # build the runtime image
CONTAINER=docker make run # build + start the server on $PORT (default 3005)Endpoints
GET /health— reports whetherCLIENT_ID/CLIENT_SECRETare configuredPOST /connect-tenant— verifies a session token during the setup flowPOST /graphql— proxies a GraphQL request to the JTL ERP API (X-Session-Tokenheader)ALL /erp-info/{tenantId}/{endpoint}— proxies a REST request to the JTL ERP API
