# albert-dilas/tornio architecture

> Architecture diagram of the GitHub repository albert-dilas/tornio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/albert-dilas/tornio
- Repository: https://github.com/albert-dilas/tornio

## Overview

Tornio is a local-first desktop workbench for PDF/document, media, image, developer, and local-AI tasks. Users select a tool or pipeline in the interface, submit files to the localhost API, and receive transformed files or workspace results; the README describes these operations as local processing. The backend exposes dedicated tool routes and processing services, with shared upload handling, job tracking, and desktop/system capabilities. The source excerpts support several specific route-to-service links; broader tool families are represented at subsystem level because their individual implementations were not sampled.

Main entry points: [`backend/app/main.py`](https://github.com/albert-dilas/tornio/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/api/v1/endpoints`](https://github.com/albert-dilas/tornio/tree/main/backend/app/api/v1/endpoints) (Document tool routes), [`backend/app/api/v1/endpoints/pipelines.py`](https://github.com/albert-dilas/tornio/blob/main/backend/app/api/v1/endpoints/pipelines.py) (Pipeline executor), [`backend/app/services/system_service.py`](https://github.com/albert-dilas/tornio/blob/main/backend/app/services/system_service.py) (System status)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Workbench interface"]
  node_home["Home launchpad<br/>[page.tsx]"]
  node_tool_ui["Tool screens"]
  node_pipelines_ui["Pipeline builder<br/>[page.tsx]"]
  node_workspace_ui["File workspace<br/>[page.tsx]"]
end

subgraph group_api["API workflows"]
  node_tool_routes["Document tool routes"]
  node_studio_routes["Studio tool routes<br/>[studio_tools.py]"]
  node_pipeline_runner["Pipeline executor<br/>[pipelines.py]"]
  node_system_routes["System routes<br/>[system.py]"]
end

subgraph group_processing["Processing engines"]
  node_pdf_services["PDF processors"]
  node_compressor["PDF compression<br/>[pdf_compressor.py]"]
  node_metadata["PDF metadata<br/>[pdf_metadata.py]"]
  node_studio_engine["Studio engines"]
  node_workspace_inspector["Workspace inspection"]
end

subgraph group_runtime["Local runtime"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_upload_manager["Upload handling<br/>[dependencies.py]"]
  node_job_engine["Jobs and streams<br/>[jobs.py]"]
  node_configuration["Local configuration<br/>[config.py]"]
end

subgraph group_desktop["Desktop services"]
  node_desktop_service["Desktop lifecycle<br/>[desktop_service.py]"]
  node_system_service["System status<br/>[system_service.py]"]
  node_tray["System tray<br/>[tray.py]"]
  node_binary_detection["Engine detection<br/>[binaries.py]"]
end

node_user(("Workbench user"))
node_internet(("Online services"))

node_user -->|"opens"| node_home
node_user -->|"selects tools"| node_tool_ui
node_user -->|"builds workflows"| node_pipelines_ui
node_user -->|"inspects files"| node_workspace_ui
node_api_app -->|"mounts routes"| node_tool_routes
node_api_app -->|"mounts routes"| node_studio_routes
node_api_app -->|"mounts routes"| node_pipeline_runner
node_api_app -->|"mounts routes"| node_system_routes
node_tool_routes -->|"calls"| node_compressor
node_tool_routes -->|"calls"| node_metadata
node_tool_routes -.->|"dispatches tools"| node_pdf_services
node_studio_routes -->|"calls"| node_studio_engine
node_pipeline_runner -->|"invokes step"| node_compressor
node_pipeline_runner -->|"invokes step"| node_metadata
node_pipeline_runner -->|"invokes step"| node_studio_engine
node_tool_routes -->|"uses uploads"| node_upload_manager
node_studio_routes -->|"uses uploads"| node_upload_manager
node_pipeline_runner -->|"saves uploads"| node_upload_manager
node_api_app -->|"uses inspection"| node_workspace_inspector
node_system_routes -->|"calls"| node_desktop_service
node_system_routes -->|"calls"| node_system_service
node_desktop_service -->|"reads settings"| node_configuration
node_system_service -->|"uses desktop state"| node_desktop_service
node_system_service -->|"checks engines"| node_binary_detection
node_api_app -->|"starts runtime"| node_tray
node_studio_engine -->|"detects engines"| node_binary_detection
node_desktop_service -.->|"checks updates"| node_internet
node_system_service -->|"checks releases"| node_internet

click node_home "https://github.com/albert-dilas/tornio/blob/main/frontend/src/app/page.tsx"
click node_tool_ui "https://github.com/albert-dilas/tornio/tree/main/frontend/src/app/(tools)"
click node_pipelines_ui "https://github.com/albert-dilas/tornio/blob/main/frontend/src/app/pipelines/page.tsx"
click node_workspace_ui "https://github.com/albert-dilas/tornio/blob/main/frontend/src/app/workspace/page.tsx"
click node_tool_routes "https://github.com/albert-dilas/tornio/tree/main/backend/app/api/v1/endpoints"
click node_studio_routes "https://github.com/albert-dilas/tornio/blob/main/backend/app/api/v1/endpoints/studio_tools.py"
click node_pipeline_runner "https://github.com/albert-dilas/tornio/blob/main/backend/app/api/v1/endpoints/pipelines.py"
click node_system_routes "https://github.com/albert-dilas/tornio/blob/main/backend/app/api/v1/endpoints/system.py"
click node_pdf_services "https://github.com/albert-dilas/tornio/tree/main/backend/app/services"
click node_compressor "https://github.com/albert-dilas/tornio/blob/main/backend/app/services/pdf_compressor.py"
click node_metadata "https://github.com/albert-dilas/tornio/blob/main/backend/app/services/pdf_metadata.py"
click node_studio_engine "https://github.com/albert-dilas/tornio/blob/main/backend/app/services/studio_tools_service.py"
click node_workspace_inspector "https://github.com/albert-dilas/tornio/blob/main/backend/app/services/workspace_inspector.py"
click node_api_app "https://github.com/albert-dilas/tornio/blob/main/backend/app/main.py"
click node_upload_manager "https://github.com/albert-dilas/tornio/blob/main/backend/app/core/dependencies.py"
click node_job_engine "https://github.com/albert-dilas/tornio/blob/main/backend/app/core/jobs.py"
click node_configuration "https://github.com/albert-dilas/tornio/blob/main/backend/app/core/config.py"
click node_desktop_service "https://github.com/albert-dilas/tornio/blob/main/backend/app/services/desktop_service.py"
click node_system_service "https://github.com/albert-dilas/tornio/blob/main/backend/app/services/system_service.py"
click node_tray "https://github.com/albert-dilas/tornio/blob/main/backend/app/core/tray.py"
click node_binary_detection "https://github.com/albert-dilas/tornio/blob/main/backend/app/utils/binaries.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_home,node_tool_ui,node_pipelines_ui,node_workspace_ui,node_user toneBlue
class node_tool_routes,node_studio_routes,node_pipeline_runner,node_system_routes toneAmber
class node_pdf_services,node_compressor,node_metadata,node_studio_engine,node_workspace_inspector toneMint
class node_api_app,node_upload_manager,node_job_engine,node_configuration toneRose
class node_desktop_service,node_system_service,node_tray,node_binary_detection,node_internet toneIndigo
```

## Components

### Workbench interface

- [Home launchpad](https://github.com/albert-dilas/tornio/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Tool screens](https://github.com/albert-dilas/tornio/tree/main/frontend/src/app/(tools)): `frontend/src/app/(tools)`
- [Pipeline builder](https://github.com/albert-dilas/tornio/blob/main/frontend/src/app/pipelines/page.tsx): `frontend/src/app/pipelines/page.tsx`
- [File workspace](https://github.com/albert-dilas/tornio/blob/main/frontend/src/app/workspace/page.tsx): `frontend/src/app/workspace/page.tsx`

### API workflows

- [Document tool routes](https://github.com/albert-dilas/tornio/tree/main/backend/app/api/v1/endpoints): `backend/app/api/v1/endpoints`
- [Studio tool routes](https://github.com/albert-dilas/tornio/blob/main/backend/app/api/v1/endpoints/studio_tools.py): `backend/app/api/v1/endpoints/studio_tools.py`
- [Pipeline executor](https://github.com/albert-dilas/tornio/blob/main/backend/app/api/v1/endpoints/pipelines.py): `backend/app/api/v1/endpoints/pipelines.py`
- [System routes](https://github.com/albert-dilas/tornio/blob/main/backend/app/api/v1/endpoints/system.py): `backend/app/api/v1/endpoints/system.py`

### Processing engines

- [PDF processors](https://github.com/albert-dilas/tornio/tree/main/backend/app/services): `backend/app/services`
- [PDF compression](https://github.com/albert-dilas/tornio/blob/main/backend/app/services/pdf_compressor.py): `backend/app/services/pdf_compressor.py`
- [PDF metadata](https://github.com/albert-dilas/tornio/blob/main/backend/app/services/pdf_metadata.py): `backend/app/services/pdf_metadata.py`
- [Studio engines](https://github.com/albert-dilas/tornio/blob/main/backend/app/services/studio_tools_service.py): `backend/app/services/studio_tools_service.py`
- [Workspace inspection](https://github.com/albert-dilas/tornio/blob/main/backend/app/services/workspace_inspector.py): `backend/app/services/workspace_inspector.py`

### Local runtime

- [FastAPI application](https://github.com/albert-dilas/tornio/blob/main/backend/app/main.py): `backend/app/main.py`
- [Upload handling](https://github.com/albert-dilas/tornio/blob/main/backend/app/core/dependencies.py): `backend/app/core/dependencies.py`
- [Jobs and streams](https://github.com/albert-dilas/tornio/blob/main/backend/app/core/jobs.py): `backend/app/core/jobs.py`
- [Local configuration](https://github.com/albert-dilas/tornio/blob/main/backend/app/core/config.py): `backend/app/core/config.py`

### Desktop services

- [Desktop lifecycle](https://github.com/albert-dilas/tornio/blob/main/backend/app/services/desktop_service.py): `backend/app/services/desktop_service.py`
- [System status](https://github.com/albert-dilas/tornio/blob/main/backend/app/services/system_service.py): `backend/app/services/system_service.py`
- [System tray](https://github.com/albert-dilas/tornio/blob/main/backend/app/core/tray.py): `backend/app/core/tray.py`
- [Engine detection](https://github.com/albert-dilas/tornio/blob/main/backend/app/utils/binaries.py): `backend/app/utils/binaries.py`

### Other components

- **Workbench user**
- **Online services**

## Connections

- Workbench user → Home launchpad: opens (evidence: `README.md`)
- Workbench user → Tool screens: selects tools (evidence: `README.md`)
- Workbench user → Pipeline builder: builds workflows (evidence: `README.md`)
- Workbench user → File workspace: inspects files (evidence: `README.md`)
- FastAPI application → Document tool routes: mounts routes
- FastAPI application → Studio tool routes: mounts routes
- FastAPI application → Pipeline executor: mounts routes
- FastAPI application → System routes: mounts routes
- Document tool routes → PDF compression: calls (evidence: `backend/app/api/v1/endpoints/compress.py`)
- Document tool routes → PDF metadata: calls (evidence: `backend/app/api/v1/endpoints/metadata.py`)
- Document tool routes → PDF processors: dispatches tools (evidence: `backend/app/api/v1/endpoints/pipelines.py`)
- Studio tool routes → Studio engines: calls (evidence: `backend/app/api/v1/endpoints/studio_tools.py`)
- Pipeline executor → PDF compression: invokes step (evidence: `backend/app/api/v1/endpoints/pipelines.py`)
- Pipeline executor → PDF metadata: invokes step (evidence: `backend/app/api/v1/endpoints/pipelines.py`)
- Pipeline executor → Studio engines: invokes step (evidence: `backend/app/api/v1/endpoints/pipelines.py`)
- Document tool routes → Upload handling: uses uploads (evidence: `backend/app/api/v1/endpoints/compress.py`)
- Studio tool routes → Upload handling: uses uploads (evidence: `backend/app/api/v1/endpoints/studio_tools.py`)
- Pipeline executor → Upload handling: saves uploads (evidence: `backend/app/api/v1/endpoints/pipelines.py`)
- FastAPI application → Workspace inspection: uses inspection (evidence: `backend/app/main.py`)
- System routes → Desktop lifecycle: calls (evidence: `backend/app/api/v1/endpoints/system.py`)
- System routes → System status: calls (evidence: `backend/app/api/v1/endpoints/system.py`)
- Desktop lifecycle → Local configuration: reads settings (evidence: `backend/app/services/desktop_service.py`)
- System status → Desktop lifecycle: uses desktop state (evidence: `backend/app/services/system_service.py`)
- System status → Engine detection: checks engines (evidence: `backend/app/services/system_service.py`)
- FastAPI application → System tray: starts runtime (evidence: `backend/app/main.py`)
- Studio engines → Engine detection: detects engines (evidence: `backend/app/services/studio_tools_service.py`)
- Desktop lifecycle → Online services: checks updates
- System status → Online services: checks releases (evidence: `backend/app/services/system_service.py`)
