Skip to content

About

Portable Laravel local development engine for Windows using Rust, FrankenPHP, and a React console.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

26 Commits

Folders and files

Repository files navigation

HarborPHP

A portable, native Laravel local development engine and runtime orchestrator for Windows written in Rust, with an embedded React Web UI.

License: MIT Rust Platform

Features

  • Portable & Zero Host Pollution: All runtimes, binaries, configs, and logs live inside ~/.harborphp/. No global PHP installation, WSL2 VM, or heavy background Windows services.
  • Native FrankenPHP Runtimes: Download and switch between multiple FrankenPHP Windows versions per project. Each project runs on its own configurable localhost port (127.0.0.1:<port>).
  • Win32 Process Isolation: Spawns child runtimes and workers inside a Windows Job Object (JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE), so exiting or crashing HarborPHP leaves zero orphan processes.
  • Built-in Worker Supervisor: Start, stop, and auto-restart php artisan queue:work and php artisan schedule:work per project.
  • Embedded Web Console (127.0.0.1:9090):
    • Grouped project tree table (Office → CMS, WEB) with live CPU/RAM telemetry.
    • Built-in PHP extension checkboxes (pdo_mysql, pgsql, gd, intl, mbstring, etc.) generating per-project php.ini.
    • Real-time log viewer supporting both laravel.log and daily logs (laravel-YYYY-MM-DD.log), plus proxy and worker logs.
    • Streaming artisan and composer command runner.
    • Native Windows folder picker when registering projects.
  • CLI & System Tray: Run harbor php, harbor composer, and harbor artisan from any project directory, and manage the daemon from the Windows System Tray.
  • Localhost Security: Strict 127.0.0.1 bind, Host/Origin validation, and auto-generated session token to guard local execution APIs against CSRF/DNS rebinding.

Prerequisites & Quick Start

Option 1: Windows Installer Wizard (Recommended)

  1. Download HarborPHP-Setup-<version>.exe from the GitHub Releases page.
  2. Run the setup wizard (no Administrator privileges required; installs per-user and optionally adds harbor to your PATH).
  3. Launch HarborPHP from the Start Menu or run:
harbor up

Option 2: Build from Source

Requires Rust (stable) and Node.js 24+.

git clone https://github.com/andrraa/harbor-php.git
cd harbor-php

# 1. Build the embedded React UI
cd ui
npm install
npm run build
cd ..

# 2. Install `harbor.exe` to %USERPROFILE%\.cargo\bin
cargo install --path .

# 3. Start the daemon & open the dashboard
harbor up

Open the authenticated URL printed in the terminal (or right-click the HarborPHP icon in the Windows System Tray → Open Dashboard).

Usage & Configuration

  1. Open Runtime Hub in the Web UI and click Install / Update Caddy & Composer, then download a FrankenPHP release.
  2. Click New Project, pick your Laravel folder using Browse, assign an optional group and port, and click Start.
  3. Run project-scoped CLI commands directly in your terminal:
cd E:\Projects\my-laravel-app
harbor php -v
harbor composer install
harbor artisan migrate

Configuration is stored in ~/.harborphp/config.toml:

Key Default Description
dashboard_port 9090 Localhost port for the embedded Web UI (127.0.0.1).
auth_token (auto-generated) 48-character hex token used to authenticate dashboard sessions.
projects[].port 8001+ Direct HTTP port served by that project's FrankenPHP instance.
projects[].group "" Optional tree group name displayed in the Projects table.
projects[].php_version (selected) Installed FrankenPHP runtime directory name under ~/.harborphp/runtimes/frankenphp/.
Directory Structure & CLI Reference

Portable Directory Layout

~/.harborphp/
├── config.toml                  # Engine settings & registered projects
├── bin/                         # caddy.exe, composer.phar, php.exe shim
├── runtimes/
│   └── frankenphp/
│       └── <version>/           # Extracted FrankenPHP Windows runtime + ext/
├── configs/
│   └── projects/<id>/           # Generated php.ini & per-project Caddyfile
└── logs/                        # Per-project HTTP & worker logs

CLI Commands

  • harbor init — Initialize ~/.harborphp/ and default config.toml.
  • harbor up — Start the daemon, System Tray icon, and Web UI.
  • harbor php [args...] — Run frankenphp php-cli using the active project's runtime and php.ini.
  • harbor composer [args...] — Run portable Composer using the active project's runtime.
  • harbor artisan [args...] — Shortcut for harbor php artisan ....
  • harbor project list / harbor project add <path> --group Office --port 8001 --php 1.4.4
  • harbor runtime list / harbor runtime install <version> / harbor runtime install-tools
Building Releases & Windows Installer Locally

Automated GitHub Releases

Pushing a version tag triggers .github/workflows/release.yml on windows-latest, which builds the UI, runs tests, packages a portable ZIP, compiles the Inno Setup .exe wizard installer, and publishes a GitHub Release with SHA256SUMS.txt:

git tag v0.1.0
git push origin v0.1.0

Local Release Build

Install Inno Setup 6 (winget install JRSoftware.InnoSetup) and run:

.\scripts\build-release.ps1 -Version 0.1.0

Artifacts are written to dist-release/:

  • HarborPHP-Setup-0.1.0.exe — Windows setup wizard (per-user install, optional PATH & Desktop shortcut, uninstaller).
  • harborphp-windows-x86_64-0.1.0.zip — Portable archive.

Development & Testing

# Frontend type-check & production bundle
cd ui
npm run build
cd ..

# Rust unit & integration tests (includes Win32 Job Object & security middleware tests)
cargo test

Contributing

Issues and pull requests are welcome. Please keep changes focused, run npm run build (in ui/) and cargo test before opening a PR, and follow Conventional Commits (feat:, fix:, chore:, docs:).

License

This project is licensed under the MIT License. See LICENSE for details.

About

Portable Laravel local development engine for Windows using Rust, FrankenPHP, and a React console.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages