import SwiftUI
import SwiftData

@main
struct CelestiaTraceApp: App {
    let container: ModelContainer
    
    init() {
        do {
            let schema = Schema([CelestiaSession.self, CelestiaTimelineEvent.self, AudioChunk.self])
            let config = ModelConfiguration(isStoredInMemoryOnly: false)
            let localContainer = try ModelContainer(for: schema, configurations: config)
            self.container = localContainer
        } catch {
            fatalError("Failed to initialize SwiftData Container: \(error)")
        }
    }

    var body: some Scene {
        WindowGroup {
            LaunchRootView()
        }
        .modelContainer(container)
    }
}
