The user wants me to create a "Developer Portal" focused on "Golden Paths."
The request specifically asks for: "templates, starter repos, and docs."
1. Deconstruct the Request:
Core Concept: "Golden Paths" (also known as Paved Paths). This is a platform engineering concept. It means providing well-lit, pre-approved, and optimized workflows for developers to follow, reducing cognitive load and enforcing best practices by default.
Components Requested:
Templates: Scaffolding for new projects (e.g., backend service, frontend app).
Starter Repos: Boilerplate code with CI/CD, linting, Dockerfiles, etc., already set up.
Docs: Documentation explaining why and how to use these paths.
2. Target Audience & Tone:
Audience: Platform Engineers, DevOps teams, and Developers consuming the portal.
Tone: Professional, authoritative, encouraging, and structured. It should feel like a real internal wiki or a high-level strategy document.
3. Strategy for Content Generation:
I need to simulate the structure of a real Developer Portal. Since I can't generate actual files or host a repository, I will create a comprehensive markdown structure and code snippets that represent these artifacts.
4. Structure of the Output:
I will organize the response into three main sections, corresponding to the user's request, plus an introduction explaining the philosophy.
Phase 1: Philosophy (The "Why"): Briefly define Golden Paths.
Phase 2: The Templates (The "What"): Define what project templates look like (e.g., service-backend-node, frontend-react).
Phase 3: The Starter Repos (The "How" - Code): Provide concrete examples of folder structures and key files (like catalog-info.yaml for Backstage, Dockerfiles, CI/CD configs).
Phase 4: The Documentation (The "Map"): Create a sample documentation structure and content.
5. Drafting the Content - Specifics:
The Tool: I'll assume a standard stack like Backstage (very common for Golden Paths) or a generic internal CLI. I'll focus on the Backstage catalog-info.yaml format because it's the industry standard for this request.
Templates:
Need a "Cookiecutter" or "Yeoman" style structure.
Template A: Stateless Microservice (Go/Node).
Template B: React Frontend.
Template C: Data Pipeline Job.
Starter Repos (Code Snippets):
I need to show what makes it a Golden Path.
Dockerfile: Multi-stage build (best practice).
CI/CD (GitHub Actions): Standard workflow with security scanning (Snyk/Trivy).
Observability: OpenTelemetry setup.
Software Catalog:catalog-info.yaml.
Docs:
"Getting Started."
"The Golden Path for Backend Services."
"DevOps & Deployment."
6. Refining the "Golden Path" Concept:
It's not just code; it's opinionation. I need to emphasize that these templates come with "batteries included":
Logging/Tracing configured.
Health checks configured.
Security scanning enabled.
Standardized naming conventions.
7. Self-Correction/Review during drafting:
Initial thought: Just give a list of links.
Correction: The user wants me to create them. I must generate the actual content (or realistic placeholders) for these artifacts.
Formatting: Use Markdown code blocks heavily. Use tables for comparison.
8. Final Polish:
Add a "How to use this" section so the user knows how to take this text and turn it into a real implementation (e.g., "Put this in a Git repo and point Backstage to it").
(Self-Correction during drafting the response):
Make sure to mention Software Templates specifically, as that's the UI manifestation of Golden Paths in portals like Backstage.
Let's assemble the response. I will structure it as a "Golden Path Implementation Guide" containing the three requested pillars.
Pillar 1: Templates (The Scaffolding) -> template.yaml definitions.
Pillar 2: Starter Repos (The Code) -> Directory structure and key files (Dockerfile, main.go/app.ts).
Pillar 3: Documentation (The Knowledge Base) -> Markdown structure.
This looks solid. I will proceed with generating the response based on this structure.
This is a comprehensive guide to building a Developer Portal "Golden Path" ecosystem.
In platform engineering, a "Golden Path" is a supported, opinionated, and self-service workflow that allows developers to spin up new infrastructure or applications quickly without needing to understand the underlying complexity.
Below is the architecture for three distinct Golden Paths: Templates, Starter Repos, and Documentation.
1. The Templates (Software Catalog & Scaffolder)
Templates define how a new component is created. If you are using a portal like Backstage, these are defined in YAML.
The "Service Template" (template.yaml)
This template creates a new microservice, spins up a repo, and registers it in the catalog.
yaml
# template.yaml
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
name: spring-boot-golden-path
title: Spring Boot Backend Service
description: Standard production-ready Java service with Observability and CI/CD.
tags:
- recommended
- java
- backend
spec:
owner: platform-team
type: service
# These parameters are collected via the UI form
parameters:
- title: Service Details
required:
- component_id
- owner
properties:
component_id:
title: Name
type: string
description: Unique name of the service (e.g., "order-service").
owner:
title: Owner
type: string
description: Owner of the component
ui:field: OwnerPicker
ui:options:
allowedKinds:
- Group
- title: Infrastructure
properties:
cloud_provider:
title: Cloud Provider
type: string
default: aws
enum:
- aws
- gcp
- azure
# The steps to execute
steps:
- id: fetch-base
name: Fetch Base
action: fetch:template
input:
url: ./content/ # Points to the starter repo skeleton
values:
name: ${{ parameters.component_id }}
owner: ${{ parameters.owner }}
- id: publish
name: Publish to GitHub
action: publish:github
input:
allowedHosts: ['github.com']
description: ${{ parameters.description }}
repoUrl: 'github.com?owner=my-org&repo=${{ parameters.component_id }}'
- id: register
name: Register in Catalog
action: catalog:register
input:
catalogInfoUrl: https://github.com/my-org/${{ parameters.component_id }}/blob/main/catalog-info.yaml
# The final output links
output:
links:
- title: Repository
url: ${{ steps.publish.output.remoteUrl }}
- title: Open in Catalog
icon: catalog
entityRef: ${{ steps.register.output.entityRef }}
2. The Starter Repos (The "Batteries Included" Code)
The template pulls from a "Starter Repo." This is not just "Hello World"; it is a production-hardened skeleton.
Directory Structure
Here is the file structure for the "Golden Path" starter repo referenced in the template above.
The Golden Path pipeline ensures code quality and security scanning happen automatically.
yaml
name: Golden Path CI/CD
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
- name: Build with Maven
run: mvn clean install
security-scan:
runs-on: ubuntu-latest
needs: build-and-test
steps:
- uses: actions/checkout@v3
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
ignore-unfixed: true
deploy:
runs-on: ubuntu-latest
needs: [build-and-test, security-scan]
if: github.ref == 'refs/heads/main'
steps:
- name: Deploy to Kubernetes
run: echo "Deploying to Production via Helm..."
3. The Documentation (The Compass)
Documentation for Golden Paths must be actionable. It is not just "how to code," but "how to operate."
The "Golden Path" Landing Page (docs/index.md)
Use this structure in your portal's documentation tool (e.g., Backstage TechDocs, Confluence, or Notion).
markdown
# The Golden Paths
Welcome to the Platform Engineering Golden Paths. These paths are
supported by the Platform Team. If you deviate from these paths,
you are responsible for your own maintenance.
## 1. Backend Services (Recommended)
* **Tech Stack:** Java 17 + Spring Boot
* **Why:** Pre-wired for logging, tracing, and our internal IAM.
* **SLA:** Platform team provides support within 1 business day.
* **[Get Started ->](link-to-template)**
## 2. Frontend Applications (Recommended)
* **Tech Stack:** React + TypeScript + Vite
* **Why:** Includes shared design system components and A11y compliance.
* **[Get Started ->](link-to-template)**
## 3. Infrastructure (Terraform)
* **Tech Stack:** Terraform + Atlantis
* **[Get Started ->](link-to-template)**
The "Golden Path" Standard Guide (docs/standards.md)
This document explains what is included in the path so developers trust it.
markdown
# What is included in the Golden Path?
When you generate a repo using our Golden Path templates, the following
"batteries" are included:
### 1. Trunk-Based Development
We use a simple `main` branch strategy. The CI/CD pipeline handles versioning.
### 2. Security by Default
* **Dependabot:** Enabled automatically.
* **SAST:** Trivy scan runs on every PR.
* **Secrets:** Do not commit secrets. Use External Secrets Operator.
### 3. Observability
* **Logs:** JSON structured logging is configured via Logback.
* **Metrics:** Prometheus exporter included.
* **Tracing:** OpenTelemetry SDK pre-installed.
### 4. Support
If the build breaks due to a platform update, we fix it.
If you modify the Dockerfile and it breaks, you fix it.
Summary of Implementation
To roll this out:
Create a Monorepo or Template Organization: Store the template.yaml and the code skeleton in a dedicated git repo.
Configure the Portal: Point your Developer Portal (Backstage, Port, Mia-Platform) to scan this repo.
Socialize: Announce the "Golden Path" to the engineering organization. Emphasize the trade-off: Stick to the path, and we handle the DevOps heavy lifting.