Skip to content

Repository files navigation

Backstage Template Builder

A Backstage plugin for visual template authoring

Backstage Plugin License: MIT

Visual authoring for Backstage scaffolder templates

What this is

Backstage scaffolder templates are powerful, but difficult to author, review, and evolve over time.

Backstage Template Builder is a Backstage frontend plugin that provides a visual editor, execution flow view, and live YAML output for creating and maintaining scaffolder templates — without hiding the underlying configuration.

This plugin is designed for platform teams who want faster, safer iteration on templates while staying fully compatible with Backstage's native scaffolder.

Key features

  • Visual template editor — Create and edit scaffolder templates using structured forms instead of hand-editing YAML
  • Live YAML view — Always see the generated YAML side-by-side to retain transparency and control
  • Template validation — Validate templates at any time with clickable issues that navigate directly to problems
  • RBAC support — Restrict access to platform engineers only using Backstage's permission system
  • Execution flow visualization — Understand how scaffolder steps execute through a clear, step-by-step flow view
  • Action discovery — Browse and add common scaffolder actions (fetch, publish, catalog, custom actions)
  • Preview experience — See what the end-user form will look like before publishing the template
  • GitHub integration — Load templates from GitHub repos with live search, push changes back with validation

Why this exists

Most Backstage adoption challenges don't come from running templates — they come from authoring and maintaining them.

This plugin focuses on:

  • Reducing YAML friction
  • Making template behavior understandable
  • Helping teams treat templates as long-lived products, not one-off files

Who it's for

  • Platform engineering teams
  • Backstage administrators
  • Architects and PMs defining golden paths
  • Anyone responsible for maintaining scaffolder templates at scale

Note: The plugin supports RBAC to ensure only authorized platform engineers can access it. See RBAC Configuration for setup instructions.

Quick Look

Create a new template New Template

Load existing templates from GitHub Load Template

Deployment Options

Choose your platform:

⚡ For RHDH (Red Hat Developer Hub) - 2 Minute Setup

Use our pre-built dynamic plugin on Quay.io:

  • Plugin Image: quay.io/balajisivarh/backstage-template-builder:latest
  • Setup: Config-only, no code changes required
  • Access: /template-builder route with automatic menu integration

Quick Setup:

  1. Add to your dynamic-plugins.yaml:
plugins:
  - package: oci://quay.io/balajisivarh/backstage-template-builder:latest!internal-plugin-backstage-template-builder
    disabled: false
    pluginConfig:
      dynamicPlugins:
        frontend:
          internal.backstage-plugin-template-builder:
            appIcons:
              - name: TemplateIcon
                importName: Description
            dynamicRoutes:
              - path: /template-builder
                importName: TemplateBuilderPage
                menuItem:
                  text: Template Builder
                  icon: TemplateIcon
  1. Restart RHDH

  2. Access at http://localhost:7007/template-builder

For detailed RHDH configuration, see RHDH Setup Guide below.

📦 For Standard Backstage - Full Integration

Install as a workspace plugin:

Not sure which? Check the Deployment Comparison Guide


Installation

Prerequisites

  • An existing Backstage instance (v1.x or higher)
  • Node.js 18+ and Yarn

Quick Start (Standard Backstage)

  1. Copy the plugin to your Backstage monorepo:

    cp -r plugins/backstage-template-builder <your-backstage-repo>/plugins/
  2. Add the plugin to your app's dependencies:

    In packages/app/package.json:

    {
      "dependencies": {
        "@internal/plugin-backstage-template-builder": "^0.1.0"
      }
    }
  3. Install dependencies:

    cd <your-backstage-repo>
    yarn install
  4. Add the route to your app:

    In packages/app/src/App.tsx:

    import { TemplateBuilderPage } from '@internal/plugin-backstage-template-builder';
    
    // Inside <FlatRoutes>
    <Route path="/template-builder" element={<TemplateBuilderPage />} />
  5. Add to the sidebar (optional):

    In packages/app/src/components/Root/Root.tsx:

    import CodeIcon from '@material-ui/icons/Code';
    
    // Inside the menu section
    <SidebarItem icon={CodeIcon} to="/template-builder" text="Template Builder" />
  6. Start Backstage:

    yarn dev
  7. Access the plugin:

    Navigate to http://localhost:3000/template-builder (or click "Template Builder" in the sidebar)

Deployment Guides

Quick Reference:

Additional Documentation:

RHDH (Red Hat Developer Hub) Setup

For RHDH deployments, use the pre-built dynamic plugin from Quay.io - no code changes required.

Quick Installation (Recommended)

Use the pre-built image from Quay.io:

  1. Add plugin to dynamic-plugins.yaml:
plugins:
  - package: oci://quay.io/balajisivarh/backstage-template-builder:latest!internal-plugin-backstage-template-builder
    disabled: false
    pluginConfig:
      dynamicPlugins:
        frontend:
          internal.backstage-plugin-template-builder:
            appIcons:
              - name: TemplateIcon
                importName: Description
            dynamicRoutes:
              - path: /template-builder
                importName: TemplateBuilderPage
                menuItem:
                  text: Template Builder
                  icon: TemplateIcon
  1. Restart RHDH:
podman compose down
podman compose up -d
  1. Access the plugin:

Navigate to http://your-rhdh-host:7007/template-builder

The "Template Builder" menu item will appear automatically in the left sidebar.

Build from Source (For Customization)

If you want to customize the plugin or build from source:

  1. Clone the repository:
git clone https://github.com/balajisiva/backstage-template-builder.git
cd backstage-template-builder/plugins/backstage-template-builder
  1. Install dependencies:
yarn install
  1. Export the dynamic plugin:
yarn export-dynamic

This creates dist-dynamic/ with the plugin bundle.

  1. Option A: Use locally in RHDH

Copy the dist-dynamic folder to your RHDH instance:

cp -r dist-dynamic /path/to/rhdh/local-plugins/backstage-template-builder

Update dynamic-plugins.yaml:

plugins:
  - package: ./local-plugins/backstage-template-builder
    disabled: false
    pluginConfig:
      dynamicPlugins:
        frontend:
          internal.backstage-plugin-template-builder:
            appIcons:
              - name: TemplateIcon
                importName: Description
            dynamicRoutes:
              - path: /template-builder
                importName: TemplateBuilderPage
                menuItem:
                  text: Template Builder
                  icon: TemplateIcon
  1. Option B: Build and push to your own registry
# Package as OCI image
npx @red-hat-developer-hub/cli@latest plugin package \
  --tag quay.io/YOUR_ORG/backstage-template-builder:v1.0.0

# Push to your registry
podman push quay.io/YOUR_ORG/backstage-template-builder:v1.0.0

Then reference your image in dynamic-plugins.yaml:

plugins:
  - package: oci://quay.io/YOUR_ORG/backstage-template-builder:v1.0.0!internal-plugin-backstage-template-builder
    disabled: false
    # ... rest of config

Configuration Options

  • Path: Change path: /template-builder to customize the URL route
  • Menu text: Change text: Template Builder to customize the sidebar label
  • Icon: Change icon: TemplateIcon to use a different Material-UI icon

Features in RHDH

All features work identically in RHDH:

  • Visual template editor
  • GitHub integration (with browser-stored PAT)
  • Live YAML preview
  • Template validation
  • Flow visualization
  • End-user preview

Permissions

By default, the plugin is accessible to all users. To restrict access, configure RBAC permissions in RHDH. The plugin exports the following permissions:

  • template.builder.use - Access the template builder
  • template.builder.create - Create new templates
  • template.builder.update - Modify existing templates

GitHub Integration

The plugin connects directly to GitHub to load and save templates. Users will need to provide a GitHub Personal Access Token:

Classic Token (recommended for simplicity):

Fine-grained Token (for more granular permissions):

Tokens are stored in the browser's localStorage and persist across sessions. They are never sent to any backend server - all GitHub API calls are made directly from the browser.

Usage

Once installed, users can:

  1. Create new templates — Click "New" to start with a blank template
  2. Load from GitHub — Import existing templates from repositories with live search
  3. Edit visually — Use the tabbed interface to configure:
    • Metadata — Name, title, description, tags, owner
    • Parameters — Input fields with validation, UI widgets, and conditional logic
    • Steps — Scaffolder actions (fetch, publish, debug, custom)
    • Output — Links displayed after template execution
  4. Validate anytime — Click "Validate" to check for errors, warnings, and issues; clickable results navigate directly to the problem
  5. Preview YAML — See live YAML output and edit directly if needed
  6. Visualize flow — View execution flow as a directed graph
  7. Preview end-user experience — See what developers will see
  8. Save to GitHub — Push templates back to repositories with pre-push validation

Development

To develop the plugin locally:

cd plugins/backstage-template-builder
yarn install
yarn start

This will start the plugin in development mode at http://localhost:3000 using Backstage's dev utilities.

Building

To build the plugin:

cd plugins/backstage-template-builder
yarn build

The build output will be in the dist/ directory.

Architecture

  • Frontend-only plugin — No backend services required
  • State management — React Context + useReducer
  • YAML generation — js-yaml library
  • Template validation — Client-side validation with smart navigation to issues
  • Drag-and-drop — @dnd-kit for parameter and step reordering
  • UI components — Radix UI primitives with Tailwind CSS
  • GitHub integration — Direct API calls from the browser with live search (no proxy needed)

Status

Early release / actively maintained

The plugin is functional and ready for use in Backstage instances. APIs and UI may evolve based on feedback.

Contributions, ideas, and feedback are welcome!

Screenshots

Visual Template Editor

Build templates using structured forms across four main sections:

Metadata - Define template identity, owner, and tags Template Metadata

Parameters - Create input fields with validation and UI widgets Template Parameters

Steps - Configure scaffolder actions with detailed inputs Template Steps

Step Detail Editor

Output - Define links shown after template execution Template Output

Execution Flow Visualization

See how your scaffolder steps execute in a visual flow diagram Flow View

End-User Preview

Preview what developers will see when using your template

Form View Template Preview Form

Review Step Template Preview Review

Completion Template Preview Done

Troubleshooting

Plugin not appearing in Backstage

  1. Verify installation:

    # Check that the plugin is in your workspace
    ls plugins/backstage-template-builder
    
    # Verify it's listed in package.json
    grep "backstage-template-builder" packages/app/package.json
  2. Clear cache and rebuild:

    yarn clean
    yarn install
    yarn dev
  3. Check browser console for any error messages

Build errors

If you get TypeScript compilation errors:

cd plugins/backstage-template-builder
rm -rf dist dist-types node_modules
yarn install
yarn build

GitHub integration issues

  • "Resource not accessible": Token needs repo scope (Classic) or Contents R/W + Metadata R (Fine-grained)
  • Token not persisting: Check that browser localStorage is enabled
  • CORS errors: The plugin makes direct API calls to GitHub - ensure your browser allows this

Roadmap

Potential future enhancements:

  • Backend service integration for template validation
  • Publish templates directly to Backstage catalog
  • Multi-user collaboration features
  • Migration to Material-UI for native Backstage styling
  • Template versioning and change history
  • Permission/RBAC integration

Contributing

Contributions, ideas, and feedback are welcome!

Please open an issue to discuss larger changes before submitting a PR.

License

MIT

About

Backstage Plugin for Visual authoring for scaffolder templates

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages