package vassistent;

import vassistent.bootstrap.ApplicationContext;
import vassistent.bootstrap.ApplicationInitializer;
import vassistent.bootstrap.ApplicationShutdownManager;
import vassistent.controller.AppWindowController;

import javax.swing.*;

/**
 * Entry point for the virtual health assistant desktop application.
 */
public class App {

    /**
     * Starts the desktop application, initializes dependencies, and opens the main window.
     *
     * @param args command-line arguments (currently unused)
     */
    public static void main(String[] args) {
        ApplicationInitializer.initLookAndFeel();

        ApplicationContext context =
                ApplicationInitializer.initialize();

        ApplicationShutdownManager shutdownManager =
                new ApplicationShutdownManager(context);
        shutdownManager.registerJvmShutdownHook();

        SwingUtilities.invokeLater(() -> {
            new AppWindowController(context, shutdownManager)
                    .createAndShowWindow();
        });
    }
}
