# What Are the Main Components of Palmier Pro? A Deep Dive into the Swift Architecture

> Explore the eleven core Swift modules of Palmier Pro, including App, Editor, and MediaPanel. Understand its layered architecture for professional video editing in this deep dive.

- Repository: [Palmier/palmier-pro](https://github.com/palmier-io/palmier-pro)
- Tags: deep-dive
- Published: 2026-06-23

---

**Palmier Pro is organized into eleven distinct Swift modules—App, Editor, MediaPanel, Preview, Generation, Export, Transcription, Models, UI, Utilities, and Help & Inspector—that form a layered architecture for professional video editing.**

The open-source repository `palmier-io/palmier-pro` implements a macOS video editing application using a hybrid SwiftUI and AppKit architecture. Understanding the main components of Palmier Pro is essential for contributors and developers looking to extend its functionality or integrate with its API. Each module lives under `Sources/PalmierPro` and encapsulates a specific domain, from real-time preview rendering to speech-to-text transcription.

## Architectural Overview

The codebase follows a unidirectional data flow pattern with **@Observable** view-models synchronizing the UI to the underlying project state. The architecture separates concerns into four logical layers:

1. **Presentation Layer** – App, Editor, MediaPanel, Preview, and Toolbar handle user interaction
2. **Business Logic Layer** – Generation and Transcription process media and extract data
3. **Data Layer** – Models defines the core structures (Timeline, MediaAsset, Keyframe)
4. **Infrastructure Layer** – UI, Utilities, and Export provide cross-cutting concerns

## Core Application Layer (App)

The **App** module manages the application lifecycle, global state, menu bar integration, and update handling. It serves as the entry point and coordinator for the entire system.

Key responsibilities include:
- Application bootstrap via [`App/main.swift`](https://github.com/palmier-io/palmier-pro/blob/main/App/main.swift)
- Global state management in [`App/AppState.swift`](https://github.com/palmier-io/palmier-pro/blob/main/App/AppState.swift)
- Automatic update checking via [`App/Updater.swift`](https://github.com/palmier-io/palmier-pro/blob/main/App/Updater.swift)

The `AppState` class orchestrates asynchronous project loading. When a user opens a file, `AppState.openProject(at:register:)` initializes the editor session:

```swift
// App/AppState.swift
func openProject(at url: URL, register: Bool = true) {
    Task {
        do {
            try await openProjectAsync(at: url, register: register, options: .init())
        } catch {
            NSAlert(error: error).runModal()
        }
    }
}

```

## Editing Interface (Editor)

The **Editor** module contains the window controller, view hierarchy, and view-model for the main editing canvas. It bridges the AppKit window management with SwiftUI view logic.

Critical files include:
- [`Editor/EditorWindowController.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Editor/EditorWindowController.swift) – Manages the NSDocument window lifecycle
- [`Editor/EditorView.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Editor/EditorView.swift) – Root SwiftUI view for the editing interface
- [`Editor/ViewModel/EditorViewModel.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Editor/ViewModel/EditorViewModel.swift) – Observable object managing the current project state

The `EditorViewModel` receives launch options from the App layer and configures the initial user experience:

```swift
// Editor/ViewModel/EditorViewModel.swift
func apply(_ options: ProjectOpenOptions, to editor: EditorViewModel) {
    if options.startTutorial {
        DispatchQueue.main.async { editor.tour.start(in: editor) }
    }
}

```

## Asset Management (MediaPanel)

The **MediaPanel** module handles browsing, importing, and organizing media assets including videos, images, audio, and Lottie files. It provides the sidebar interface for project assets and captions.

Key components:
- [`MediaPanel/MediaPanelView.swift`](https://github.com/palmier-io/palmier-pro/blob/main/MediaPanel/MediaPanelView.swift) – Main container view
- [`MediaPanel/MediaTab/MediaTab.swift`](https://github.com/palmier-io/palmier-pro/blob/main/MediaPanel/MediaTab/MediaTab.swift) – Asset browser interface
- [`MediaPanel/CaptionsTab/CaptionTab.swift`](https://github.com/palmier-io/palmier-pro/blob/main/MediaPanel/CaptionsTab/CaptionTab.swift) – Subtitle and transcription management

Assets are appended to the project through the `EditorViewModel` via `MediaAsset` instances defined in the Models module:

```swift
// MediaPanel/MediaTab/AssetThumbnailView.swift
func addAsset(_ asset: MediaAsset) {
    project.editorViewModel.mediaAssets.append(asset)
}

```

## Real-Time Rendering (Preview)

The **Preview** module provides real-time video preview capabilities, timeline rendering, and overlay controls. It maintains the `VideoEngine` responsible for frame-accurate playback.

Core files:
- [`Preview/PreviewView.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Preview/PreviewView.swift) – SwiftUI wrapper for the rendering surface
- [`Preview/TimelineRenderer.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Preview/TimelineRenderer.swift) – Draws the timeline and clip boundaries
- [`Preview/VideoEngine.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Preview/VideoEngine.swift) – Low-level video decoding and display

The `TimelineRenderer` iterates over the clip list from the `Timeline` model to composite frames:

```swift
// Preview/TimelineRenderer.swift
func renderTimeline(_ timeline: Timeline, in context: RenderingContext) {
    // Iterate over clips and draw each frame.
    timeline.clips.forEach { clip in
        // …
    }
}

```

## Processing Engine (Generation)

The **Generation** module handles computationally intensive tasks including video rendering, compression, and editing-specific extractions like trimming. It operates on background queues to maintain UI responsiveness.

Key services:
- [`Generation/GenerationService.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Generation/GenerationService.swift) – High-level rendering coordinator
- [`Generation/VideoCompressor.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Generation/VideoCompressor.swift) – Output compression and encoding
- [`Generation/Edit/VideoTrimExtractor.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Generation/Edit/VideoTrimExtractor.swift) – Segment extraction for timeline edits

## Output Pipeline (Export)

The **Export** module converts in-memory `VideoProject` instances into portable formats including XML, Lottie, and text representations. It serializes the Models layer into industry-standard formats.

Primary exporters:
- [`Export/ExportService.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Export/ExportService.swift) – Entry point for all export operations
- [`Export/XMLExporter.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Export/XMLExporter.swift) – Final Cut Pro and Premiere-compatible XML generation
- [`Export/PalmierProjectExporter.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Export/PalmierProjectExporter.swift) – Native project file serialization

The export flow instantiates format-specific exporters based on target requirements:

```swift
// Export/ExportService.swift
func exportProject(_ project: VideoProject, to url: URL) throws {
    let exporter = XMLExporter(project: project)
    try exporter.write(to: url)
}

```

## Speech Recognition (Transcription)

The **Transcription** module provides speech-to-text capabilities for video assets, including result caching and full-text search across transcripts.

Key implementations:
- [`Transcription/Transcription.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Transcription/Transcription.swift) – Audio processing and recognition
- [`Transcription/TranscriptSearch.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Transcription/TranscriptSearch.swift) – Indexed search across generated captions

## Data Models (Models)

The **Models** module defines the immutable and observable data structures that describe timelines, clips, media assets, and keyframes. These structures are shared across all other modules.

Essential types:
- [`Models/Timeline.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Models/Timeline.swift) – Container for tracks and clips
- [`Models/MediaAsset.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Models/MediaAsset.swift) – Metadata wrapper for imported files
- [`Models/Keyframe.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Models/Keyframe.swift) – Animation and property interpolation data

## Supporting Infrastructure

### UI and Design System

The **UI** module provides reusable SwiftUI primitives and the centralized `AppTheme`. Files like [`UI/AppTheme.swift`](https://github.com/palmier-io/palmier-pro/blob/main/UI/AppTheme.swift) and [`UI/SidebarRowButton.swift`](https://github.com/palmier-io/palmier-pro/blob/main/UI/SidebarRowButton.swift) ensure visual consistency across the application.

### Utilities

The **Utilities** module contains cross-cutting helpers for logging ([`Utilities/Log.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Utilities/Log.swift)), disk caching ([`Utilities/DiskCache.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Utilities/DiskCache.swift)), image encoding ([`Utilities/ImageEncoder.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Utilities/ImageEncoder.swift)), and keychain storage.

### Help and Inspector

The **Help & Inspector** modules provide in-app documentation via [`Help/HelpView.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Help/HelpView.swift) and property inspection panels like [`Inspector/TextTab.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Inspector/TextTab.swift) for editing clip properties.

### Toolbar

The **Toolbar** module centralizes action controls for undo/redo, export triggers, and playback transport through [`Toolbar/ToolbarView.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Toolbar/ToolbarView.swift).

## Cross-Module Interaction Patterns

The components communicate through the `EditorViewModel` as a central hub. When a user imports media via the MediaPanel, the asset flows into `Models`, triggers a Preview update via observable bindings, and becomes available for Generation operations.

The `@Observable` macro (or ObservableObject in older patterns) ensures that changes to `Timeline` or `MediaAsset` instances automatically invalidate SwiftUI views in the Editor and Preview modules, maintaining frame-accurate synchronization without manual observer management.

## Summary

- **App** (`Sources/PalmierPro/App`) – Entry point and global state coordination via [`AppState.swift`](https://github.com/palmier-io/palmier-pro/blob/main/AppState.swift)
- **Editor** (`Sources/PalmierPro/Editor`) – Window management and view-models for the canvas
- **MediaPanel** (`Sources/PalmierPro/MediaPanel`) – Asset import and caption management
- **Preview** (`Sources/PalmierPro/Preview`) – Real-time rendering via [`TimelineRenderer.swift`](https://github.com/palmier-io/palmier-pro/blob/main/TimelineRenderer.swift) and [`VideoEngine.swift`](https://github.com/palmier-io/palmier-pro/blob/main/VideoEngine.swift)
- **Generation** (`Sources/PalmierPro/Generation`) – Background video processing and compression
- **Export** (`Sources/PalmierPro/Export`) – Format conversion through [`XMLExporter.swift`](https://github.com/palmier-io/palmier-pro/blob/main/XMLExporter.swift) and [`ExportService.swift`](https://github.com/palmier-io/palmier-pro/blob/main/ExportService.swift)
- **Transcription** (`Sources/PalmierPro/Transcription`) – Speech-to-text with search capabilities
- **Models** (`Sources/PalmierPro/Models`) – Core data structures ([`Timeline.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Timeline.swift), [`MediaAsset.swift`](https://github.com/palmier-io/palmier-pro/blob/main/MediaAsset.swift))
- **UI/Utilities** – Design system primitives and helper functions

## Frequently Asked Questions

### What programming language is Palmier Pro written in?

Palmier Pro is written entirely in **Swift**, utilizing a hybrid architecture that combines SwiftUI for interface components with AppKit for window management and low-level video rendering. The project requires macOS development tools and follows modern Swift concurrency patterns with `async/await` for heavy operations like video generation.

### How does Palmier Pro handle video preview performance?

The **Preview** module decouples the UI from rendering using [`VideoEngine.swift`](https://github.com/palmier-io/palmier-pro/blob/main/VideoEngine.swift) for frame decoding and [`TimelineRenderer.swift`](https://github.com/palmier-io/palmier-pro/blob/main/TimelineRenderer.swift) for compositing. According to the source code, the renderer iterates over `Timeline.clips` in a dedicated rendering context, allowing the main thread to remain responsive while background queues handle pixel buffer operations.

### Where is the project data stored in Palmier Pro?

Project data structures are defined in the **Models** module, specifically in [`Models/Timeline.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Models/Timeline.swift), [`Models/MediaAsset.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Models/MediaAsset.swift), and [`Models/Keyframe.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Models/Keyframe.swift). These in-memory models are serialized to disk via the **Export** module's [`PalmierProjectExporter.swift`](https://github.com/palmier-io/palmier-pro/blob/main/PalmierProjectExporter.swift) for native format saves, or [`XMLExporter.swift`](https://github.com/palmier-io/palmier-pro/blob/main/XMLExporter.swift) for interchange with professional editing software like Final Cut Pro.

### Can I extend Palmier Pro with custom export formats?

Yes. The **Export** module uses a service-oriented architecture where [`ExportService.swift`](https://github.com/palmier-io/palmier-pro/blob/main/ExportService.swift) acts as the coordinator. To add a new format, implement a new exporter class following the pattern of [`XMLExporter.swift`](https://github.com/palmier-io/palmier-pro/blob/main/XMLExporter.swift) (which takes a `VideoProject` in its initializer and implements a `write(to:)` method), then register it within [`ExportService.swift`](https://github.com/palmier-io/palmier-pro/blob/main/ExportService.swift) to expose the option in the export UI.