# seemirra/backstage-plugin-lazy-catalog architecture

> Architecture diagram of the GitHub repository seemirra/backstage-plugin-lazy-catalog, 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/seemirra/backstage-plugin-lazy-catalog
- Repository: https://github.com/seemirra/backstage-plugin-lazy-catalog

## Overview

Lazy Catalog is a Backstage extension with two ways to apply shared catalog rules: enrich entities during catalog processing, or rewrite catalog descriptors through a scaffolder action. Its rules engine loads and matches rules, then applies field changes; the processor can also generate fallback TechDocs files when a project lacks documentation. The README documents these capabilities, while sampled source confirms key registrations and calls. The app is a runnable testbed, not part of the extension’s core runtime map.

Main entry points: [`plugins/catalog-backend-module-lazy-catalog/src/processor/LazyCatalogProcessor.ts`](https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/catalog-backend-module-lazy-catalog/src/processor/LazyCatalogProcessor.ts) (Entity processor), [`plugins/scaffolder-backend-module-lazy-catalog/src/actions/writeCatalogInfo.ts`](https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/scaffolder-backend-module-lazy-catalog/src/actions/writeCatalogInfo.ts) (Descriptor write action), [`plugins/lazy-catalog-common/src/rules/apply.ts`](https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/lazy-catalog-common/src/rules/apply.ts) (Rule application), [`plugins/lazy-catalog-common/src/fallbackDocs/write.ts`](https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/lazy-catalog-common/src/fallbackDocs/write.ts) (Fallback docs writer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Catalog enrichment"]
  node_catalog_module["Catalog module<br/>[module.ts]"]
  node_processor["Entity processor"]
end

subgraph group_shared["Shared rules engine"]
  node_rules_file["Rules file<br/>[lazy-catalog.yaml]"]
  node_rules_loader["Rules loader<br/>[loadRules.ts]"]
  node_rule_match["Entity matching<br/>[match.ts]"]
  node_rule_apply["Rule application<br/>[apply.ts]"]
  node_field_paths["Field paths<br/>[path.ts]"]
  node_source_dir["Source directory<br/>[sourceDir.ts]"]
end

subgraph group_writeback["Descriptor write-back"]
  node_scaffolder_module["Scaffolder module<br/>[module.ts]"]
  node_write_action["Descriptor write action"]
end

subgraph group_docs["Fallback TechDocs"]
  node_fallback_writer["Fallback docs writer<br/>[write.ts]"]
  node_docs_templates["Fallback templates<br/>[templates.ts]"]
end

node_catalog(("Catalog processing"))
node_scaffolder(("Scaffolder task"))
node_techdocs(("TechDocs"))

node_catalog -->|"registers module"| node_catalog_module
node_catalog_module -->|"registers processor"| node_processor
node_processor -->|"loads rules"| node_rules_loader
node_rules_file -->|"provides rules"| node_rules_loader
node_processor -->|"applies rules"| node_rule_apply
node_rule_apply -->|"checks matches"| node_rule_match
node_rule_apply -->|"reads fields"| node_field_paths
node_rule_match -->|"checks fields"| node_field_paths
node_processor -->|"resolves source"| node_source_dir
node_scaffolder -->|"registers module"| node_scaffolder_module
node_scaffolder_module -->|"registers action"| node_write_action
node_write_action -->|"loads rules"| node_rules_loader
node_write_action -->|"rewrites fields"| node_rule_apply
node_write_action -->|"sets fields"| node_field_paths
node_processor -->|"ensures docs"| node_fallback_writer
node_fallback_writer -->|"renders files"| node_docs_templates
node_techdocs -.->|"reads generated docs"| node_fallback_writer

click node_catalog_module "https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/catalog-backend-module-lazy-catalog/src/module.ts"
click node_processor "https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/catalog-backend-module-lazy-catalog/src/processor/LazyCatalogProcessor.ts"
click node_rules_file "https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/lazy-catalog.yaml"
click node_rules_loader "https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/lazy-catalog-common/src/rules/loadRules.ts"
click node_rule_match "https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/lazy-catalog-common/src/rules/match.ts"
click node_rule_apply "https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/lazy-catalog-common/src/rules/apply.ts"
click node_field_paths "https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/lazy-catalog-common/src/rules/path.ts"
click node_source_dir "https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/lazy-catalog-common/src/rules/sourceDir.ts"
click node_scaffolder_module "https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/scaffolder-backend-module-lazy-catalog/src/module.ts"
click node_write_action "https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/scaffolder-backend-module-lazy-catalog/src/actions/writeCatalogInfo.ts"
click node_fallback_writer "https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/lazy-catalog-common/src/fallbackDocs/write.ts"
click node_docs_templates "https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/lazy-catalog-common/src/fallbackDocs/templates.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_catalog_module,node_processor toneBlue
class node_rules_file,node_rules_loader,node_rule_match,node_rule_apply,node_field_paths,node_source_dir toneAmber
class node_scaffolder_module,node_write_action toneMint
class node_fallback_writer,node_docs_templates,node_scaffolder toneRose
class node_catalog,node_techdocs toneIndigo
```

## Components

### Catalog enrichment

- [Catalog module](https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/catalog-backend-module-lazy-catalog/src/module.ts): `plugins/catalog-backend-module-lazy-catalog/src/module.ts`
- [Entity processor](https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/catalog-backend-module-lazy-catalog/src/processor/LazyCatalogProcessor.ts): `plugins/catalog-backend-module-lazy-catalog/src/processor/LazyCatalogProcessor.ts`

### Shared rules engine

- [Rules file](https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/lazy-catalog.yaml): `lazy-catalog.yaml`
- [Rules loader](https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/lazy-catalog-common/src/rules/loadRules.ts): `plugins/lazy-catalog-common/src/rules/loadRules.ts`
- [Entity matching](https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/lazy-catalog-common/src/rules/match.ts): `plugins/lazy-catalog-common/src/rules/match.ts`
- [Rule application](https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/lazy-catalog-common/src/rules/apply.ts): `plugins/lazy-catalog-common/src/rules/apply.ts`
- [Field paths](https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/lazy-catalog-common/src/rules/path.ts): `plugins/lazy-catalog-common/src/rules/path.ts`
- [Source directory](https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/lazy-catalog-common/src/rules/sourceDir.ts): `plugins/lazy-catalog-common/src/rules/sourceDir.ts`

### Descriptor write-back

- [Scaffolder module](https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/scaffolder-backend-module-lazy-catalog/src/module.ts): `plugins/scaffolder-backend-module-lazy-catalog/src/module.ts`
- [Descriptor write action](https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/scaffolder-backend-module-lazy-catalog/src/actions/writeCatalogInfo.ts): `plugins/scaffolder-backend-module-lazy-catalog/src/actions/writeCatalogInfo.ts`

### Fallback TechDocs

- [Fallback docs writer](https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/lazy-catalog-common/src/fallbackDocs/write.ts): `plugins/lazy-catalog-common/src/fallbackDocs/write.ts`
- [Fallback templates](https://github.com/seemirra/backstage-plugin-lazy-catalog/blob/master/plugins/lazy-catalog-common/src/fallbackDocs/templates.ts): `plugins/lazy-catalog-common/src/fallbackDocs/templates.ts`

### Other components

- **Catalog processing**
- **Scaffolder task**
- **TechDocs**

## Connections

- Catalog processing → Catalog module: registers module (evidence: `README.md`)
- Catalog module → Entity processor: registers processor (evidence: `plugins/catalog-backend-module-lazy-catalog/src/module.ts`)
- Entity processor → Rules loader: loads rules (evidence: `plugins/catalog-backend-module-lazy-catalog/src/processor/LazyCatalogProcessor.ts`)
- Rules file → Rules loader: provides rules (evidence: `README.md`)
- Entity processor → Rule application: applies rules (evidence: `plugins/catalog-backend-module-lazy-catalog/src/processor/LazyCatalogProcessor.ts`)
- Rule application → Entity matching: checks matches (evidence: `plugins/lazy-catalog-common/src/rules/apply.ts`)
- Rule application → Field paths: reads fields (evidence: `plugins/lazy-catalog-common/src/rules/apply.ts`)
- Entity matching → Field paths: checks fields (evidence: `plugins/lazy-catalog-common/src/rules/match.ts`)
- Entity processor → Source directory: resolves source (evidence: `plugins/catalog-backend-module-lazy-catalog/src/processor/LazyCatalogProcessor.ts`)
- Scaffolder task → Scaffolder module: registers module (evidence: `README.md`)
- Scaffolder module → Descriptor write action: registers action (evidence: `plugins/scaffolder-backend-module-lazy-catalog/src/module.ts`)
- Descriptor write action → Rules loader: loads rules (evidence: `plugins/scaffolder-backend-module-lazy-catalog/src/actions/writeCatalogInfo.ts`)
- Descriptor write action → Rule application: rewrites fields (evidence: `plugins/scaffolder-backend-module-lazy-catalog/src/actions/writeCatalogInfo.ts`)
- Descriptor write action → Field paths: sets fields (evidence: `plugins/scaffolder-backend-module-lazy-catalog/src/actions/writeCatalogInfo.ts`)
- Entity processor → Fallback docs writer: ensures docs (evidence: `plugins/catalog-backend-module-lazy-catalog/src/processor/LazyCatalogProcessor.ts`)
- Fallback docs writer → Fallback templates: renders files (evidence: `plugins/lazy-catalog-common/src/fallbackDocs/write.ts`)
- TechDocs → Fallback docs writer: reads generated docs
