Understanding Software Templates
Software Templates are one of the pillars of Backstage and Red Hat Developer Hub. They let the organization package opinions, standards, and automation into flows the developer runs through a secure form.
What Are Software Templates?
A Software Template is a declarative definition that describes:
-
What will be generated (code, manifests, pipelines, catalog-info, etc.).
-
What parameters the user must provide (component name, owner).
-
What steps the template engine runs in sequence (substitute files, publish to Git, register in the catalog).
Template Structure
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
name: neuralbank-backend
title: "Neuralbank: Backend API"
description: Quarkus REST API for customer management and credit scoring
spec:
owner: platform-engineering
type: service
parameters:
- title: Component Information
properties:
name:
title: Name
type: string
default: neuralbank-backend
owner:
title: Owner (OpenShift username)
type: string
steps:
- id: fetch
name: Fetch Skeleton
action: fetch:template
input:
url: ./skeleton
- id: publish
name: Publish to Gitea
action: publish:gitea
- id: register
name: Register in Catalog
action: catalog:register
The skeleton/ directory contains template files with placeholders the engine replaces with parameter values.
Skeleton Contents
A typical skeleton includes:
-
Source code — Java/Quarkus project with
pom.xmland Dockerfile -
OpenShift manifests — Deployment, Service, Route, Gateway, HTTPRoute
-
Tekton pipeline — PipelineRun definition triggered by webhooks
-
devfile.yaml— Dev Spaces configuration -
catalog-info.yaml— Backstage Catalog registration -
Kuadrant policies — AuthPolicy and RateLimitPolicy for API security
Neuralbank Templates
| Template | Purpose | Key Resources Generated |
|---|---|---|
|
Quarkus REST API for credits and banking domain |
Deployment, Service, Pipeline, Gateway, HTTPRoute, AuthPolicy, RateLimitPolicy, API entity |
|
Web SPA connected to backend via reverse proxy |
Deployment, Service, Route, Pipeline, |
|
MCP server for AI-callable customer operations |
Deployment, Service, Pipeline, Gateway, HTTPRoute, AuthPolicy, RateLimitPolicy |
Frontend Reverse Proxy Configuration
The frontend template includes an Apache HTTPD reverse proxy that routes API calls through the Kuadrant gateway:
ProxyPreserveHost Off
ProxyPass "/api/backend/" "http://neuralbank-backend-gateway-istio:8080/api/"
ProxyPassReverse "/api/backend/" "http://neuralbank-backend-gateway-istio:8080/api/"
ProxyPass "/api/mcp/" "http://customer-service-mcp-gateway-istio:8080/"
ProxyPassReverse "/api/mcp/" "http://customer-service-mcp-gateway-istio:8080/"
This ensures all API traffic flows through the Kuadrant-managed gateways with authentication and rate limiting applied.
catalog-info.yaml
Each template generates a catalog-info.yaml that registers the component in Developer Hub:
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: ${{values.uniqueName}}
annotations:
backstage.io/kubernetes-id: ${{values.uniqueName}}
argocd/app-name: ${{values.uniqueName}}
backstage.io/techdocs-ref: dir:.
spec:
type: service
lifecycle: production
owner: user:default/${{values.owner}}
providesApis:
- ${{values.uniqueName}}-api