# pointmekin/backstage-demo-2 architecture

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

- Interactive diagram: https://gitdiagram.com/pointmekin/backstage-demo-2
- Repository: https://github.com/pointmekin/backstage-demo-2

## Overview

##### Main Components Structure

a) Frontend Layer (packages/app)
- Sub-components:
- Root Component
- Catalog Component
- Search Component
- API Interface Layer

b) Backend Layer (packages/backend)
- Plugin services:
- Auth Service
- Catalog Service
- Scaffolder Service
- TechDocs Service
- Search Service
- Proxy Service

##### Component Relationships

a) External Interactions
- User → Frontend Application
- Frontend Application ↔ Backend Services
- Backend Services ↔ External Services/APIs

b) Internal Communications

##### Specific Implementation Details

Frontend Section:
**┌─────────────────────────────────┐**
- Frontend Application     │
- ┌──────────┐ ┌───────────────┐ │
- Root   │ │    Catalog    │ │
- ┘ └───────────────┘ │
- ┌──────────┐ ┌───────────────┐ │
- Search  │ │     APIs      │ │
- ┘ └───────────────┘ │
- ┘

Backend Section:
**┌─────────────────────────────────┐**
- Backend Services        │
- ┌──────────┐ ┌───────────────┐ │
- Auth   │ │   Catalog     │ │
- ┘ └───────────────┘ │
- ┌──────────┐ ┌───────────────┐ │
- Scaffolder│ │   TechDocs    │ │
- ┘ └───────────────┘ │
- ┌──────────┐ ┌───────────────┐ │
- Search  │ │    Proxy      │ │
- ┘ └───────────────┘ │
- ┘

##### Additional Elements

- Configuration Layer:
- app-config.yaml
- app-config.production.yaml
- Docker configuration

- Build/Deploy Infrastructure:
- Dockerfile
- Docker build process
- Development environment

##### External Services Layer

This structure will accurately represent the Backstage application's architecture while maintaining clarity and providing valuable information for both development and deployment considerations.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "User Interface"
        User(("User"))
    end

    subgraph "Frontend Application"
        FA["Frontend App"]:::frontend
        click FA "https://github.com/pointmekin/backstage-demo-2/tree/main/packages/app/"
        
        subgraph "Core Components"
            Root["Root Component"]:::frontend
            click Root "https://github.com/pointmekin/backstage-demo-2/blob/main/packages/app/src/components/Root/Root.tsx"
            Catalog["Catalog Component"]:::frontend
            click Catalog "https://github.com/pointmekin/backstage-demo-2/blob/main/packages/app/src/components/catalog/EntityPage.tsx"
            Search["Search Component"]:::frontend
            click Search "https://github.com/pointmekin/backstage-demo-2/blob/main/packages/app/src/components/search/SearchPage.tsx"
            API["API Interface"]:::frontend
            click API "https://github.com/pointmekin/backstage-demo-2/blob/main/packages/app/src/apis.ts"
        end
    end

    subgraph "Backend Services"
        BS["Backend Services"]:::backend
        click BS "https://github.com/pointmekin/backstage-demo-2/tree/main/packages/backend/src/plugins/"
        
        subgraph "Plugin Services"
            Auth["Auth Service"]:::backend
            click Auth "https://github.com/pointmekin/backstage-demo-2/blob/main/packages/backend/src/plugins/auth.ts"
            CatalogSvc["Catalog Service"]:::backend
            click CatalogSvc "https://github.com/pointmekin/backstage-demo-2/blob/main/packages/backend/src/plugins/catalog.ts"
            ScaffoldSvc["Scaffolder Service"]:::backend
            click ScaffoldSvc "https://github.com/pointmekin/backstage-demo-2/blob/main/packages/backend/src/plugins/scaffolder.ts"
            TechDocsSvc["TechDocs Service"]:::backend
            click TechDocsSvc "https://github.com/pointmekin/backstage-demo-2/blob/main/packages/backend/src/plugins/techdocs.ts"
            SearchSvc["Search Service"]:::backend
            click SearchSvc "https://github.com/pointmekin/backstage-demo-2/blob/main/packages/backend/src/plugins/search.ts"
            ProxySvc["Proxy Service"]:::backend
            click ProxySvc "https://github.com/pointmekin/backstage-demo-2/blob/main/packages/backend/src/plugins/proxy.ts"
        end
    end

    subgraph "Configuration Layer"
        Config["Main Config"]:::config
        click Config "https://github.com/pointmekin/backstage-demo-2/blob/main/app-config.yaml"
        ProdConfig["Production Config"]:::config
        click ProdConfig "https://github.com/pointmekin/backstage-demo-2/blob/main/app-config.production.yaml"
    end

    subgraph "Build Infrastructure"
        MainDocker["Main Dockerfile"]:::infra
        click MainDocker "https://github.com/pointmekin/backstage-demo-2/tree/main/Dockerfile"
        BackendDocker["Backend Dockerfile"]:::infra
        click BackendDocker "https://github.com/pointmekin/backstage-demo-2/tree/main/packages/backend/Dockerfile"
    end

    subgraph "Template System"
        TemplateDir["Template Directory"]:::template
        click TemplateDir "https://github.com/pointmekin/backstage-demo-2/tree/main/examples/template/"
        TemplateContent["Template Content"]:::template
        click TemplateContent "https://github.com/pointmekin/backstage-demo-2/tree/main/examples/template/content/"
        TemplateDef["Template Definition"]:::template
        click TemplateDef "https://github.com/pointmekin/backstage-demo-2/blob/main/examples/template/template.yaml"
    end

    subgraph "Entity Definitions"
        EntityEx["Entity Examples"]:::entity
        click EntityEx "https://github.com/pointmekin/backstage-demo-2/blob/main/examples/entities.yaml"
        OrgEx["Organization Example"]:::entity
        click OrgEx "https://github.com/pointmekin/backstage-demo-2/blob/main/examples/org.yaml"
        CatalogInfo["Catalog Info"]:::entity
        click CatalogInfo "https://github.com/pointmekin/backstage-demo-2/blob/main/catalog-info.yaml"
    end

    %% Relationships
    User --> FA
    FA --> Root
    FA --> Catalog
    FA --> Search
    FA --> API
    API --> BS
    
    Auth --> ProxySvc
    CatalogSvc --> ScaffoldSvc
    SearchSvc --> CatalogSvc
    TechDocsSvc --> CatalogSvc
    
    Config --> FA
    Config --> BS
    ProdConfig --> FA
    ProdConfig --> BS
    
    MainDocker --> FA
    BackendDocker --> BS
    
    TemplateDir --> ScaffoldSvc
    TemplateContent --> TemplateDir
    TemplateDef --> TemplateDir
    
    EntityEx --> CatalogSvc
    OrgEx --> CatalogSvc
    CatalogInfo --> CatalogSvc

    %% Styling
    classDef frontend fill:#2374ab,stroke:#000,stroke-width:2px,color:#fff
    classDef backend fill:#2a9d8f,stroke:#000,stroke-width:2px,color:#fff
    classDef config fill:#e9c46a,stroke:#000,stroke-width:2px
    classDef infra fill:#f4a261,stroke:#000,stroke-width:2px
    classDef template fill:#e76f51,stroke:#000,stroke-width:2px,color:#fff
    classDef entity fill:#264653,stroke:#000,stroke-width:2px,color:#fff

    %% Legend
    subgraph Legend
        Frontend["Frontend"]:::frontend
        Backend["Backend"]:::backend
        Configuration["Configuration"]:::config
        Infrastructure["Infrastructure"]:::infra
        Templates["Templates"]:::template
        Entities["Entities"]:::entity
    end
```
