# Main Modules and Components of Palmier Pro: A Complete Architecture Guide

> Explore the main modules and components of Palmier Pro. Understand its layered architecture from app lifecycle management to multi-format export in this complete guide.

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

---

**Palmier Pro organizes its Swift codebase into twelve distinct functional modules—App, Editor, MediaPanel, Preview, Generation, Export, Transcription, Models, UI, Utilities, Help & Inspector, and Toolbar—that form a layered architecture spanning application lifecycle management, video editing interfaces, real-time preview rendering, and multi-format export capabilities.**

Palmier Pro is a macOS video editing application built with Swift and distributed as a set of Swift packages under the `palmier-io/palmier-pro` repository. The source code in `Sources/PalmierPro` implements a modular architecture that separates concerns into distinct domains, using a hybrid SwiftUI and AppKit approach with `@Observable` view-models to synchronize the interface with underlying video project data.

## Core Application Layer: The App Module

The **App module** serves as the entry point for the Palmier Pro application lifecycle, handling menu management, global state coordination, and software update mechanisms. Located in `Sources/PalmierPro/App/`, this module contains [`main.swift`](https://github.com/palmier-io/palmier-pro/blob/main/main.swift) as the application entry point, [`AppState.swift`](https://github.com/palmier-io/palmier-pro/blob/main/AppState.swift) which orchestrates project loading, and [`Updater.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Updater.swift) which manages version updates.

### Lifecycle and State Management

The `AppState` class manages the asynchronous opening of video projects through the `openProject(at:register:)` method. When a user selects a project file, the application transitions control to the **Editor module** via the `EditorViewModel`.

```swift
// Sources/PalmierPro/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: The Editor Module

The **Editor module** provides the primary window controller and view hierarchy for the main editing canvas. This module, found in `Sources/PalmierPro/Editor/`, bridges the data models with the user interface through dedicated view-models.

### Window Management and View Hierarchy

[`EditorWindowController.swift`](https://github.com/palmier-io/palmier-pro/blob/main/EditorWindowController.swift) manages the document window lifecycle, while [`EditorView.swift`](https://github.com/palmier-io/palmier-pro/blob/main/EditorView.swift) defines the SwiftUI interface. The module uses [`ViewModel/EditorViewModel.swift`](https://github.com/palmier-io/palmier-pro/blob/main/ViewModel/EditorViewModel.swift) to maintain project state and coordinate with other modules.

### View-Model Integration

When opening a project, the `EditorViewModel` receives launch options through the `apply(_:to:)` method, enabling behaviors like automatic tutorial initiation:

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

```

## Media and Preview Systems

### MediaPanel Module: Asset Management

The **MediaPanel** module handles browsing, import, and management of media assets including videos, images, audio, and Lottie files. Key files include [`MediaPanelView.swift`](https://github.com/palmier-io/palmier-pro/blob/main/MediaPanelView.swift) and [`MediaTab/MediaTab.swift`](https://github.com/palmier-io/palmier-pro/blob/main/MediaTab/MediaTab.swift), which provide the interface for asset organization, and [`CaptionsTab/CaptionTab.swift`](https://github.com/palmier-io/palmier-pro/blob/main/CaptionsTab/CaptionTab.swift) for subtitle management.

Assets are added to the project through the `MediaAsset` model defined in the **Models** module:

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

```

### Preview Module: Real-Time Rendering

The **Preview module** manages real-time video preview, timeline rendering, and overlay controls. Located in `Sources/PalmierPro/Preview/`, it contains [`PreviewView.swift`](https://github.com/palmier-io/palmier-pro/blob/main/PreviewView.swift) for the interface, [`TimelineRenderer.swift`](https://github.com/palmier-io/palmier-pro/blob/main/TimelineRenderer.swift) for drawing operations, and [`VideoEngine.swift`](https://github.com/palmier-io/palmier-pro/blob/main/VideoEngine.swift) for playback control.

The `TimelineRenderer` processes the `Timeline` model to draw frame sequences:

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

```

## Processing and Export Pipeline

### Generation Module: Video Rendering and Compression

The **Generation module** handles video rendering, compression, and editing-specific extraction tasks like trimming. [`GenerationService.swift`](https://github.com/palmier-io/palmier-pro/blob/main/GenerationService.swift) coordinates the pipeline, while [`VideoCompressor.swift`](https://github.com/palmier-io/palmier-pro/blob/main/VideoCompressor.swift) and [`Edit/VideoTrimExtractor.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Edit/VideoTrimExtractor.swift) perform specialized operations on media assets.

### Export Module: Format Conversion

The **Export module** converts Palmier projects into various formats including XML, Lottie, and text-based exports. [`ExportService.swift`](https://github.com/palmier-io/palmier-pro/blob/main/ExportService.swift) provides the main entry point, utilizing specialized exporters like [`XMLExporter.swift`](https://github.com/palmier-io/palmier-pro/blob/main/XMLExporter.swift) and [`PalmierProjectExporter.swift`](https://github.com/palmier-io/palmier-pro/blob/main/PalmierProjectExporter.swift).

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

```

## Supporting Infrastructure

### Data Models (Models Module)

The **Models** module defines core data structures for timelines, clips, media assets, and keyframes. Key files include [`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), and [`Keyframe.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Keyframe.swift), which serve as the single source of truth for project state across all modules.

### Transcription and Search

The **Transcription module** provides speech-to-text capabilities for video assets, with [`Transcription.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Transcription.swift) handling the conversion process and [`TranscriptSearch.swift`](https://github.com/palmier-io/palmier-pro/blob/main/TranscriptSearch.swift) enabling text-based searching within media content.

### UI Design System and Utilities

The **UI module** contains reusable SwiftUI primitives and the design system centered on [`AppTheme.swift`](https://github.com/palmier-io/palmier-pro/blob/main/AppTheme.swift) and [`SidebarRowButton.swift`](https://github.com/palmier-io/palmier-pro/blob/main/SidebarRowButton.swift). The **Utilities** module provides cross-cutting concerns including logging ([`Log.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Log.swift)), disk caching ([`DiskCache.swift`](https://github.com/palmier-io/palmier-pro/blob/main/DiskCache.swift)), image encoding ([`ImageEncoder.swift`](https://github.com/palmier-io/palmier-pro/blob/main/ImageEncoder.swift)), and keychain storage.

### Help, Inspector, and Toolbar

The **Help & Inspector** modules deliver in-app documentation through [`HelpView.swift`](https://github.com/palmier-io/palmier-pro/blob/main/HelpView.swift) and property editing through panels like [`Inspector/TextTab.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Inspector/TextTab.swift). The **Toolbar** module centralizes action controls in [`ToolbarView.swift`](https://github.com/palmier-io/palmier-pro/blob/main/ToolbarView.swift), managing undo/redo, export triggers, and playback controls.

## Summary

- Palmier Pro organizes code into twelve distinct modules under `Sources/PalmierPro`, each handling specific functional domains from application lifecycle to final export.
- The **App module** manages the entry point and global state, while the **Editor module** controls the main window and view-models.
- **MediaPanel** and **Preview** handle asset management and real-time timeline rendering using `TimelineRenderer` and `VideoEngine`.
- **Generation** and **Export** form the output pipeline, handling video compression through `VideoCompressor` and format conversion via `XMLExporter`.
- **Models** provides the shared data layer, supported by **Transcription**, **UI**, **Utilities**, and interface modules for help, inspection, and toolbar actions.
- The architecture follows a layered flow: App → Editor → MediaPanel/Preview → Generation → Export.

## Frequently Asked Questions

### What programming language is Palmier Pro built with?

Palmier Pro is built using **Swift**, leveraging a hybrid architecture that combines SwiftUI for interface components with AppKit for macOS-specific window management. The codebase uses modern Swift features including `@Observable` view-models and structured concurrency with `async/await` for asynchronous operations like project loading in [`AppState.swift`](https://github.com/palmier-io/palmier-pro/blob/main/AppState.swift) and media import.

### How does Palmier Pro handle communication between modules?

Modules communicate through shared data models and view-model references. For example, the **MediaPanel** module appends `MediaAsset` instances to arrays managed by the `EditorViewModel`, while the **Preview** module's `TimelineRenderer` reads from the `Timeline` model defined in the **Models** module. This follows an MVVM pattern where view-models in the **Editor** module coordinate state across functional boundaries.

### What file formats can Palmier Pro export?

According to the **Export** module source code in `Sources/PalmierPro/Export/`, Palmier Pro supports conversion to **XML**, **Lottie**, and text-based formats. The [`ExportService.swift`](https://github.com/palmier-io/palmier-pro/blob/main/ExportService.swift) file coordinates these operations through specialized exporters like [`XMLExporter.swift`](https://github.com/palmier-io/palmier-pro/blob/main/XMLExporter.swift) and [`PalmierProjectExporter.swift`](https://github.com/palmier-io/palmier-pro/blob/main/PalmierProjectExporter.swift), enabling interoperability with other video editing and animation tools.

### Where is the entry point of the Palmier Pro application?

The application entry point resides in [`Sources/PalmierPro/App/main.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Sources/PalmierPro/App/main.swift) within the **App module**. This file initializes the application lifecycle, sets up the menu bar, and instantiates the `AppState` class that manages global application state and project window coordination, as implemented in the `palmier-io/palmier-pro` repository.