# spotify/backstage architecture

> Architecture diagram of the GitHub repository spotify/backstage, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/spotify/backstage
- Repository: https://github.com/spotify/backstage

## Overview

Backstage is a framework for building developer portals, centered on a software catalog and extended by plugins. A typical user-facing result is a portal page that exposes catalog information, search, project templates, or technical documentation. The graph includes these documented capabilities and sampled runtime layers for catalog processing, search, frontend routing, and backend startup. Relationships for unsampled product areas are shown only where the README documents the capability; their internal wiring is not established by the excerpts.

Main entry points: [`packages/frontend-plugin-api/src/routing/useRouteRef.tsx`](https://github.com/spotify/backstage/blob/master/packages/frontend-plugin-api/src/routing/useRouteRef.tsx) (Route resolution hook), [`plugins/search-backend/src/service/AuthorizedSearchEngine.ts`](https://github.com/spotify/backstage/blob/master/plugins/search-backend/src/service/AuthorizedSearchEngine.ts) (Authorized search), [`plugins/catalog-backend/src/processing/DefaultCatalogProcessingEngine.ts`](https://github.com/spotify/backstage/blob/master/plugins/catalog-backend/src/processing/DefaultCatalogProcessingEngine.ts) (Catalog processing), [`packages/app/src/App.tsx`](https://github.com/spotify/backstage/blob/master/packages/app/src/App.tsx) (Backstage app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Portal experience"]
  node_frontend["Backstage app<br/>[App.tsx]"]
end

subgraph group_platform["Plugin platform"]
  node_routehook["Route resolution hook<br/>[useRouteRef.tsx]"]
  node_routeref["Route references<br/>[RouteRef.ts]"]
  node_subrouteref["Subroute references<br/>[SubRouteRef.ts]"]
  node_externalroute["External route references"]
  node_backend["Backend startup"]
end

subgraph group_catalog["Software catalog"]
  node_catalogui["Catalog interface<br/>[routes.ts]"]
  node_catalogprocessing["Catalog processing"]
  node_taskpipeline["Processing task pipeline<br/>[TaskPipeline.ts]"]
  node_stitching["Entity stitching"]
  node_ingestion["Incremental ingestion"]
  node_ingestiondb[("Ingestion records")]
  node_azureprovider["Azure catalog provider"]
end

subgraph group_search["Search"]
  node_searchservice["Authorized search"]
  node_elasticsearch["Elasticsearch engine"]
  node_elasticindexer["Elasticsearch indexer"]
  node_pgsearch["PostgreSQL engine<br/>[PgSearchEngine.ts]"]
  node_pgindexer["PostgreSQL indexer"]
  node_lunr["Lunr engine"]
end

subgraph group_capabilities["Developer capabilities"]
  node_templates["Software templates<br/>[routes.ts]"]
  node_techdocs["Technical documentation<br/>[routes.ts]"]
  node_docsbuild["Documentation publishing"]
end

node_developer(("Developer"))

node_developer -.->|"uses portal"| node_frontend
node_frontend -->|"resolves routes"| node_routehook
node_routehook -->|"resolves"| node_routeref
node_routehook -->|"resolves"| node_subrouteref
node_routehook -->|"resolves"| node_externalroute
node_frontend -.->|"offers catalog"| node_catalogui
node_backend -.->|"hosts catalog"| node_catalogprocessing
node_catalogprocessing -->|"starts pipeline"| node_taskpipeline
node_catalogprocessing -->|"marks entities"| node_stitching
node_ingestion -->|"updates records"| node_ingestiondb
node_azureprovider -.->|"provides entities"| node_catalogprocessing
node_backend -.->|"hosts search"| node_searchservice
node_searchservice -.->|"queries engine"| node_elasticsearch
node_searchservice -.->|"queries engine"| node_pgsearch
node_searchservice -.->|"queries engine"| node_lunr
node_elasticsearch -->|"creates indexer"| node_elasticindexer
node_pgsearch -->|"creates indexer"| node_pgindexer
node_developer -.->|"creates projects"| node_templates
node_developer -.->|"uses documentation"| node_techdocs
node_techdocs -.->|"publishes docs"| node_docsbuild

click node_frontend "https://github.com/spotify/backstage/blob/master/packages/app/src/App.tsx"
click node_routehook "https://github.com/spotify/backstage/blob/master/packages/frontend-plugin-api/src/routing/useRouteRef.tsx"
click node_routeref "https://github.com/spotify/backstage/blob/master/packages/frontend-plugin-api/src/routing/RouteRef.ts"
click node_subrouteref "https://github.com/spotify/backstage/blob/master/packages/frontend-plugin-api/src/routing/SubRouteRef.ts"
click node_externalroute "https://github.com/spotify/backstage/blob/master/packages/frontend-plugin-api/src/routing/ExternalRouteRef.ts"
click node_backend "https://github.com/spotify/backstage/blob/master/packages/backend-app-api/src/wiring/BackstageBackend.ts"
click node_catalogui "https://github.com/spotify/backstage/blob/master/plugins/catalog/src/routes.ts"
click node_catalogprocessing "https://github.com/spotify/backstage/blob/master/plugins/catalog-backend/src/processing/DefaultCatalogProcessingEngine.ts"
click node_taskpipeline "https://github.com/spotify/backstage/blob/master/plugins/catalog-backend/src/processing/TaskPipeline.ts"
click node_stitching "https://github.com/spotify/backstage/blob/master/plugins/catalog-backend/src/database/operations/stitcher/markForStitching.ts"
click node_ingestion "https://github.com/spotify/backstage/blob/master/plugins/catalog-backend-module-incremental-ingestion/src/engine/IncrementalIngestionEngine.ts"
click node_ingestiondb "https://github.com/spotify/backstage/blob/master/plugins/catalog-backend-module-incremental-ingestion/src/database/IncrementalIngestionDatabaseManager.ts"
click node_azureprovider "https://github.com/spotify/backstage/blob/master/plugins/catalog-backend-module-azure/src/providers/AzureBlobStorageEntityProvider.ts"
click node_searchservice "https://github.com/spotify/backstage/blob/master/plugins/search-backend/src/service/AuthorizedSearchEngine.ts"
click node_elasticsearch "https://github.com/spotify/backstage/blob/master/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngine.ts"
click node_elasticindexer "https://github.com/spotify/backstage/blob/master/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.ts"
click node_pgsearch "https://github.com/spotify/backstage/blob/master/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngine.ts"
click node_pgindexer "https://github.com/spotify/backstage/blob/master/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngineIndexer.ts"
click node_lunr "https://github.com/spotify/backstage/blob/master/plugins/search-backend-node/src/engines/LunrSearchEngine.ts"
click node_templates "https://github.com/spotify/backstage/blob/master/plugins/scaffolder/src/routes.ts"
click node_techdocs "https://github.com/spotify/backstage/blob/master/plugins/techdocs/src/routes.ts"
click node_docsbuild "https://github.com/spotify/backstage/blob/master/plugins/techdocs-node/src/stages/publish/azureBlobStorage.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_frontend toneBlue
class node_routehook,node_routeref,node_subrouteref,node_externalroute,node_backend toneAmber
class node_catalogui,node_catalogprocessing,node_taskpipeline,node_stitching,node_ingestion,node_ingestiondb,node_azureprovider toneMint
class node_searchservice,node_elasticsearch,node_elasticindexer,node_pgsearch,node_pgindexer,node_lunr toneRose
class node_templates,node_techdocs,node_docsbuild,node_developer toneIndigo
```

## Components

### Portal experience

- [Backstage app](https://github.com/spotify/backstage/blob/master/packages/app/src/App.tsx): `packages/app/src/App.tsx`

### Plugin platform

- [Route resolution hook](https://github.com/spotify/backstage/blob/master/packages/frontend-plugin-api/src/routing/useRouteRef.tsx): `packages/frontend-plugin-api/src/routing/useRouteRef.tsx`
- [Route references](https://github.com/spotify/backstage/blob/master/packages/frontend-plugin-api/src/routing/RouteRef.ts): `packages/frontend-plugin-api/src/routing/RouteRef.ts`
- [Subroute references](https://github.com/spotify/backstage/blob/master/packages/frontend-plugin-api/src/routing/SubRouteRef.ts): `packages/frontend-plugin-api/src/routing/SubRouteRef.ts`
- [External route references](https://github.com/spotify/backstage/blob/master/packages/frontend-plugin-api/src/routing/ExternalRouteRef.ts): `packages/frontend-plugin-api/src/routing/ExternalRouteRef.ts`
- [Backend startup](https://github.com/spotify/backstage/blob/master/packages/backend-app-api/src/wiring/BackstageBackend.ts): `packages/backend-app-api/src/wiring/BackstageBackend.ts`

### Software catalog

- [Catalog interface](https://github.com/spotify/backstage/blob/master/plugins/catalog/src/routes.ts): `plugins/catalog/src/routes.ts`
- [Catalog processing](https://github.com/spotify/backstage/blob/master/plugins/catalog-backend/src/processing/DefaultCatalogProcessingEngine.ts): `plugins/catalog-backend/src/processing/DefaultCatalogProcessingEngine.ts`
- [Processing task pipeline](https://github.com/spotify/backstage/blob/master/plugins/catalog-backend/src/processing/TaskPipeline.ts): `plugins/catalog-backend/src/processing/TaskPipeline.ts`
- [Entity stitching](https://github.com/spotify/backstage/blob/master/plugins/catalog-backend/src/database/operations/stitcher/markForStitching.ts): `plugins/catalog-backend/src/database/operations/stitcher/markForStitching.ts`
- [Incremental ingestion](https://github.com/spotify/backstage/blob/master/plugins/catalog-backend-module-incremental-ingestion/src/engine/IncrementalIngestionEngine.ts): `plugins/catalog-backend-module-incremental-ingestion/src/engine/IncrementalIngestionEngine.ts`
- [Ingestion records](https://github.com/spotify/backstage/blob/master/plugins/catalog-backend-module-incremental-ingestion/src/database/IncrementalIngestionDatabaseManager.ts): `plugins/catalog-backend-module-incremental-ingestion/src/database/IncrementalIngestionDatabaseManager.ts`
- [Azure catalog provider](https://github.com/spotify/backstage/blob/master/plugins/catalog-backend-module-azure/src/providers/AzureBlobStorageEntityProvider.ts): `plugins/catalog-backend-module-azure/src/providers/AzureBlobStorageEntityProvider.ts`

### Search

- [Authorized search](https://github.com/spotify/backstage/blob/master/plugins/search-backend/src/service/AuthorizedSearchEngine.ts): `plugins/search-backend/src/service/AuthorizedSearchEngine.ts`
- [Elasticsearch engine](https://github.com/spotify/backstage/blob/master/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngine.ts): `plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngine.ts`
- [Elasticsearch indexer](https://github.com/spotify/backstage/blob/master/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.ts): `plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.ts`
- [PostgreSQL engine](https://github.com/spotify/backstage/blob/master/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngine.ts): `plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngine.ts`
- [PostgreSQL indexer](https://github.com/spotify/backstage/blob/master/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngineIndexer.ts): `plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngineIndexer.ts`
- [Lunr engine](https://github.com/spotify/backstage/blob/master/plugins/search-backend-node/src/engines/LunrSearchEngine.ts): `plugins/search-backend-node/src/engines/LunrSearchEngine.ts`

### Developer capabilities

- [Software templates](https://github.com/spotify/backstage/blob/master/plugins/scaffolder/src/routes.ts): `plugins/scaffolder/src/routes.ts`
- [Technical documentation](https://github.com/spotify/backstage/blob/master/plugins/techdocs/src/routes.ts): `plugins/techdocs/src/routes.ts`
- [Documentation publishing](https://github.com/spotify/backstage/blob/master/plugins/techdocs-node/src/stages/publish/azureBlobStorage.ts): `plugins/techdocs-node/src/stages/publish/azureBlobStorage.ts`

### Other components

- **Developer**

## Connections

- Developer → Backstage app: uses portal (evidence: `README.md`)
- Backstage app → Route resolution hook: resolves routes (evidence: `packages/frontend-plugin-api/src/routing/useRouteRef.tsx`)
- Route resolution hook → Route references: resolves (evidence: `packages/frontend-plugin-api/src/routing/useRouteRef.tsx`)
- Route resolution hook → Subroute references: resolves (evidence: `packages/frontend-plugin-api/src/routing/useRouteRef.tsx`)
- Route resolution hook → External route references: resolves (evidence: `packages/frontend-plugin-api/src/routing/useRouteRef.tsx`)
- Backstage app → Catalog interface: offers catalog (evidence: `README.md`)
- Backend startup → Catalog processing: hosts catalog (evidence: `README.md`)
- Catalog processing → Processing task pipeline: starts pipeline (evidence: `plugins/catalog-backend/src/processing/DefaultCatalogProcessingEngine.ts`)
- Catalog processing → Entity stitching: marks entities (evidence: `plugins/catalog-backend/src/processing/DefaultCatalogProcessingEngine.ts`)
- Incremental ingestion → Ingestion records: updates records (evidence: `plugins/catalog-backend-module-incremental-ingestion/src/engine/IncrementalIngestionEngine.ts`)
- Azure catalog provider → Catalog processing: provides entities
- Backend startup → Authorized search: hosts search (evidence: `README.md`)
- Authorized search → Elasticsearch engine: queries engine
- Authorized search → PostgreSQL engine: queries engine
- Authorized search → Lunr engine: queries engine
- Elasticsearch engine → Elasticsearch indexer: creates indexer (evidence: `plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngine.ts`)
- PostgreSQL engine → PostgreSQL indexer: creates indexer (evidence: `plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngine.ts`)
- Developer → Software templates: creates projects (evidence: `README.md`)
- Developer → Technical documentation: uses documentation (evidence: `README.md`)
- Technical documentation → Documentation publishing: publishes docs
