# google/turbinia architecture

> Architecture diagram of the GitHub repository google/turbinia, 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/google/turbinia
- Repository: https://github.com/google/turbinia

## Overview

##### Component Relationships

**Client Layer → API Server → Server Layer → Worker Layer**
- ↓
- Storage & State Management

##### Specific Implementation Details

Key architectural elements:

a) Request Flow:
- Client submits evidence → API Server validates → Server creates jobs → Tasks distributed to workers

b) Worker Processing:
- Parallel task execution
- Docker container boundaries
- Evidence feedback loop where new evidence is fed back into the system

c) Integration Points:
- External forensic tools (Plaso, TSK, etc.)
- Cloud service connections
- Monitoring systems (Prometheus/Grafana found in /monitoring)

##### Technical Stack Indicators

- Frontend: Vue.js (based on /web directory)
- API: FastAPI (based on openapi.yaml)
- Message Queue: Kombu/Celery
- Storage: Redis
- Containerization: Docker

##### Deployment Context

Deployment options as a separate section:
- Cloud deployment
- Local deployment
- Hybrid deployment

##### Additional Elements

Include:
- Version/state indicators (Alpha release)
- Security boundaries
- Monitoring points
- Error handling paths

## Diagram (Mermaid)

```mermaid
graph TB
    %% Define styles
    classDef client fill:#a8d1ff,stroke:#333
    classDef server fill:#aaffaa,stroke:#333
    classDef worker fill:#ffccaa,stroke:#333
    classDef storage fill:#ffaaaa,stroke:#333
    classDef monitoring fill:#e6e6e6,stroke:#333
    classDef api fill:#d4b3ff,stroke:#333

    %% Client Layer
    subgraph ClientLayer
        CLI["CLI Client"]
        WebUI["Web UI"]
        PyAPI["Python API Client"]
    end

    %% Server Layer
    subgraph ServerLayer
        APIServer["API Server"]
        TurbiniaServer["Main Turbinia Server"]
        TaskScheduler["Task Scheduler"]
        MessageBroker["Message Broker (Kombu)"]
    end

    %% Worker Layer
    subgraph WorkerLayer
        Worker["Worker Implementation"]
        DockerContainer["Docker Worker Container"]
        EvidenceProcessors["Evidence Processors"]
    end

    %% Storage Layer
    subgraph StorageLayer
        Redis["Redis State Management"]
        OutputMgr["Output Manager"]
        StateMgr["State Manager"]
        TaskMgr["Task Manager"]
        EvidenceStore["Evidence Storage"]
    end

    %% Monitoring
    subgraph MonitoringLayer
        Monitoring["Monitoring (Prometheus/Grafana)"]
    end

    %% Relationships
    CLI --> APIServer
    WebUI --> APIServer
    PyAPI --> APIServer
    APIServer --> TurbiniaServer
    TurbiniaServer --> TaskScheduler
    TaskScheduler --> MessageBroker
    MessageBroker --> Worker
    Worker --> DockerContainer
    DockerContainer --> EvidenceProcessors
    Worker --> OutputMgr
    Worker --> StateMgr
    TurbiniaServer --> TaskMgr
    TaskMgr --> Redis
    OutputMgr --> EvidenceStore
    Worker --> Monitoring
    TurbiniaServer --> Monitoring

    %% Click events
    click CLI "https://github.com/google/turbinia/tree/master/turbinia/api/cli/turbinia_client/"
    click WebUI "https://github.com/google/turbinia/tree/master/web/src/"
    click PyAPI "https://github.com/google/turbinia/tree/master/turbinia/api/client/turbinia_api_lib/"
    click APIServer "https://github.com/google/turbinia/blob/master/turbinia/api/api_server.py"
    click TurbiniaServer "https://github.com/google/turbinia/blob/master/turbinia/server.py"
    click TaskScheduler "https://github.com/google/turbinia/blob/master/turbinia/celeryconfig.py"
    click Worker "https://github.com/google/turbinia/blob/master/turbinia/worker.py"
    click EvidenceProcessors "https://github.com/google/turbinia/tree/master/turbinia/processors/"
    click DockerContainer "https://github.com/google/turbinia/tree/master/docker/worker/"
    click OutputMgr "https://github.com/google/turbinia/blob/master/turbinia/output_manager.py"
    click StateMgr "https://github.com/google/turbinia/blob/master/turbinia/state_manager.py"
    click TaskMgr "https://github.com/google/turbinia/blob/master/turbinia/task_manager.py"
    click Monitoring "https://github.com/google/turbinia/tree/master/monitoring/"

    %% Style applications
    class CLI,WebUI,PyAPI client
    class APIServer,TurbiniaServer,TaskScheduler,MessageBroker server
    class Worker,DockerContainer,EvidenceProcessors worker
    class Redis,OutputMgr,StateMgr,TaskMgr,EvidenceStore storage
    class Monitoring monitoring
    class APIServer api
```
