Lesson 03 of 11 · Foundations
Backstage architecture
How Backstage is put together: a React frontend and a Node.js backend assembled from plugins, the core plugins (catalog, scaffolder, TechDocs, search), authentication and permissions, and what changes when you run it in production.
The big picture
Browser ──► Frontend (React single-page app, made of frontend plugins)
│ REST/JSON
▼
Backend (Node.js, made of backend plugins and modules)
├── catalog entities, relations, providers, processors
├── scaffolder templates → tasks → actions (publish, register, …)
├── techdocs serves documentation sites
├── search indexes catalog, docs, …
├── auth sign-in with your IdP, issues Backstage tokens
├── permission central policy for who may do what
└── proxy / kubernetes / argocd / … (more plugins)
│
▼
PostgreSQL (production) Git servers, CI, clusters, cloud APIs (via integrations)
Everything is a plugin. Backstage itself is a framework; your organisation's Backstage is an app you build, configure and upgrade like any other service.
Backstage is like a school noticeboard with pockets. The board is the frame; each pocket (plugin) holds something different: the class list (catalog), forms to start a new club (templates), the handbook (docs). You decide which pockets to put on your board.
The new backend system
Backend features are composed in one file:
// packages/backend/src/index.ts
const backend = createBackend();
backend.add(import('@backstage/plugin-catalog-backend'));
backend.add(import('@backstage/plugin-scaffolder-backend'));
backend.add(import('@backstage/plugin-scaffolder-backend-module-gitea'));
backend.add(import('@backstage/plugin-techdocs-backend'));
backend.add(import('@backstage/plugin-auth-backend'));
backend.start();
Plugins get shared services by dependency injection (coreServices: database, logger, config, http router, scheduler, URL reader, auth). Modules extend a plugin through extension points, for example a new scaffolder action or a catalog entity provider (lesson 9).
Core plugins
- Catalog: the inventory of everything (lesson 4). Entity providers bring data in (Git discovery, IdP org sync); processors validate entities and emit relations.
- Scaffolder: runs software templates: a form, then steps made of actions (lesson 5).
- TechDocs: docs-as-code (Markdown + MkDocs) next to the code, shown on each entity's page.
- Search: one search box across catalog, docs and more.
- Integrations: shared configuration for Git hosts (GitHub, GitLab, Gitea, Bitbucket, Azure DevOps) and their credentials, used by catalog and scaffolder alike.
Authentication and permissions
- Sign-in through an auth provider (OIDC, Microsoft Entra ID, Okta, GitHub, Google…). A sign-in resolver maps the IdP identity to a
Userentity in the catalog; that is how ownership and group membership work. - Service-to-service auth between backend plugins is built in; external callers use static or JWKS-based tokens configured explicitly.
- The permission framework puts authorisation in one policy: who may see which entities, run which templates, or trigger which actions. Without a policy, every signed-in user can do everything.
Configuration
app-config.yaml (defaults), then app-config.production.yaml and environment variables override it. Secrets are referenced as ${ENV_VAR}, never written into the files.
Production checklist
| Area | Lab | Production |
|---|---|---|
| Database | SQLite in memory | PostgreSQL (managed), backups |
| Replicas | 1 | 2+ behind a load balancer |
| TechDocs | built locally | built in CI, published to object storage |
| Auth | guest | IdP sign-in, resolvers, permission policy |
| Secrets | local file | environment from a secret store |
| Image | yarn start |
yarn build-image, deployed through GitOps |
| Upgrades | when needed | monthly, with versions:bump, staged like any service |
Upgrades are part of the job
Backstage releases monthly. An app left two years behind becomes very hard to upgrade. Keep custom code in plugins and modules (not edits to core files), bump versions regularly, and treat the portal like any other production service with its own pipeline and tests.
Try it
In the lab app, open packages/backend/src/index.ts and list the registered plugins. Remove the search plugin, restart, and see what disappears. Put it back. Then check the readiness endpoint from the cheat sheet.
Recap
- Backstage is a framework; your portal is an app composed of frontend and backend plugins.
- The new backend system declares plugins and modules in
index.ts; modules extend plugins. - Core: catalog, scaffolder, TechDocs, search, integrations, auth, permissions.
- Production means PostgreSQL, replicas, CI-built docs, IdP sign-in, a permission policy and monthly upgrades.
This site is a public version of my personal engineering knowledge hub. It intentionally excludes confidential company information and internal operational details.