---
title: Architecture
description: The 24 Pipedash crates, the desktop and web request flow, backend presentation and the database tables.
---

Pipedash is a Rust workspace with 24 crates and a React frontend. One core library holds the application logic. A Tauri app and an Axum server expose it. Fifteen provider plugins connect to CI/CD services.

## Crates

| Crate | Purpose |
|---|---|
| `pipedash-core` | Framework-agnostic core library. Application services, domain types, infrastructure, the plugin adapter and the event bus |
| `pipedash-desktop` | The Tauri app for desktop, iOS and Android. Native commands, keyring token store, local notifications, app lock and the Tauri event adapter |
| `pipedash-plugin-api` | The plugin contract. The `Plugin` trait, the plugin registry, config and table schemas, health types and shared types |
| `pipedash-plugin-actions` | Shared Actions workflow helpers: dispatch input parsing, dispatch request bodies and `ActionsLogDialect` |
| `pipedash-plugin-github` | GitHub Actions plugin |
| `pipedash-plugin-gitea` | Gitea Actions plugin |
| `pipedash-plugin-woodpecker` | Woodpecker CI pipelines |
| `pipedash-plugin-gitlab` | GitLab CI/CD plugin |
| `pipedash-plugin-azure-devops` | Azure DevOps Pipelines plugin |
| `pipedash-plugin-bitbucket` | Bitbucket Pipelines plugin |
| `pipedash-plugin-buildkite` | Buildkite plugin |
| `pipedash-plugin-circleci` | CircleCI pipelines and runs |
| `pipedash-plugin-jenkins` | Jenkins plugin |
| `pipedash-plugin-tekton` | Tekton CD plugin |
| `pipedash-plugin-argocd` | ArgoCD plugin |
| `pipedash-plugin-fluxcd` | FluxCD plugin |
| `pipedash-plugin-komodo` | Komodo Stacks plugin |
| `pipedash-plugin-coolify` | Coolify applications and deployments |
| `pipedash-plugin-prow` | Prow Deck jobs, runs, logs and optional Kubernetes actions |
| `pipedash-plugins` | Built-in provider registry. Its build script generates registration calls from its provider dependencies |
| `pipedash-web` | REST API server. Axum routes, WebSocket events and an optional embedded frontend |
| `pipedash-push-relay` | APNs push relay service. For an alert it takes a subscription id and an alert id and sends a generic notification |
| `tauri-plugin-pipedash-native` | Tauri plugin for UIKit on iOS and the Android activity. Haptics, appearance, privacy cover, share sheet, notification actions, status bar taps on iOS and background notification checks |
| `tauri-plugin-pipedash-push` | Tauri plugin that registers for APNs remote notifications on iOS and returns the device token |

20 crates are publishable: `pipedash-core`, `pipedash-web`, `pipedash-plugin-api`, `pipedash-plugin-actions`, `pipedash-plugins` and the 15 provider plugins. The desktop app, push relay and two native Tauri plugins set `publish = false`.

## Request flow

The React interface talks to a shared service object. Inside Tauri it uses IPC commands. Anywhere else it uses the REST API and a WebSocket.

```mermaid
flowchart LR
    UI["React interface"]
    subgraph Desktop
        TC["pipedash-desktop<br/>Tauri commands"]
        TE["TauriEventBus"]
    end
    subgraph Web
        AR["pipedash-web<br/>REST /api/v1"]
        WB["WebSocketEventBus<br/>/api/v1/ws"]
    end
    CORE["pipedash-core<br/>services"]
    PL["Provider plugins"]
    DB[("SQLite or PostgreSQL")]

    UI -->|"Tauri IPC invoke"| TC
    UI -->|"HTTP"| AR
    TC --> CORE
    AR --> CORE
    CORE --> PL
    CORE --> DB
    CORE -->|"CoreEvent"| TE
    CORE -->|"CoreEvent"| WB
    TE -->|"named event + JSON"| UI
    WB -->|"type + payload"| UI
```

Both shells call the same services in `pipedash-core`, so a command and its REST route behave the same way. The server nests its routes under `/api/v1`. The [REST API page](/docs/deployment/rest-api) lists them.

### Backend presentation

The backend decides filtering, sorting, pagination, validation, action eligibility and provider-specific copy. The frontend renders that data and keeps local interface state.

The core `Presenter` calls the plugin's `pipeline_actions`, `run_actions` and `run_display` hooks. Pipelines include `actions`. Runs include `actions`, `display` and `pace`. View pages include presentation data, and plugin metadata supplies terminology and interface copy.

Read-only connections block mutating actions in the backend. An action request checks the current policy again before calling the provider. A visible or enabled button is not authorization.

```mermaid
flowchart LR
    P["Plugin facts and metadata"] --> C["Core services"]
    C --> R["Presenter<br/>actions, display and pace"]
    R --> T["IPC, REST and events"]
    T --> U["React renders"]
    U --> A["Action request"]
    A --> G["Backend policy check"]
    G --> P
```

## Core modules

`pipedash-core` exposes 5 public modules and a `CoreContext` that wires the application services together.

- `application`: the `ProviderService`, `PipelineService`, `MetricsService`, `ProviderHealthService` and `LogService`. It also holds the `RefreshManager` and the `FetchScheduler` that decide when each provider is due, the `ConfigWatcher` that applies `config.toml` changes, and the alert recorder.
- `domain`: plain types for providers, pipelines, runs, run logs, metrics, health, device alerts, push subscriptions and validation, with `DomainError`.
- `infrastructure`: config loading, the database layer, the HTTP client manager with proxy support and request deduplication. It also holds token stores, secret stores, storage migration and sync, the status page feed parsers and the run log store.
- `event`: the `CoreEvent` enum, the `EventBus` trait and a `NoOpEventBus`.
- `logging`: tracing setup.

The separate `pipedash-plugins` crate builds the provider registry. Its `build.rs` reads provider dependencies from its manifest and generates calls to each crate's `register` function. The desktop and web shells supply this registry to the core.

```mermaid
flowchart LR
    M["pipedash-plugins/Cargo.toml"] --> B["build.rs"]
    B --> R["Generated registry"]
    P["Provider crates<br/>register_plugin!"] --> R
    R --> S["Desktop and web shells"]
    S --> C["pipedash-core"]
```

The shells supply the event bus and the token store. The core stays free of Tauri and Axum types. The [how it works page](/docs/getting-started/how-it-works) describes the refresh scheduling.

## Storage schema

SQLx applies the migrations for the active backend, SQLite or PostgreSQL. These are the main tables.

| Table | Content |
|---|---|
| `providers` | Provider name, type, config JSON, refresh interval, version for optimistic locking, last fetch time, last successful fetch time, status and error. The SQLite backend also holds `encrypted_token` and `token_nonce` here |
| `pipelines_cache` | The last fetched pipelines per provider: name, status, repository, branch, workflow file, last run, resource state and metadata JSON |
| `workflow_parameters_cache` | Trigger form parameters per workflow, with `cached_at` and `expires_at` |
| `run_history_cache` | Run data per pipeline and run number, with a run hash and the start time in milliseconds |
| `table_preferences` | Column preferences per provider and table |
| `provider_permissions` | The permissions the token has, per provider and permission name |
| `storage_metadata` | A single row with the storage backend configuration and a checksum |
| `storage_migrations` | An audit trail of backend migrations: status, counts, backup path and timing |
| `vault_verifier` | A single row with an encrypted marker value. It ties the vault to the first password that opened it |
| `push_subscriptions` | One row per iOS device that an older app version paired through the API token: relay subscription ID, device name, platform, creation time and last successful push |
| `device_alerts` | The alert queue of a host: a growing `seq`, a random `id`, the key, the kind, the title, the body, the pipeline and provider ids, and the creation time. Pipedash keeps 7 days and 500 rows |
| `device_push_subscriptions` | One row per paired device that turned push on: device ID, relay subscription ID, creation time, last successful push, and the first and last alert the relay failed to deliver |
| `pipeline_views` | System and custom views, parent relationships, ordering, selection rules and display settings |
| `pipeline_view_members` | Pipeline membership, manual ordering and exclusions per view |
| `pipeline_view_pins` | Pinned view and repository shortcuts with their order |
| `paired_devices` | Device ID, SHA-256 token hash, name, platform, pairing time and last-seen time |
| `encrypted_tokens` | PostgreSQL only. Nonce and ciphertext per provider |

Deleting a provider cascades to its cached pipelines, preferences and permissions.

### Alerts and push

Every host builds the same alert queue.

1. `CoreContext` wraps the event bus in a recording bus. It copies the events that can raise an alert (`PipelinesUpdated`, `PipelinesFailed`, `ProviderHealthAlert` and the provider events) into a channel of 512 and then forwards them. A full channel drops the copy and never blocks the bus.
2. The recorder task applies the rules of the mobile local notifications, `NotificationState`, to each copy. It seeds its state from the cached pipelines and the providers, so existing failures raise nothing.
3. When at least one device is paired, it writes each notice to `device_alerts` and emits `alert-recorded`.
4. In `pipedash-web`, `spawn_alert_push` listens for `alert-recorded`. For each row of `device_push_subscriptions` it posts the alert id to the relay. An answer that says the subscription is gone deletes the row. A failed or rate-limited push widens the row's undelivered range, which the phone's next background check fetches and acknowledges. A sharing desktop runs the same task. It sends through the relay only when "Background notifications" is on or `PIPEDASH_PUSH_RELAY_URL` sets a relay. A new host starts with the switch off, and a desktop that was already sharing before the upgrade keeps push on once.

On the phone, a `BGAppRefreshTask` or a `JobScheduler` job reads `GET /alerts` after its saved sequence number. A phone in client mode also catches up when its WebSocket reconnects and adds the missed alerts to the notification list. On iOS the `PipedashNotificationService` extension receives the push, fetches `GET /alerts/{id}` from the host and replaces the generic text. The [Security](/docs/resources/security#push-relay) page covers what each party sees.

### Run log store

Job logs live outside the database, in `<data_dir>/cache/run-logs/v1`. Each run has a folder named after a hash of its pipeline ID and run number, and each job has one folder per downloaded revision. A revision holds `meta.json`, an `index.bin` of block offsets and a `blocks.bin` of lz4 blocks of up to 1024 lines. A published revision never changes. A reader keeps its revision alive until it finishes, even when a newer one replaces it. The [Run logs](/docs/features/run-logs) page lists the cache limits.

### Metrics tables

Metrics live in the main database.

| Table | Content |
|---|---|
| `metrics_global_config` | One row with the enabled flag and the default retention. The defaults are off and 7 days |
| `metrics_config` | Enabled flag and retention per pipeline |
| `pipeline_metrics` | One value per pipeline, run number, metric type and timestamp, with metadata JSON and a run hash |
| `metrics_processing_state` | The last processed run number and time per pipeline |
| `metrics_storage_info` | One row with the metric count, estimated size and last cleanup time |

A unique index on pipeline, run number, metric type and run hash deduplicates entries. The [metrics page](/docs/features/metrics) explains what Pipedash records.
