# netflix/dispatch architecture

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

- Interactive diagram: https://gitdiagram.com/netflix/dispatch
- Repository: https://github.com/netflix/dispatch

## Overview

##### Project type and purpose
- Dispatch is a full-stack incident management system.
- Backend: Python service exposing a REST/CLI API, orchestrating data models, scheduled jobs, and integration plugins.
- Frontend: Vue.js single-page application served as static assets.
- Purpose: automate incident workflows, notifications, and post-mortems by integrating with tools (Slack, Jira, PagerDuty, GSuite, etc.).

##### File structure
- Top level:
– src/dispatch: Flask/Connexion application modules (auth, incidents, cases, workflows, plugins, scheduler, database, etc.).
– src/dispatch/static/dispatch: Vue.js frontend code (components, router, store, assets).
– dispatch/plugins: plugin base interfaces + concrete implementations (Slack, OpsGenie, GitHub, Google, Zoom, etc.).
– src/dispatch/database: Alembic migration scripts, multi-tenant schema.
– bin/run.py & src/dispatch/cli.py: command-line interface.
– docs/: self-hosted documentation powered by Docusaurus.
– docker & .devcontainer: Docker Compose definitions for local development, dev containers.
– tests/: unit, integration, e2e tests for both backend and frontend.

##### README
- Confirms orchestration role, deep integrations, and that Dispatch “focuses on creating resources, assembling participants, sending notifications, tracking tasks, and post-incident reviews.”
- Mentions Docker and external docs.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Tier
    subgraph "Client Tier"
        Browser["Vue.js SPA"]:::frontend
        CLI["CLI Interface"]:::frontend
    end

    %% API Tier
    subgraph "API Tier"
        API_main["Flask/Connexion API"]:::backend
    end

    %% Business Logic Tier
    subgraph "Business Logic Tier"
        subgraph "Core Modules"
            Incident["Incident Module"]:::backend
            CaseM["Case Module"]:::backend
            Report["Report Module"]:::backend
            Task["Task Module"]:::backend
            Search["Search Module"]:::backend
            Feedback["Feedback Module"]:::backend
        end
        PluginMgr["Plugin Manager & Interfaces"]:::backend
        Scheduler["Scheduler Engine"]:::scheduler
    end

    %% Data Tier
    subgraph "Data Tier"
        DB["PostgreSQL Multi-Tenant DB"]:::database
        Migrations["Alembic Migrations"]:::database
    end

    %% External Integrations
    subgraph "External Integrations"
        Email["SMTP/Email Service"]:::external
        Slack["Slack API"]:::external
        Jira["Jira API"]:::external
        GitHub["GitHub API"]:::external
        PagerDuty["PagerDuty API"]:::external
        OpsGenie["OpsGenie API"]:::external
        GSuite["GSuite APIs"]:::external
        AWS["AWS Services"]:::external
        Zoom["Zoom API"]:::external
        Duo["Duo MFA"]:::external
        TestPlugin["Test Harness Plugin"]:::external
    end

    %% Infrastructure & DevOps
    subgraph "Infrastructure & DevOps"
        DockerCompose["Docker Compose"]:::devops
        DevContainer["Dev Container"]:::devops
        DockerfileNode["Dockerfile"]:::devops
        CICD["GitHub Actions CI/CD"]:::devops
        DocsSite["Documentation Site"]:::devops
    end

    %% Connections
    Browser -->|"HTTPS"| API_main
    CLI -->|"HTTP/Local"| API_main

    API_main -->|"routes to"| Incident
    API_main -->|"routes to"| CaseM
    API_main -->|"routes to"| Report
    API_main -->|"routes to"| Task
    API_main -->|"routes to"| Search
    API_main -->|"routes to"| Feedback

    Scheduler -->|"triggers"| Incident
    Scheduler -->|"triggers"| CaseM
    Scheduler -->|"triggers"| Report
    Scheduler -->|"triggers"| Task
    Scheduler -->|"triggers"| Search
    Scheduler -->|"triggers"| Feedback

    Incident -->|"reads/writes"| DB
    CaseM -->|"reads/writes"| DB
    Report -->|"reads/writes"| DB
    Task -->|"reads/writes"| DB
    Search -->|"reads/writes"| DB
    Feedback -->|"reads/writes"| DB

    Migrations -->|"manage schema"| DB

    Incident -->|"uses plugins"| PluginMgr
    CaseM -->|"uses plugins"| PluginMgr
    Report -->|"uses plugins"| PluginMgr
    Task -->|"uses plugins"| PluginMgr
    Search -->|"uses plugins"| PluginMgr
    Feedback -->|"uses plugins"| PluginMgr

    PluginMgr --> Slack
    PluginMgr --> Jira
    PluginMgr --> GitHub
    PluginMgr --> PagerDuty
    PluginMgr --> OpsGenie
    PluginMgr --> GSuite
    PluginMgr --> AWS
    PluginMgr --> Zoom
    PluginMgr --> Duo
    PluginMgr --> TestPlugin

    Incident -->|"sends email via"| Email
    CaseM -->|"sends email via"| Email
    Report -->|"sends email via"| Email

    CICD --> DockerCompose
    CICD --> DevContainer
    CICD --> DockerfileNode
    CICD --> DocsSite

    %% Click Events
    click Browser "https://github.com/netflix/dispatch/tree/main/src/dispatch/static/dispatch"
    click CLI "https://github.com/netflix/dispatch/blob/main/bin/run.py"
    click CLI "https://github.com/netflix/dispatch/blob/main/src/dispatch/cli.py"
    click API_main "https://github.com/netflix/dispatch/blob/main/src/dispatch/main.py"
    click API_main "https://github.com/netflix/dispatch/blob/main/src/dispatch/api.py"
    click Incident "https://github.com/netflix/dispatch/tree/main/src/dispatch/incident"
    click CaseM "https://github.com/netflix/dispatch/tree/main/src/dispatch/case"
    click Report "https://github.com/netflix/dispatch/tree/main/src/dispatch/report"
    click Task "https://github.com/netflix/dispatch/tree/main/src/dispatch/task"
    click Search "https://github.com/netflix/dispatch/tree/main/src/dispatch/search"
    click Feedback "https://github.com/netflix/dispatch/tree/main/src/dispatch/feedback"
    click Scheduler "https://github.com/netflix/dispatch/blob/main/src/dispatch/scheduler.py"
    click PluginMgr "https://github.com/netflix/dispatch/blob/main/src/dispatch/plugins/base/manager.py"
    click PluginMgr "https://github.com/netflix/dispatch/blob/main/src/dispatch/plugins/base/v1.py"
    click Slack "https://github.com/netflix/dispatch/tree/main/src/dispatch/plugins/dispatch_slack"
    click Jira "https://github.com/netflix/dispatch/tree/main/src/dispatch/plugins/dispatch_jira"
    click GitHub "https://github.com/netflix/dispatch/tree/main/src/dispatch/plugins/dispatch_github"
    click PagerDuty "https://github.com/netflix/dispatch/tree/main/src/dispatch/plugins/dispatch_pagerduty"
    click OpsGenie "https://github.com/netflix/dispatch/tree/main/src/dispatch/plugins/dispatch_opsgenie"
    click GSuite "https://github.com/netflix/dispatch/tree/main/src/dispatch/plugins/dispatch_google"
    click AWS "https://github.com/netflix/dispatch/tree/main/src/dispatch/plugins/dispatch_aws"
    click Zoom "https://github.com/netflix/dispatch/tree/main/src/dispatch/plugins/dispatch_zoom"
    click Duo "https://github.com/netflix/dispatch/tree/main/src/dispatch/plugins/dispatch_duo"
    click TestPlugin "https://github.com/netflix/dispatch/tree/main/src/dispatch/plugins/dispatch_test"
    click DB "https://github.com/netflix/dispatch/blob/main/src/dispatch/database/core.py"
    click Migrations "https://github.com/netflix/dispatch/blob/main/src/dispatch/alembic.ini"
    click Migrations "https://github.com/netflix/dispatch/tree/main/src/dispatch/database/revisions/core"
    click Migrations "https://github.com/netflix/dispatch/tree/main/src/dispatch/database/revisions/tenant"
    click Email "https://github.com/netflix/dispatch/tree/main/src/dispatch/messaging/email"
    click DockerCompose "https://github.com/netflix/dispatch/blob/main/docker/docker-compose.yml"
    click DevContainer "https://github.com/netflix/dispatch/blob/main/.devcontainer/docker-compose.yml"
    click DevContainer "https://github.com/netflix/dispatch/tree/main/.devcontainer/Dockerfile"
    click DockerfileNode "https://github.com/netflix/dispatch/tree/main/Dockerfile"
    click CICD "https://github.com/netflix/dispatch/blob/main/.github/workflows/*.yml"
    click DocsSite "https://github.com/netflix/dispatch/tree/main/docs/"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366D6,color:#0366D6;
    classDef backend fill:#DFF2D8,stroke:#277A0F,color:#277A0F;
    classDef scheduler fill:#F3D9FF,stroke:#A33EA1,color:#A33EA1;
    classDef database fill:#FFF2CC,stroke:#D69F05,color:#D69F05,shape:cylinder;
    classDef external fill:#FFE5D0,stroke:#C2410C,color:#C2410C;
    classDef devops fill:#E2E2E2,stroke:#666666,color:#333333;
```
