Skip to content

Getting Started

Vinícius Costa edited this page Apr 12, 2026 · 2 revisions

This page gives you the fastest reliable path to a first Aparoksha app.

Recommended strategy

The simplest way to begin today is:

  1. create a standard Swift executable package
  2. add the main Aparoksha package as a dependency
  3. import Aparoksha
  4. let the package choose the default backend for your platform
  5. only force a backend manually when testing or debugging

This is the best starting point because the umbrella package already contains the backend selection logic.

Requirements

Common requirements

  • Swift 6 toolchain
  • network access the first time Swift Package Manager resolves dependencies

Linux

Install GTK 4 and libadwaita development packages.

Fedora

sudo dnf install gtk4-devel libadwaita-devel

Ubuntu / Debian

sudo apt install libgtk-4-dev libadwaita-1-dev

macOS

  • install Xcode
  • make sure the Swift toolchain is working
  • the default backend on macOS is typically APPKIT

If you want to experiment with the Adwaita backend on macOS too:

brew install libadwaita

Windows

  • install Swift for Windows
  • install the Windows App SDK
  • use PowerShell or your preferred editor environment to build and run

Create a new project

mkdir MyAparokshaApp
cd MyAparokshaApp
swift package init --type executable

Replace Package.swift

// swift-tools-version: 6.0
import PackageDescription

let package = Package(
    name: "MyAparokshaApp",
    platforms: [
        .macOS(.v13)
    ],
    products: [
        .executable(name: "MyAparokshaApp", targets: ["MyAparokshaApp"])
    ],
    dependencies: [
        .package(url: "https://git.aparoksha.dev/aparoksha/aparoksha", branch: "main")
    ],
    targets: [
        .executableTarget(
            name: "MyAparokshaApp",
            dependencies: ["Aparoksha"],
            path: "Sources"
        )
    ],
    swiftLanguageModes: [.v5]
)

Add the main app file

Create Sources/MyAparokshaApp.swift:

import Aparoksha

@main
struct MyAparokshaApp: App {

    let app = Aparoksha(
        id: "com.example.myaparokshaapp",
        name: "My Aparoksha App",
        settings: "Settings",
        about: "About My Aparoksha App",
        developer: "Your Name",
        version: "0.1.0",
        quit: "Quit My Aparoksha App",
        website: .init(string: "https://example.com")!,
        websiteLabel: "Website",
        issues: .init(string: "https://example.com/issues")!,
        issuesLabel: "Issues",
        services: "Services"
    )
    .hideMenu(
        hideApp: "Hide My Aparoksha App",
        hideOthers: "Hide Others",
        showAll: "Show All"
    )

    var scene: Scene {
        Window("My Aparoksha App", icon: .headphones, id: "main") {
            ContentView()
        }
    }
}

struct ContentView: WindowView {
    var view: Body {
        VStack {
            Text("Hello from Aparoksha")
                .padding(10)
        }
        .padding(20)
    }
}

Run the app

swift run

That should use the native default backend for the current platform.

Versioning note

The upstream ecosystem currently has some inconsistency between older versioned dependency examples and the current umbrella package setup. For a new project, the most practical path is to follow the current umbrella package style and use branch: "main".

Next step

Continue with Starter Template if you want a GitHub-ready starter layout, or Project Structure and Core Concepts if you want to understand how the framework fits together.