# stremio/stremio-service architecture

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

- Interactive diagram: https://gitdiagram.com/stremio/stremio-service
- Repository: https://github.com/stremio/stremio-service

## Overview

Stremio Service is a desktop companion that starts the Stremio server runtime, exposes tray and protocol-link controls, and checks for application updates. The principal workflow is CLI startup → configuration → optional update → server launch → tray-driven operation. The graph also includes update delivery and bundled runtime tools. Some application and updater source was excerpted only partially, so unshown internal details and links are omitted.

Main entry points: [`src/main.rs`](https://github.com/stremio/stremio-service/blob/master/src/main.rs) (CLI entry), [`src/app.rs`](https://github.com/stremio/stremio-service/blob/master/src/app.rs) (Application lifecycle), [`src/updater.rs`](https://github.com/stremio/stremio-service/blob/master/src/updater.rs) (Update checks), [`src/server.rs`](https://github.com/stremio/stremio-service/blob/master/src/server.rs) (Server process manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup and configuration"]
  node_entry["CLI entry<br/>[main.rs]"]
  node_arguments["CLI arguments<br/>[args.rs]"]
  node_configuration["Service configuration<br/>[config.rs]"]
end

subgraph group_desktop["Desktop controls"]
  node_application["Application lifecycle<br/>[app.rs]"]
  node_tray["System tray<br/>[app.rs]"]
  node_protocol["Protocol links<br/>[app.rs]"]
end

subgraph group_runtime["Runtime and updates"]
  node_updater["Update checks<br/>[updater.rs]"]
  node_server_manager["Server process manager<br/>[server.rs]"]
end

node_user(("User"))
node_web["Stremio Web"]
node_update_service["Update service"]
node_installer["Platform installer"]
node_server_runtime["Stremio server runtime"]
node_media_tools["FFmpeg tools"]

node_user -->|"starts"| node_entry
node_entry -->|"parses"| node_arguments
node_entry -->|"builds"| node_configuration
node_entry -->|"runs"| node_application
node_arguments -->|"configures"| node_configuration
node_configuration -->|"configures"| node_server_manager
node_application -->|"checks updates"| node_updater
node_application -->|"starts"| node_server_manager
node_application -->|"creates"| node_tray
node_user -.->|"selects actions"| node_tray
node_tray -.->|"opens"| node_web
node_user -->|"provides link"| node_protocol
node_protocol -->|"opens"| node_web
node_updater -->|"requests updates"| node_update_service
node_update_service -->|"returns descriptor"| node_updater
node_updater -->|"downloads and launches"| node_installer
node_server_manager -->|"launches"| node_server_runtime
node_server_manager -->|"sets binary paths"| node_media_tools

click node_entry "https://github.com/stremio/stremio-service/blob/master/src/main.rs"
click node_arguments "https://github.com/stremio/stremio-service/blob/master/src/args.rs"
click node_configuration "https://github.com/stremio/stremio-service/blob/master/src/config.rs"
click node_application "https://github.com/stremio/stremio-service/blob/master/src/app.rs"
click node_tray "https://github.com/stremio/stremio-service/blob/master/src/app.rs"
click node_protocol "https://github.com/stremio/stremio-service/blob/master/src/app.rs"
click node_updater "https://github.com/stremio/stremio-service/blob/master/src/updater.rs"
click node_server_manager "https://github.com/stremio/stremio-service/blob/master/src/server.rs"
click node_server_runtime "https://github.com/stremio/stremio-service/tree/master/resources/bin"
click node_media_tools "https://github.com/stremio/stremio-service/tree/master/resources/bin"

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_entry,node_arguments,node_configuration,node_user toneBlue
class node_application,node_tray,node_protocol toneAmber
class node_updater,node_server_manager,node_server_runtime toneMint
class node_web,node_update_service,node_installer toneIndigo
class node_media_tools toneTeal
```

## Components

### Startup and configuration

- [CLI entry](https://github.com/stremio/stremio-service/blob/master/src/main.rs): `src/main.rs`
- [CLI arguments](https://github.com/stremio/stremio-service/blob/master/src/args.rs): `src/args.rs`
- [Service configuration](https://github.com/stremio/stremio-service/blob/master/src/config.rs): `src/config.rs`

### Desktop controls

- [Application lifecycle](https://github.com/stremio/stremio-service/blob/master/src/app.rs): `src/app.rs`
- [System tray](https://github.com/stremio/stremio-service/blob/master/src/app.rs): `src/app.rs`
- [Protocol links](https://github.com/stremio/stremio-service/blob/master/src/app.rs): `src/app.rs`

### Runtime and updates

- [Update checks](https://github.com/stremio/stremio-service/blob/master/src/updater.rs): `src/updater.rs`
- [Server process manager](https://github.com/stremio/stremio-service/blob/master/src/server.rs): `src/server.rs`

### Other components

- **User**
- **Stremio Web**
- **Update service**
- **Platform installer**
- [Stremio server runtime](https://github.com/stremio/stremio-service/tree/master/resources/bin): `resources/bin`
- [FFmpeg tools](https://github.com/stremio/stremio-service/tree/master/resources/bin): `resources/bin`

## Connections

- User → CLI entry: starts (evidence: `README.md`)
- CLI entry → CLI arguments: parses (evidence: `src/main.rs`)
- CLI entry → Service configuration: builds (evidence: `src/main.rs`)
- CLI entry → Application lifecycle: runs (evidence: `src/main.rs`)
- CLI arguments → Service configuration: configures (evidence: `src/config.rs`)
- Service configuration → Server process manager: configures (evidence: `src/config.rs`)
- Application lifecycle → Update checks: checks updates (evidence: `src/app.rs`)
- Application lifecycle → Server process manager: starts (evidence: `src/app.rs`)
- Application lifecycle → System tray: creates (evidence: `src/app.rs`)
- User → System tray: selects actions
- System tray → Stremio Web: opens
- User → Protocol links: provides link
- Protocol links → Stremio Web: opens (evidence: `src/app.rs`)
- Update checks → Update service: requests updates (evidence: `src/updater.rs`)
- Update service → Update checks: returns descriptor (evidence: `src/updater.rs`)
- Update checks → Platform installer: downloads and launches (evidence: `src/updater.rs`)
- Server process manager → Stremio server runtime: launches (evidence: `src/server.rs`)
- Server process manager → FFmpeg tools: sets binary paths (evidence: `src/server.rs`)
