Skip to content

Commit c7582b8

Browse files
authored
Merge pull request #311 from iMattPro/webui
Add Browser UI
2 parents 7690fd4 + 25ccfa5 commit c7582b8

54 files changed

Lines changed: 5538 additions & 249 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/CONTRIBUTING.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,31 @@ $ tests/vendor/bin/phpunit -c phpunit.xml.dist
5050

5151
The CLI test dependencies install into `tests/vendor/`, leaving the main application `vendor/` directory unchanged.
5252

53+
On Windows PowerShell, set the Composer config and run the same suite with:
54+
55+
```powershell
56+
Set-Location tests
57+
$env:COMPOSER = 'composer.cli-tests.json'
58+
composer install
59+
Set-Location ..
60+
php tests/vendor/bin/phpunit -c phpunit.xml.dist
61+
```
62+
63+
CLI or Dashboard UI changes must remain compatible with macOS, Linux, and native Windows. Before submitting such changes, run:
64+
65+
```bash
66+
php bin/qi doctor
67+
php bin/qi help
68+
```
69+
70+
On Windows, also smoke-test the supplied launcher from PowerShell or Command Prompt:
71+
72+
```powershell
73+
.\bin\qi.cmd help
74+
```
75+
76+
Windows-specific changes should cover drive-letter paths, paths containing spaces, Command Prompt and PowerShell execution, and the `ui:start`/`ui:status`/`ui:stop` lifecycle. GitHub Actions runs the PHPUnit suite and launcher smoke test on native Windows.
77+
5378
## :computer: Make something great
5479

5580
1. Create a new branch in your repository before doing any work. It should be based off the `develop` branch:

‎.github/workflows/cli-tests.yml‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,38 @@ jobs:
3737

3838
- name: Lint CLI entrypoint
3939
run: php -l bin/qi
40+
41+
windows:
42+
name: Windows PHP 8.3
43+
runs-on: windows-latest
44+
45+
steps:
46+
- name: Checkout
47+
uses: actions/checkout@v6
48+
49+
- name: Setup PHP
50+
uses: shivammathur/setup-php@v2
51+
with:
52+
php-version: '8.3'
53+
coverage: none
54+
55+
- name: Validate test Composer config
56+
working-directory: tests
57+
env:
58+
COMPOSER: composer.cli-tests.json
59+
run: composer validate --no-check-publish --strict
60+
61+
- name: Install test dependencies
62+
working-directory: tests
63+
env:
64+
COMPOSER: composer.cli-tests.json
65+
run: composer install --no-interaction --prefer-dist
66+
67+
- name: Run PHPUnit
68+
timeout-minutes: 10
69+
shell: cmd
70+
run: php tests/vendor/bin/phpunit -c phpunit.xml.dist
71+
72+
- name: Smoke test CMD launcher
73+
shell: cmd
74+
run: bin\qi.cmd help

‎README.md‎

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ QuickInstall is a tool we built to support the community of phpBB extension deve
3939
##### Browsers
4040
QuickInstall is designed to run on all modern browsers. Please don't use old stuff anymore...seriously.
4141

42-
| | | | | | |
43-
|-|-|-|-|-|-|
44-
| Desktop: | ![Chrome](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/69.0.4/chrome/chrome_32x32.png) 60+ | ![Firefox](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/69.0.4/firefox/firefox_32x32.png) 60+ | ![Safari](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/69.0.4/safari/safari_32x32.png) 12+ | ![Edge](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/69.0.4/edge/edge_32x32.png) 80+ | ![Opera](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/69.0.4/opera/opera_32x32.png) 40+ |
45-
| Mobile: | ![iOS](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/69.0.4/safari-ios/safari-ios_32x32.png) 12+ | ![Android](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/69.0.4/android-webview/android-webview_32x32.png) 6+ | | | |
42+
| | | | | | |
43+
|----------|---------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|
44+
| Desktop: | ![Chrome](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/69.0.4/chrome/chrome_32x32.png) 60+ | ![Firefox](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/69.0.4/firefox/firefox_32x32.png) 60+ | ![Safari](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/69.0.4/safari/safari_32x32.png) 12+ | ![Edge](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/69.0.4/edge/edge_32x32.png) 80+ | ![Opera](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/69.0.4/opera/opera_32x32.png) 40+ |
45+
| Mobile: | ![iOS](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/69.0.4/safari-ios/safari-ios_32x32.png) 12+ | ![Android](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/69.0.4/android-webview/android-webview_32x32.png) 6+ | | | |
4646

4747
##### phpBB Requirements
4848
phpBB boards require a web server running PHP and one of the following database management systems.
@@ -59,26 +59,29 @@ phpBB boards require a web server running PHP and one of the following database
5959

6060
## QuickInstall CLI
6161

62-
QuickInstall now includes a Docker-based CLI for creating local phpBB test boards. It writes generated state to `.qi/` and leaves the legacy web UI unchanged. The QuickInstall CLI requires PHP 8.0 or newer for the `php bin/qi` command.
62+
QuickInstall now includes a cross-platform, Docker-based CLI and local Dashboard UI for creating phpBB test boards. They work on macOS, Linux, and native Windows and write generated state to `.qi/` without changing the legacy web application.
63+
64+
Requirements:
65+
66+
- Docker Desktop, installed and running
67+
- PHP 8.0 or newer for the CLI command
68+
- Git when using Git sources
69+
70+
Create your first new board:
6371

6472
```bash
65-
php bin/qi init
6673
php bin/qi board:create test --phpbb 3.3 --db mariadb --port 8081 --populate extension-dev
6774
```
6875

6976
The QuickInstall CLI targets phpBB 3.2+ installer-based boards. phpBB 3.0/3.1 remain legacy-web-app territory and are not planned for the QuickInstall CLI.
7077

71-
Downloaded extensions can be unzipped into `customisations/` and mounted into boards:
78+
If you prefer a browser workflow, start the QuickInstall Dashboard UI:
7279

7380
```bash
74-
php bin/qi ext:mount test customisations/vendor/extname
81+
php bin/qi ui:start
7582
```
7683

77-
Downloaded styles can be unzipped into `customisations/` and mounted into boards:
78-
79-
```bash
80-
php bin/qi style:mount test customisations/stylename
81-
```
84+
The examples use `php bin/qi`, which works on every supported operating system when PHP is in `PATH`. Windows users can alternatively use `.\bin\qi.cmd` from either Command Prompt or PowerShell.
8285

8386
See the complete [QuickInstall CLI docs](docs/sandbox-cli.md).
8487

‎bin/qi‎

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,8 @@ if (PHP_VERSION_ID < 80000)
88
exit(1);
99
}
1010

11+
require __DIR__ . '/../src/QuickInstall/Sandbox/bootstrap.php';
1112
require __DIR__ . '/../src/QuickInstall/Sandbox/Application.php';
12-
require __DIR__ . '/../src/QuickInstall/Sandbox/Output.php';
13-
require __DIR__ . '/../src/QuickInstall/Sandbox/StreamOutput.php';
14-
require __DIR__ . '/../src/QuickInstall/Sandbox/BufferedOutput.php';
15-
require __DIR__ . '/../src/QuickInstall/Sandbox/ProcessRunner.php';
16-
require __DIR__ . '/../src/QuickInstall/Sandbox/CommandLine.php';
17-
require __DIR__ . '/../src/QuickInstall/Sandbox/Project.php';
18-
require __DIR__ . '/../src/QuickInstall/Sandbox/VersionMatrix.php';
19-
require __DIR__ . '/../src/QuickInstall/Sandbox/SourceProvider.php';
20-
require __DIR__ . '/../src/QuickInstall/Sandbox/SourceService.php';
21-
require __DIR__ . '/../src/QuickInstall/Sandbox/BoardService.php';
22-
require __DIR__ . '/../src/QuickInstall/Sandbox/DockerComposeWriter.php';
23-
require __DIR__ . '/../src/QuickInstall/Sandbox/BoardRunner.php';
24-
require __DIR__ . '/../src/QuickInstall/Sandbox/SeederWriter.php';
25-
require __DIR__ . '/../src/QuickInstall/Sandbox/ExtensionManager.php';
26-
require __DIR__ . '/../src/QuickInstall/Sandbox/StyleManager.php';
2713

2814
use QuickInstall\Sandbox\Application;
2915

‎bin/qi.cmd‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@echo off
2+
where php >nul 2>&1
3+
if errorlevel 1 (
4+
echo QuickInstall requires PHP 8.0 or newer. 1>&2
5+
echo Install PHP, add php.exe to PATH, then reopen your terminal. 1>&2
6+
exit /b 1
7+
)
8+
php "%~dp0qi" %*
9+
exit /b %ERRORLEVEL%

‎build.xml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
<delete file="${dir}/.gitattributes" />
3333
<delete file="${dir}/build.xml" />
3434
<delete file="${dir}/composer.lock" />
35-
<delete file="${dir}/composer.phar" />
3635
<delete file="${dir}/package.json" />
3736
<delete file="${dir}/package-lock.json" />
3837
<delete file="${dir}/phpunit.xml.dist" />

‎docs/sandbox-cli.md‎

Lines changed: 155 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,44 @@ If you ever need help with commands, run:
4848
php bin/qi help
4949
```
5050

51+
If you prefer a browser workflow, start the QuickInstall Dashboard UI:
52+
53+
```bash
54+
php bin/qi ui:start
55+
```
56+
57+
Then open the URL printed by the command:
58+
59+
```text
60+
http://127.0.0.1:8079/
61+
```
62+
63+
## Commands by OS
64+
65+
The examples in this guide use the portable command form:
66+
67+
```bash
68+
php bin/qi <command>
69+
```
70+
71+
It works on macOS, Linux, and Windows when PHP is available in `PATH`.
72+
73+
Windows also includes a `qi.cmd` launcher. From PowerShell:
74+
75+
```powershell
76+
.\bin\qi.cmd <command>
77+
```
78+
79+
From Command Prompt:
80+
81+
```batch
82+
bin\qi.cmd <command>
83+
```
84+
85+
Arguments and options are identical with every launcher. Run commands from the QuickInstall project root. Windows drive-letter paths, UNC paths, backslashes, spaces, and case-insensitive filesystem paths are supported.
86+
87+
Docker Desktop on Windows must use its WSL 2 or Hyper-V Linux-container backend rather than Windows containers.
88+
5189
## Common Recipes
5290

5391
Create a small empty board:
@@ -207,6 +245,12 @@ By default, extension sources must live under `customisations/`. To mount a trus
207245
php bin/qi ext:mount demo /path/to/vendor/extname --allow-external
208246
```
209247

248+
On Windows, quote external paths containing spaces:
249+
250+
```powershell
251+
.\bin\qi.cmd ext:mount demo "C:\Path\To\My Extensions\vendor\extname" --allow-external
252+
```
253+
210254
## Styles
211255

212256
Put downloaded styles under `customisations/`:
@@ -254,6 +298,12 @@ By default, style sources must live under `customisations/`. To mount a trusted
254298
php bin/qi style:mount demo /path/to/stylename --allow-external
255299
```
256300

301+
On Windows, quote external paths containing spaces:
302+
303+
```powershell
304+
.\bin\qi.cmd style:mount demo "C:\Path\To\My Styles\stylename" --allow-external
305+
```
306+
257307
## Supported phpBB Versions
258308

259309
Show supported selectors:
@@ -331,16 +381,63 @@ Fetched sources live under:
331381
.qi/sources/phpbb-<source>
332382
```
333383

384+
## Dashboard UI
385+
386+
The QuickInstall Dashboard UI provides a local browser interface for the same workflows exposed by the CLI. It is served by PHP's built-in web server and backed by the same `.qi/` workspace. The Dashboard UI can be started, checked, restarted, and stopped on macOS, Linux, or native Windows.
387+
388+
Start the UI:
389+
390+
```bash
391+
php bin/qi ui:start
392+
```
393+
394+
The default URL is:
395+
396+
```text
397+
http://127.0.0.1:8079/
398+
```
399+
400+
Use a different local port:
401+
402+
```bash
403+
php bin/qi ui:start --port 8088
404+
```
405+
406+
Check or stop the tracked Dashboard UI server:
407+
408+
```bash
409+
php bin/qi ui:status
410+
php bin/qi ui:stop
411+
```
412+
413+
Restart it:
414+
415+
```bash
416+
php bin/qi ui:restart
417+
```
418+
419+
Supported Dashboard UI server hosts are loopback-only:
420+
421+
```bash
422+
php bin/qi ui:start --host 127.0.0.1
423+
php bin/qi ui:start --host localhost
424+
php bin/qi ui:start --host ::1
425+
```
426+
334427
## Where Files Go
335428

336429
Generated state:
337430

338-
| Path | Contents |
339-
|------------------------|----------------------------------------------|
340-
| `.qi/boards/<name>` | Installed phpBB board files |
341-
| `.qi/runtime/<name>` | Docker Compose, Dockerfile, installer config |
342-
| `.qi/db/<name>` | Database files |
343-
| `.qi/sources/<source>` | Downloaded phpBB source |
431+
| Path | Contents |
432+
|--------------------------|----------------------------------------------|
433+
| `.qi/boards/<name>` | Installed phpBB board files |
434+
| `.qi/runtime/<name>` | Docker Compose, Dockerfile, installer config |
435+
| `.qi/db/<name>` | Database files |
436+
| `.qi/sources/<source>` | Downloaded phpBB source |
437+
| `.qi/runtime/ui.json` | Tracked Dashboard UI server state |
438+
| `.qi/runtime/ui.log` | Dashboard UI server output log |
439+
| `.qi/runtime/ui.log.err` | Windows Dashboard UI server error log |
440+
| `.qi/cache/` | Cached update-check metadata |
344441

345442
User-managed drop zone:
346443

@@ -355,13 +452,42 @@ customisations/
355452
- `board:create` rejects ports already registered to another board or already in use on the host.
356453
- `ext:mount` and `style:mount` only use `customisations/` unless `--allow-external` is used.
357454
- Custom Git source URLs require `--allow-external`; only use trusted forks.
455+
- The Dashboard UI server only accepts loopback hosts (`127.0.0.1`, `localhost`, or `::1`) and rejects non-local requests.
456+
- `ui:start` refuses ports already in use on the selected loopback host.
457+
- Dashboard UI form submissions use CSRF tokens and only accept local origins or referrers.
358458

359459
## Troubleshooting
360460

461+
If QuickInstall starts but a command is not working as expected, run the environment check from the project root:
462+
463+
```bash
464+
php bin/qi doctor
465+
```
466+
467+
On Windows PowerShell, you can use the Windows launcher instead:
468+
469+
```powershell
470+
.\bin\qi.cmd doctor
471+
```
472+
473+
Every check should report `OK`; failures identify the missing or unavailable requirement.
474+
475+
#### QuickInstall does not start on Windows
476+
477+
First, check whether PHP is available:
478+
479+
```powershell
480+
php --version
481+
```
482+
483+
If Windows does not recognize `php`, install PHP 8 or newer and add the directory containing `php.exe` to the Windows `PATH`. Open a new terminal, confirm `php --version` works, then run `.\bin\qi.cmd doctor` again.
484+
361485
#### Docker command fails
362486

363487
Check that Docker Desktop is running and that the docker command works in this terminal.
364488

489+
On Windows, also confirm Docker Desktop is using Linux containers. `php bin/qi doctor` reports `Linux containers: OK` when configured correctly.
490+
365491
#### Composer command fails
366492

367493
QuickInstall uses composer from PATH first, then `composer.phar` from the project root. Restore `composer.phar` or install Composer if both are missing.
@@ -383,3 +509,26 @@ Use this when a board's files, database, or generated Docker runtime are no long
383509
php bin/qi board:destroy demo
384510
php bin/qi board:create demo --phpbb 3.3 --db mariadb --port 8081 --populate none
385511
```
512+
513+
#### Dashboard UI will not start
514+
515+
Check the tracked status:
516+
517+
```bash
518+
php bin/qi ui:status
519+
```
520+
521+
If the status is stale, clear the old state and start again:
522+
523+
```bash
524+
php bin/qi ui:stop
525+
php bin/qi ui:start
526+
```
527+
528+
If the selected port is already in use, choose a different local port:
529+
530+
```bash
531+
php bin/qi ui:start --port 8088
532+
```
533+
534+
The Dashboard UI server output log is written to `.qi/runtime/ui.log`. On Windows, PHP server errors are written to `.qi/runtime/ui.log.err`.

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"license": "GPL-2.0-only",
3+
"private": true,
34
"dependencies": {
45
"autoprefixer": "^10.4.2",
56
"bootstrap": "5.1.3",

0 commit comments

Comments
 (0)