Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

XMAS-App

pipeline status Latest Release

The XLeistelle model-driven application schema app is a Python web application to edit and create data according to geo-spatial standards of the XLeistelle, e.g. XPlanung, XTrasse. It is based on NiceGUI for a graphical user interface and XPlan-Tools for the data model and respective functionality.

While it could be advanced to a standalone application, its current focus is integration in QGIS to provide attribute forms etc.

Features

  • Render attribute forms for features.
  • Create and edit features in combination with the corresponding QGIS Plugin.
  • Import GML documents into a database.
  • Export GML, JSON-FG or GPKG files from a database.
  • Delete plans from a database.
  • Display and edit relations of plan objects in a tree view.

Installation

Container Image

Container images are available in the registry. They are built and signed by the pipeline and tagged per release version and per integration branch (dev-amd64); there is no latest tag. See Running via Docker Compose for configuration.

Python >= v3.11

GDAL and its Python bindings are required, so you need to make sure the GDAL system library and Python package versions match. QGIS installations come with GDAL and a Python environment that can readily be used to install the app.

Install with pip, e.g. via OSGeo4W Shell:

pip install xmas-app

Pixi

This project uses Pixi for package management. To install this repo with a self-contained environment, run

git clone https://gitlab.opencode.de/xleitstelle/xmas-app.git
cd xmas-app
pixi install

Running

Preconditions

A Postgres DB with PostGIS extension and adequate permissions for the used role. If required tables were not previously created with xplan-tools, they will be generated on initialization.

Environment Configuration

Copy the example configuration and adjust values as needed:

cp .env.example .env

.env.example documents all available variables with inline comments, including database connection, app settings, and authentication. See that file as the canonical reference.

Important:

  • Do not use the example values in production
  • All credentials and tokens must be set explicitly
  • The application will fail to start if required variables are missing

Running via Docker Compose

docker compose -f compose.yaml up -d

This spins up a complete XMAS-App stack including a PostGIS backend and Keycloak. Configure the stack via .env — see .env.example for the container-mode database settings (PGHOST=postgres, PGPORT=5432).

Optional: testing ROOT_PATH sub-path deployments

To verify running the app under a URL sub-path (so several instances can share one domain), start the reverse-proxy service via its compose profile:

ROOT_PATH=/test docker compose -f compose.yaml --profile proxy up -d

This adds an nginx container (see nginx/default.conf.template) that strips ROOT_PATH before forwarding to xmas-app, mirroring a real front-facing proxy. Browse http://localhost:${PROXY_PORT:-8000}/test/ — not xmas-app's own port directly, since ROOT_PATH only affects URL generation, not routing; see xmas_app/core/settings.py for the setting itself.

Running Locally (host machine)

First activate the Pixi shell:

pixi shell

Then run:

xmas-app

Use the local-mode database settings in .env (PGHOST=127.0.0.1, PGPORT=15432).

Optional: batch import test data

Test data can be downloaded from https://gitlab.opencode.de/xleitstelle/xplanung/testdaten, e.g. a ZIP archive with BP_Plans in v 6.0.

To import all .gml files at once, extract the archive and use:

Linux / macOS / WSL:

for f in <path>/bp/*.gml; do
  xplan-tools convert "$f" postgresql://postgres:postgres@localhost:55432/postgres
done

Windows:

for %f in (*.gml) do xplan-tools convert "%f" postgresql://postgres:postgres@127.0.0.1:55432/postgres

Authentication

The application supports two authentication modes, controlled by the AUTH_MODE environment variable.

Static token

Intended for development and testing only. Not suitable for production.

Set AUTH_MODE=static in .env. See .env.example for the token format.

Requests must include:

Authorization: Bearer <token>

Keycloak JWT (recommended for staging and production)

Validates RS256-signed access tokens issued by a Keycloak realm via the JWKS endpoint.

Set AUTH_MODE=keycloak in .env. See .env.example for the required Keycloak variables.

Note: KEYCLOAK_ISSUER must match the iss claim in the token exactly — including scheme, host, and port. KEYCLOAK_JWKS_URL is the address of the Keycloak service as seen from inside the Docker network, which may differ from the issuer URL seen by clients.

The local Keycloak instance is started automatically via compose.yaml. A development realm (realm-xmas-dev.json) is imported on first start, including a test user and the required audience mapper.

For Keycloak setup, Identity Provider federation (e.g. Microsoft Entra ID / SSO), and onboarding documentation, see keycloak/README.md.

Running Tests Locally

Integration tests use testcontainers to start a temporary PostGIS database. Make sure Docker is running before executing the tests.

The test database is seeded from a git submodule ./testdaten/ (https://gitlab.opencode.de/xleitstelle/xplanung/testdaten).

Initialize the submodule first:

git submodule update --init --recursive

Then run:

pixi run pytest tests

Troubleshooting

PyJWKClientConnectionError

The plugin can't reach the app, and the app's container log shows PyJWKClientConnectionError. Verify that the env variables are being passed correctly and that KEYCLOAK_JWKS_URL has the right value. Make sure proxy settings aren't blocking Keycloak: add keycloak to the NO_PROXY list if not yet set in the compose file.

License

The code in this repository is licensed under the EUPL-1.2-or-later

© XLeitstelle, 2025

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xmas_app-1.0.0.dev1.tar.gz (88.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xmas_app-1.0.0.dev1-py3-none-any.whl (115.2 kB view details)

Uploaded Python 3

File details

Details for the file xmas_app-1.0.0.dev1.tar.gz.

File metadata

  • Download URL: xmas_app-1.0.0.dev1.tar.gz
  • Upload date:
  • Size: 88.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.13.15 Linux/5.4.0-216-generic

File hashes

Hashes for xmas_app-1.0.0.dev1.tar.gz
Algorithm Hash digest
SHA256 06f7613865ca9e2fa082fd2c6c8cf990b77bdb1a295f5eecbb3b46e3cf5f9c95
MD5 42bda888e6f8fe95826cd5a54605b17c
BLAKE2b-256 9100556e60b851c82d1e2c362135db5f42355f00c17d3bec183e0c137e733769

See more details on using hashes here.

File details

Details for the file xmas_app-1.0.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: xmas_app-1.0.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 115.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.13.15 Linux/5.4.0-216-generic

File hashes

Hashes for xmas_app-1.0.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 40df7c9613b883f084a15c0f14e4995d46e1cbc2c74ef243e3d77de7c6fe226e
MD5 83309e0bafcf7a0b96833c3f6d9c4e0b
BLAKE2b-256 2014acabd1f56587b7d7a242bd7ddf436de52f2bddbe4bb97f8770814f7a8e68

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0.dev1 This release

2 files

0.18.6

2 files

0.18.5

2 files

0.18.4

2 files

0.18.3

2 files

0.18.2

2 files

0.18.1

2 files

0.18.0

2 files

0.17.2

2 files

0.17.1

2 files

0.17.0

2 files

0.16.2

2 files

0.16.1

2 files

0.16.0

2 files

0.15.5

2 files

0.15.4

2 files

0.15.3

2 files

0.15.2

2 files

0.15.1

2 files

0.15.0

2 files

0.14.0

2 files

0.13.1

2 files

0.13.0

2 files

0.12.2

2 files

0.12.1

2 files

0.12.0

2 files

0.11.3

2 files

0.11.2

2 files

0.11.1

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page