Repository navigation
[TestApplication] Make the test application run on SQLite - #417
Merged
Merged
Conversation
loic425
force-pushed
the
feature/test-app-sqlite
branch
from
November 24, 2026 15:16
60dad56 to
0155d7b
Compare
loic425
added a commit
to loic425/SyliusStack
that referenced
this pull request
Nov 25, 2026
The test application runs on SQLite since Sylius#417: with lyrixx/php-wasm-builder, PHP compiled to WebAssembly runs it in a service worker, so the demo can be served by GitHub Pages, with no PHP server. - wasm-demo/castor.php prepares the application (fixtures in a SQLite database, no dev dependencies, compiled assets and local icons) and builds PHP with it, with ShadcnAdminUi and the rose theme by default. - wasm-demo/check.mjs logs in and checks every page of the admin panel in PHP WebAssembly, in node. - The Demo workflow builds, checks and deploys it to GitHub Pages.
loic425
added a commit
to loic425/SyliusStack
that referenced
this pull request
Nov 25, 2026
The test application runs on SQLite since Sylius#417: with lyrixx/php-wasm-builder, PHP compiled to WebAssembly runs it in a service worker, so the demo can be served by GitHub Pages, with no PHP server. - wasm-demo/castor.php prepares the application (fixtures in a SQLite database, no dev dependencies, compiled assets and local icons) and builds PHP with it, with ShadcnAdminUi and the rose theme by default. - wasm-demo/check.mjs logs in and checks every page of the admin panel in PHP WebAssembly, in node. - The Demo workflow builds, checks and deploys it to GitHub Pages.
loic425
added a commit
that referenced
this pull request
Nov 25, 2026
…420) Trying the Stack today means cloning the monorepo and running a database and a PHP server. Since #417 the test application runs on SQLite, so PHP compiled to WebAssembly ([lyrixx/php-wasm-builder](https://github.com/lyrixx/php-wasm-builder)) can run it in a service worker: the demo becomes a static site on GitHub Pages, with no PHP server. Live on my fork: https://loic425.github.io/SyliusStack/ (`admin@example.com` / `admin`) 1. **A demo anyone can open**: `wasm-demo/castor.php` builds the application in prod without dev dependencies, with the fixtures in a SQLite database and ShadcnAdminUi with the rose theme (`--ui` and `--theme` change them). Data lives in the browser (IndexedDB) and is reset at each deploy. 2. **PHP has no network in the browser**: it cannot fetch icons from Iconify nor serve files, so icons are imported at build time and assets and avatars are served by Pages, under its base path (`/Stack/`). 3. **A broken page must not be deployed**: `castor demo:check` logs in and follows every link of the admin panel in PHP WebAssembly under node (61 pages). The workflow only deploys when it passes. 4. **The home page was empty**: `/` now redirects to the dashboard, for the dev application too. The login page also shows the test credentials, as on demo.sylius.com. ```bash cd wasm-demo && castor demo:build && castor demo:serve ``` **Before merging**: a maintainer needs to set Settings › Pages › Source to "GitHub Actions". The demo is then deployed on each push to `main` at https://sylius.github.io/Stack/ (~10 min the first time, ~4 min with the cache). **BC**: none, only the `/` route of the test application changes; the packages are untouched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We may run the demo with PHP WASM, where SQLite is the only realistic database. The test application already almost works on SQLite: schema, fixtures and the whole PHPUnit suite pass. One thing was fragile, and nothing prevents it from regressing.
DAY(),MONTH()andYEAR()DQL functions (dashboard statistics) generatedSTRFTIME("%d", ...)for SQLite. Double quotes are identifiers in SQL: it only works thanks to SQLite's legacy "double-quoted string" fallback, and fails withno such column: "%d"when SQLite is compiled withSQLITE_DQS=0, which a WASM build may well be. They now use single quotes and cast toINTEGERinstead of the non-standardNUMBER.sqliteCI job runs the test application suite on SQLite (PHP 8.4 / Symfony ^7.4).To run it locally:
DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db" bin/console doctrine:schema:create(
doctrine:database:createis not supported by DBAL 4 on SQLite, the file is created on first connection.)No BC break: only the test application and CI are touched.