A Drupal-based content-management application for the publication, management and reuse of structured digital assets — predictive and simulation models, software components and their accompanying documentation. The Pattern Repository couples a curated metadata layer (typed pattern entities with WYSIWYG-edited descriptive fields and taxonomy-based tagging) with a sibling Gitea instance that holds the version-controlled source code and release artefacts of every pattern, and authenticates its users through a shared Keycloak realm.
Many digital-asset registries are either heavyweight bespoke applications or thin wikis without the metadata model needed for systematic discovery. Building one on top of Drupal lets a project leverage a mature, well-supported open-source content-management framework with a flexible entity/field model, a robust permissions system and a rich ecosystem of contributed modules (taxonomy, search, media, OIDC integration), and frees the project from re-implementing standard features.
Pairing Drupal with a Gitea instance for source-code storage gives every published pattern a real Git repository identified by the pattern's UUID, supporting tagged releases, branches and the usual Git workflow without forcing contributors onto an external platform. Authenticating users through the same Keycloak realm as the rest of the platform avoids the duplicate-identity problem that arises when each component manages its own credentials.
The pattern can be applied to any consortium or community-of-practice setting where structured, versioned digital artefacts need to be published, discovered and reused — research project deliverables, reference architectures, reusable software components, predictive-model templates — with single sign-on integration into a wider identity infrastructure.
- Publish two kinds of patterns. Model patterns (predictive or simulation models) and software-component patterns (reusable code or configuration), both authored through a structured form with shared descriptive fields and a WYSIWYG editor, taxonomy-term tagging and an optional cover image.
- Browse and discover. Type-specific listing pages (Models, Software components) presenting the published patterns as cards, an individual pattern page combining descriptive metadata with download and code-view actions, a search page supporting keyword queries and tag-based filtering, and a "My patterns" page that gives each contributor a focused view of their own contributions.
- Per-pattern source code and releases. Source-code archives uploaded through the Drupal interface are stored in a Gitea repository identified by the pattern's UUID; new releases (with tag and description) are created from the same Drupal interface and materialised as Git releases in Gitea. Source code can also be inspected directly inside the Drupal application through an embedded code viewer that reads files live from Gitea.
- Single sign-on. Authentication via Keycloak using the OIDC Authorization Code flow with PKCE, single sign-out so that logging out of the Pattern Repository terminates the wider platform session, silent background token refresh for long editorial sessions through a small Web-Worker-driven library, and redirected profile management to the Keycloak account console so user attributes are owned by the identity provider rather than by the application. The standard Drupal local login form remains in place as a fallback for the site-administrator account, so the site can still be administered if Keycloak is temporarily unavailable.
- Custom branded design. A Bootstrap-5-based custom sub-theme provides the visual identity and is reflected end-to-end into the WYSIWYG editor through dedicated CKEditor stylesheets, eliminating the "edits look one way, publication looks another way" mismatch.
- Independent deployment of application and database. The Pattern Repository's GitLab CI pipeline builds and deploys the Drupal Pod, its persistent file volume and the build-time pull secret. MariaDB and Gitea are provisioned from sibling repositories in the same Kubernetes namespace, so that the database and the application can be redeployed and rolled back independently.
- Standard Drupal capabilities. Path-aliased SEO-friendly URLs, taxonomy-driven categorisation, role-based access control, version-controlled custom theme and modules under the project's GitLab repository, and the broader Drupal contrib ecosystem available for future extensions.
The deployed Pattern Repository is the central node of a three-component triangle: Drupal serves the user-facing application, Gitea holds the source-code repositories of the published patterns, and MariaDB is the shared backend for both. Each is run as a separate Kubernetes Deployment in the same namespace.
The Drupal application is structured around a base Pattern entity with ModelPattern and SoftwareComponentPattern bundles. Both bundles share a consistent set of descriptive fields — background, functionality, purpose, short_description, input_data, output_data, internal_architecture, technology_stack, workflow_examples — managed through a WYSIWYG editor, plus an optional image, a list of taxonomy-term tags, and a foreign key into a Gitea repository. Author identity is tracked through the standard Drupal User entity, with creation and modification timestamps recorded for lifecycle management.
The custom theme provides the visual identity of the application: a complete SCSS source tree compiled to CSS, a full set of regions matching the agreed page layouts (header, nav_branding, nav_main, nav_additional, breadcrumb, content, secondary_content, sidebar_first, sidebar_second, above_footer, footer), custom Twig templates for blocks, layout, navigation, the pattern entity itself and views, and CKEditor stylesheets that propagate the publication look-and-feel into the in-page WYSIWYG editor. The base theme's global stylesheet is explicitly disabled so the custom styling fully replaces — rather than layers over — the contributed defaults.
The Keycloak wrapper module exposes three Drupal routes — /keycloak/user/login (initiates the OIDC redirect), /keycloak/user/edit (redirects to the Keycloak account console) and /keycloak/user/extend-session (refreshes the access token from the browser without a full page reload) — and implements three relevant Drupal hooks: hook_openid_connect_post_authorize to capture the Keycloak session_state, sid, audience and tokens at authentication time and persist them in the Drupal session; hook_menu_links_discovered_alter to ensure the Keycloak account-management link opens in a new tab; and hook_page_attachments_alter to attach a small client-side library that listens for Keycloak's session-status messages and silently refreshes the token when it is approaching expiry, using a dedicated Web Worker to avoid blocking the editor UI on long-running editorial sessions.
In production the application is deployed as a single Drupal Pod in the platform's Kubernetes cluster, with a persistent volume mounted at sites/default/files for user-uploaded assets and a sibling MariaDB Pod accessed through the in-cluster mariadb Service.
The Pattern Repository exists to give project consortia a curated, collaborative knowledge base where members and external contributors can publish reusable patterns — typed, structured assets capturing best practices, software components and predictive or simulation models — with descriptive metadata, version-controlled artefacts and discovery by tags. Its role is to support the systematic dissemination, reuse and long-term sustainability of project outputs by giving every digital asset a stable identity, a human-readable description, source files which contributors can edit and consumers can browse.
- Application framework: Drupal 11 (drupal/recommended-project Composer template), PHP 8.4, Apache HTTP Server.
- Persistence: MariaDB (Drupal's primary database; the same instance is shared with Gitea).
- Source-code versioning: Gitea (a separate sibling component) — every pattern entity is mirrored to a Gitea repository identified by the pattern's UUID, with releases driven from the Drupal UI.
- Authentication: Keycloak (OAuth 2.0 / OpenID Connect), the contrib drupal/keycloak module on top of openid_connect and externalauth, with single-sign-on, single-sign-out and silent token refresh.
- Theme: a custom Bootstrap-5-based sub-theme (SCSS sources, custom Twig templates, CKEditor 4/5 stylesheets so the WYSIWYG editor matches publication, bundled iconography).
- Custom Drupal modules: a Pattern entity-type module providing the base Pattern entity and its ModelPattern and SoftwareComponentPattern bundles; a Gitea integration module providing the Drupal-entity → Gitea-repository binding; a project-specific Keycloak wrapper module providing redirect routes, OIDC session linkage and silent token refresh.
- Contrib modules: pathauto (SEO-friendly URLs), entity_update (safe entity-schema updates), devel (developer tools), bootstrap5 (base theme), drush (CLI).
- Operational: Docker, Kubernetes (Deployment + Service + PVC for Drupal's sites/default/files), GitLab CI for image build (Kaniko) and rollout. The MariaDB Deployment, PVC and Service are provisioned from a sibling repository so that the database can be redeployed and rolled back independently of the Drupal application.