# zerabyte88/phantek-video-toolkit architecture

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

- Interactive diagram: https://gitdiagram.com/zerabyte88/phantek-video-toolkit
- Repository: https://github.com/zerabyte88/phantek-video-toolkit

## Overview

Phantek is an offline Android video toolkit. Its main workflow is selecting a video, choosing conversion settings, and processing it locally with FFmpeg; audio extraction is a parallel operation. The app also provides device-aware resource controls, background execution and telemetry, persistent settings, themes, and localization. The README documents these capabilities, but no Dart source was excerpted, so the edges below reflect documented relationships rather than inspected call sites.

Main entry points: [`lib/screens/home_screen.dart`](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/screens/home_screen.dart) (Home screen), [`lib/screens/processing_screen.dart`](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/screens/processing_screen.dart) (Processing screen), [`lib/screens/settings_screen.dart`](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/screens/settings_screen.dart) (Settings screen), [`lib/services/ffmpeg_service.dart`](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/services/ffmpeg_service.dart) (FFmpeg processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_home["Home screen<br/>[home_screen.dart]"]
  node_processing["Processing screen"]
  node_settings_screen["Settings screen"]
  node_video_info["Video information"]
  node_conversion_options["Conversion options"]
  node_audio_options["Audio extraction options"]
end

subgraph group_media["Media processing"]
  node_ffmpeg["FFmpeg processing"]
  node_encoding_options["Encoding settings model"]
  node_video_model["Video information model<br/>[video_info.dart]"]
end

subgraph group_device["Device execution"]
  node_foreground["Foreground execution"]
  node_device_specs["Device resource detection"]
  node_cache["Cache management"]
end

subgraph group_preferences["Preferences and presentation"]
  node_settings_service["Settings persistence"]
  node_app_settings["App settings model<br/>[app_settings.dart]"]
  node_localization["Localization"]
  node_theme["Theme system<br/>[app_theme.dart]"]
  node_animated_background["Theme backgrounds"]
end

node_user(("User"))
node_picker["Android media picker"]
node_local_files[("On-device media")]

node_user -->|"uses"| node_home
node_home -->|"selects video"| node_picker
node_home -->|"shows details"| node_video_info
node_home -->|"configures video"| node_conversion_options
node_home -->|"configures extraction"| node_audio_options
node_conversion_options -->|"starts conversion"| node_processing
node_audio_options -->|"starts extraction"| node_processing
node_processing -->|"runs encoding"| node_ffmpeg
node_ffmpeg -->|"reads and writes"| node_local_files
node_ffmpeg -->|"runs in background"| node_foreground
node_processing -->|"adapts resources"| node_device_specs
node_processing -->|"uses buffers"| node_cache
node_user -->|"configures preferences"| node_settings_screen
node_settings_screen -->|"persists settings"| node_settings_service
node_settings_service -->|"stores settings"| node_app_settings
node_settings_screen -->|"selects theme"| node_theme
node_theme -->|"drives backgrounds"| node_animated_background
node_home -->|"localizes interface"| node_localization

click node_home "https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/screens/home_screen.dart"
click node_processing "https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/screens/processing_screen.dart"
click node_settings_screen "https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/screens/settings_screen.dart"
click node_video_info "https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/widgets/video_info_card.dart"
click node_conversion_options "https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/widgets/conversion_options_card.dart"
click node_audio_options "https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/widgets/audio_extractor_card.dart"
click node_ffmpeg "https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/services/ffmpeg_service.dart"
click node_encoding_options "https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/models/encoding_options.dart"
click node_video_model "https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/models/video_info.dart"
click node_foreground "https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/services/foreground_service.dart"
click node_device_specs "https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/services/device_spec_helper.dart"
click node_cache "https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/services/cache_manager_service.dart"
click node_settings_service "https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/services/settings_service.dart"
click node_app_settings "https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/models/app_settings.dart"
click node_localization "https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/services/localization_service.dart"
click node_theme "https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/theme/app_theme.dart"
click node_animated_background "https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/widgets/theme_animated_background.dart"

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_processing,node_settings_screen,node_video_info,node_conversion_options,node_audio_options,node_user toneBlue
class node_ffmpeg,node_encoding_options,node_video_model,node_local_files toneAmber
class node_foreground,node_device_specs,node_cache toneMint
class node_settings_service,node_app_settings,node_localization,node_theme,node_animated_background toneRose
class node_picker toneIndigo
```

## Components

### User interface

- [Home screen](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/screens/home_screen.dart): `lib/screens/home_screen.dart`
- [Processing screen](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/screens/processing_screen.dart): `lib/screens/processing_screen.dart`
- [Settings screen](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/screens/settings_screen.dart): `lib/screens/settings_screen.dart`
- [Video information](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/widgets/video_info_card.dart): `lib/widgets/video_info_card.dart`
- [Conversion options](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/widgets/conversion_options_card.dart): `lib/widgets/conversion_options_card.dart`
- [Audio extraction options](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/widgets/audio_extractor_card.dart): `lib/widgets/audio_extractor_card.dart`

### Media processing

- [FFmpeg processing](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/services/ffmpeg_service.dart): `lib/services/ffmpeg_service.dart`
- [Encoding settings model](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/models/encoding_options.dart): `lib/models/encoding_options.dart`
- [Video information model](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/models/video_info.dart): `lib/models/video_info.dart`

### Device execution

- [Foreground execution](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/services/foreground_service.dart): `lib/services/foreground_service.dart`
- [Device resource detection](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/services/device_spec_helper.dart): `lib/services/device_spec_helper.dart`
- [Cache management](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/services/cache_manager_service.dart): `lib/services/cache_manager_service.dart`

### Preferences and presentation

- [Settings persistence](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/services/settings_service.dart): `lib/services/settings_service.dart`
- [App settings model](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/models/app_settings.dart): `lib/models/app_settings.dart`
- [Localization](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/services/localization_service.dart): `lib/services/localization_service.dart`
- [Theme system](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/theme/app_theme.dart): `lib/theme/app_theme.dart`
- [Theme backgrounds](https://github.com/zerabyte88/phantek-video-toolkit/blob/main/lib/widgets/theme_animated_background.dart): `lib/widgets/theme_animated_background.dart`

### Other components

- **User**
- **Android media picker**
- **On-device media**

## Connections

- User → Home screen: uses (evidence: `README.md`)
- Home screen → Android media picker: selects video (evidence: `README.md`)
- Home screen → Video information: shows details (evidence: `README.md`)
- Home screen → Conversion options: configures video (evidence: `README.md`)
- Home screen → Audio extraction options: configures extraction (evidence: `README.md`)
- Conversion options → Processing screen: starts conversion (evidence: `README.md`)
- Audio extraction options → Processing screen: starts extraction (evidence: `README.md`)
- Processing screen → FFmpeg processing: runs encoding (evidence: `README.md`)
- FFmpeg processing → On-device media: reads and writes (evidence: `README.md`)
- FFmpeg processing → Foreground execution: runs in background (evidence: `README.md`)
- Processing screen → Device resource detection: adapts resources (evidence: `README.md`)
- Processing screen → Cache management: uses buffers (evidence: `README.md`)
- User → Settings screen: configures preferences (evidence: `README.md`)
- Settings screen → Settings persistence: persists settings (evidence: `README.md`)
- Settings persistence → App settings model: stores settings (evidence: `README.md`)
- Settings screen → Theme system: selects theme (evidence: `README.md`)
- Theme system → Theme backgrounds: drives backgrounds (evidence: `README.md`)
- Home screen → Localization: localizes interface (evidence: `README.md`)
