# danskernesdigitalebibliotek/dpl-cms architecture

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

- Interactive diagram: https://gitdiagram.com/danskernesdigitalebibliotek/dpl-cms
- Repository: https://github.com/danskernesdigitalebibliotek/dpl-cms

## Overview

##### High-Level Architecture Components

a) Frontend Layer:
- Novel theme (custom Drupal theme)
- React applications integration
- Design system integration

b) CMS Core Layer:
- Drupal core
- Custom modules
- Configuration management
- Content types and entities

c) Integration Layer:
- External services integration
- API endpoints
- Authentication services

##### Key Components

a) Content Management:
- Custom content types (Articles, Events, Pages)
- Media handling
- Taxonomies and categorization

b) Custom Functionality:
- Event management system
- Patron services
- Search functionality
- Authentication (Adgangsplatformen integration)

c) External Integrations:
- FBI (Library database)
- FBS (Library system)
- Publizon
- Other library services

- Client Layer                                         |

- Web Browser  |  |   React Apps      |  |  Mobile Clients  |  |   API Consumers  |   |

- Presentation Layer                                    |

- Novel Theme  |  |   Design System   |  |  React Components|                        |

- Application Layer                                     |

- Content Types  |  | Custom Modules    |  |  Authentication  |  |  Search System    |   |

- Event System   |  | Patron Services   |  |  Media Handler   |  |  Cache Layer     |   |

- Integration Layer                                     |

- FBI Client    |  |    FBS Client     |  |    Publizon     |  | Other Services   |   |

- Infrastructure Layer                                  |

- Database     |  |    File System    |  |    Varnish      |  |    Docker        |   |

##### Connection Types

Different types of connections:

##### Additional Elements

Include:
- Data flow directions
- Authentication boundaries
- Cache layers
- Load balancing points
- API endpoints

##### Important Subsystems

Detail key custom subsystems:
- Event management
- Patron services
- Search functionality
- Content workflow

##### Documentation Notes

Annotations for:
- Configuration management approach
- Deployment workflow
- Cache invalidation strategy
- Security boundaries

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef client fill:#e1f5fe,stroke:#01579b
    classDef frontend fill:#e8f5e9,stroke:#2e7d32
    classDef core fill:#f3e5f5,stroke:#7b1fa2
    classDef integration fill:#fff3e0,stroke:#ff6f00
    classDef infrastructure fill:#eceff1,stroke:#455a64

    %% Legend
    subgraph Legend
        L1[Client Layer]:::client
        L2[Frontend Layer]:::frontend
        L3[Core Layer]:::core
        L4[Integration Layer]:::integration
        L5[Infrastructure Layer]:::infrastructure
    end

    %% Client Layer
    subgraph ClientLayer
        Browser[Web Browser]:::client
        ReactApps[React Applications]:::client
        MobileClients[Mobile Clients]:::client
        APIConsumers[API Consumers]:::client
    end

    %% Frontend Layer
    subgraph FrontendLayer
        NovelTheme[Novel Theme]:::frontend
        DesignSystem[Design System]:::frontend
        ReactComponents[React Components]:::frontend
    end

    %% Core Layer
    subgraph CoreLayer
        ContentTypes[Content Types]:::core
        CustomModules[Custom Modules]:::core
        Authentication[Authentication]:::core
        SearchSystem[Search System]:::core
        EventSystem[Event System]:::core
        PatronServices[Patron Services]:::core
        MediaHandler[Media Handler]:::core
        CacheLayer[Cache Layer]:::core
    end

    %% Integration Layer
    subgraph IntegrationLayer
        FBIClient[FBI Client]:::integration
        FBSClient[FBS Client]:::integration
        Publizon[Publizon]:::integration
        OtherServices[Other Services]:::integration
    end

    %% Infrastructure Layer
    subgraph InfrastructureLayer
        Database[(Database)]:::infrastructure
        FileSystem[(File System)]:::infrastructure
        Varnish[Varnish]:::infrastructure
        Docker[Docker]:::infrastructure
    end

    %% Connections
    Browser --> NovelTheme
    ReactApps --> ReactComponents
    NovelTheme --> CustomModules
    ReactComponents --> CustomModules
    CustomModules --> IntegrationLayer
    Authentication --> FBIClient
    SearchSystem --> FBIClient
    EventSystem --> Database
    PatronServices --> FBSClient
    CacheLayer --> Varnish
    IntegrationLayer --> Database

    %% Click events
    click NovelTheme "https://github.com/danskernesdigitalebibliotek/dpl-cms/tree/develop/web/themes/custom/novel/"
    click ReactComponents "https://github.com/danskernesdigitalebibliotek/dpl-cms/tree/develop/web/modules/custom/dpl_react/"
    click DesignSystem "https://github.com/danskernesdigitalebibliotek/dpl-cms/tree/develop/web/themes/custom/novel/css/"
    click ContentTypes "https://github.com/danskernesdigitalebibliotek/dpl-cms/blob/develop/config/sync/node.type.*"
    click FBIClient "https://github.com/danskernesdigitalebibliotek/dpl-cms/tree/develop/web/modules/custom/dpl_fbi/"
    click FBSClient "https://github.com/danskernesdigitalebibliotek/dpl-cms/tree/develop/web/modules/custom/dpl_fbs/"
    click Publizon "https://github.com/danskernesdigitalebibliotek/dpl-cms/tree/develop/web/modules/custom/dpl_publizon/"
    click Authentication "https://github.com/danskernesdigitalebibliotek/dpl-cms/tree/develop/web/modules/custom/dpl_login/"
    click EventSystem "https://github.com/danskernesdigitalebibliotek/dpl-cms/tree/develop/web/modules/custom/dpl_event/"
    click PatronServices "https://github.com/danskernesdigitalebibliotek/dpl-cms/tree/develop/web/modules/custom/dpl_patron_page/"
    click SearchSystem "https://github.com/danskernesdigitalebibliotek/dpl-cms/tree/develop/web/modules/custom/dpl_search/"
    click CacheLayer "https://github.com/danskernesdigitalebibliotek/dpl-cms/tree/develop/web/modules/custom/dpl_cache_settings/"
```
