> For the complete documentation index, see [llms.txt](https://docs.theopenpresenter.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.theopenpresenter.com/external/package-dependencies.md).

# Package dependencies

The repo contains many packages, separated by what it's supposed to do. Here's a very rough graph of how everything is connected together.

Please keep in mind that the `server` also serves everything built for the frontend. `homepage`, `remote` and `renderer` are hot-reloaded. Anything in the plugin are not.

Also, while `db` is not directly connected in the chart, in reality, `graphql` generates its schema directly from the database

```mermaid
graph TD
    %% Foundation
    config-presets["config-presets<br/>(ts/eslint/prettier/tailwind)"]
    graphql[graphql]
    base-types[base-types]
    lib[lib]
    observability[observability]
    ui[ui]
    backend-shared[backend-shared]
    base-plugin[base-plugin]
    video[video]
    media-picker[media-picker]
    test[test]

    %% Foundation edges
    graphql --> config-presets
    base-types --> config-presets
    lib --> graphql
    observability --> lib
    ui --> graphql & lib
    backend-shared --> lib & observability
    base-plugin --> backend-shared & base-types & graphql & lib & observability & ui
    video --> base-plugin & base-types & lib
    media-picker --> base-plugin & graphql & lib & ui & video
    test --> base-plugin

    %% Plugins
    subgraph Plugins
        p-audio[plugin-audio-recorder]
        p-embed[plugin-embed]
        p-lyrics[plugin-lyrics-presenter]
        p-radio[plugin-radio]
        p-image[plugin-simple-image]
        p-slides[plugin-slides]
        p-timer[plugin-timer]
        p-video[plugin-video-player]
        p-pads[plugin-worship-pads]
    end
    p-audio --> base-plugin & observability & ui & test
    p-embed --> base-plugin & ui
    p-lyrics --> base-plugin & observability & ui & video
    p-radio --> base-plugin & ui
    p-image --> base-plugin & lib & observability & ui
    p-slides --> base-plugin & lib & observability & ui
    p-timer --> base-plugin & ui
    p-video --> base-plugin & lib & observability & ui & video
    p-pads --> base-plugin & lib & ui

    %% Frontend apps
    subgraph Apps
        homepage[homepage]
        project[project]
        remote[remote]
        renderer[renderer]
        shared[shared]
    end
    shared --> graphql & base-plugin & lib & ui
    project --> base-plugin & media-picker & observability & config & graphql & lib & ui
    remote --> observability & base-plugin & graphql & lib & media-picker & p-lyrics & shared & ui
    renderer --> graphql & observability & base-plugin & lib & p-lyrics & shared & ui

    %% Backend
    subgraph Backend
        config[config]
        db[db]
        server[server]
        worker[worker]
    end
    config --> config-presets
    server --> backend-shared & base-plugin & config & graphql & lib & observability & portable-file
    worker --> backend-shared & base-plugin & config & lib & observability

    %% Misc / leaf
    e2e --> graphql
    portable-file --> config-presets
    embedded-postgres --> config-presets

    %% No internal deps: db, homepage(only config), desktop-screen,
    %% native-screen, vega-screen, tauri, base-types, prettier-config
```
