kusowl/nativephp-desktop-maryui-starter-kit

A Starter Kit for Laravel NativePHP Desktop with MaryUI

Maintainers

Package info

gitlab.com/kushowl/nativephp-desktop-maryui-starter-kit

Issues

Type:project

pkg:composer/kusowl/nativephp-desktop-maryui-starter-kit

Transparency log

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

dev-main 2026-08-30 11:10 UTC

This package is not auto-updated.

Last update: 2026-08-30 15:14:42 UTC


README

A lightweight, modern starter kit for building cross-platform desktop applications using Laravel, NativePHP Desktop, Livewire, MaryUI, and Tailwind CSS.

Motive and Purpose

This starter kit bridges that hastle of setting up a Laravel application with NativePHP Desktop, with Livewire and MaryUI:

  • Full-Stack PHP for Desktop: Build native desktop applications on macOS, Windows, and Linux using familiar Laravel patterns, routing, Eloquent ORM, and SQLite database storage.
  • Reactive UI Without Client Frameworks: Utilize Livewire and MaryUI to build reactive, accessible, and polished user interfaces entirely with PHP and Blade templates.
  • Modern Styling Out of the Box: Styled with Tailwind CSS v4 and DaisyUI v5, providing responsive layout shells, drawers, modals, tables, toasts, and dark/light themes.
  • Native OS Integrations: Seamlessly leverage NativePHP APIs for window management, system notifications, menu bars, tray icons, global shortcuts, clipboard access, and auto-updating.
  • Preconfigured Developer Experience: Out-of-the-box support for Vite asset bundling, Pest testing, Larastan static analysis, and Laravel Pint code formatting.

Tech Stack

TechnologyPurpose
Laravel 13Backend application framework
NativePHP Desktop (v2)Desktop shell and native OS bridge running on Electron
Livewire (v4) & BlazeReactive full-stack Blade components
MaryUI (v2)UI component library for Livewire and DaisyUI
Tailwind CSS (v4) & DaisyUI (v5)Utility-first CSS and component design system
ViteFast frontend build tool and hot module replacement
Pest PHP (v5)Elegant PHP testing framework
Larastan / PHPStanStatic analysis and type checking
Laravel PintCode style linter and formatter

Prerequisites

  • PHP: 8.3 or higher (with SQLite, PDO, cURL, OpenSSL, and MBString extensions)
  • Composer: 2.x or higher
  • Node.js: 20.x or higher
  • NPM: 10.x or higher

Quick Start

1. Clone the Repository

git clone <repository-url> native-desktop-app
cd native-desktop-app

2. Automated Setup

Run the comprehensive setup script to install dependencies, generate environment keys, run migrations, and compile initial assets:

composer run setup

Alternatively, perform manual setup:

# Install PHP dependencies
composer install

# Setup environment
cp .env.example .env
php artisan key:generate

# Run database migrations
touch database/database.sqlite
php artisan migrate --force

# Install and build frontend assets
npm install
npm run build

Development

Running the Desktop Application

To launch the NativePHP desktop window along with Vite for hot-reloading:

composer run native:dev

This concurrently runs:

  • php artisan native:run --no-interaction
  • npm run dev

Running the Web Interface Only

If you wish to test or debug in a standard web browser:

composer run dev

Project Structure

├── app/
│   ├── Providers/
│   │   ├── AppServiceProvider.php       # Core application defaults
│   │   └── NativeAppServiceProvider.php # Native window setup & php.ini configuration
│   └── Models/                          # Eloquent models
├── config/
│   └── nativephp.php                    # NativePHP desktop settings, update providers, updater config
├── database/
│   └── database.sqlite                  # Embedded SQLite database
├── resources/
│   ├── css/app.css                      # Tailwind v4 & DaisyUI configuration
│   ├── js/app.js                        # Frontend scripts
│   └── views/
│       ├── layouts/app.blade.php        # MaryUI desktop layout shell (nav, drawer, toast, sidebar)
│       └── pages/users/index.blade.php  # Livewire MaryUI user management demo component
├── routes/
│   ├── console.php                      # Artisan command schedules
│   └── web.php                          # Livewire routes
└── tests/                               # Pest feature and unit test suite

Desktop Configuration and Packaging

Configuring Native Windows

Manage your native window properties inside app/Providers/NativeAppServiceProvider.php:

namespace App\Providers;

use Native\Desktop\Contracts\ProvidesPhpIni;
use Native\Desktop\Facades\Window;

class NativeAppServiceProvider implements ProvidesPhpIni
{
    public function boot(): void
    {
        Window::open()
            ->title('Desktop App')
            ->width(1200)
            ->height(800)
            ->minWidth(800)
            ->minHeight(600)
            ->showDevTools(app()->isLocal());
    }

    public function phpIni(): array
    {
        return [
            'memory_limit' => '512M',
        ];
    }
}

Building Production Installers

To compile and package native installers for your operating system (e.g., .dmg for macOS, .exe/.msi for Windows, .AppImage/.deb/.rpm for Linux):

php artisan native:build

Code Quality and Testing

Run test suites and code health checks using the configured Composer scripts:

# Run full verification suite (lint check, static analysis, and Pest tests)
composer run test

# Format PHP code with Laravel Pint
composer run lint

# Check PHP formatting without applying changes
composer run lint:check

# Run Larastan static analysis
composer run types:check

Attributions and Repositories

This starter kit is built upon and acknowledges the following open-source projects and libraries:

Core Frameworks and Libraries

Electron Plugin and Vendored Libraries

  • Electron Positioner: jenslind/electron-positioner — Window positioning helper for Electron. Vendored in nativephp/electron/electron-plugin/src/libs/positioner.
  • Menubar: maxogden/menubar — High-level menubar wrapper for Electron. Vendored in nativephp/electron/electron-plugin/src/libs/menubar.

Developer Tooling and Quality Assurance

License

This starter kit is open-sourced software licensed under the MIT license.