The demo application#
kinetis/vector-demo is a complete Kinetis application administered by
Vector, published as a Composer project of its own. It installs
kinetis/vector and kinetis/vector-ai from Packagist and the admin UI
from npm, at exactly the versions released beside it, and runs in
Docker.
What the demo contains#
Two domains on two databases. A shop on MySQL (customers, orders, products, categories, tags) and a support desk on PostgreSQL (teams, agents, tickets, replies, labels); Vector’s own tables sit on a third connection (Databases).
Resources for every field type.
backend/src/Vector/declares them, with their actions, widgets, dashboards and settings groups (Resources, Fields, Actions, Dashboards and widgets, Settings).Lists in every shape. Tickets have a calendar and a board; orders list without a count and order lines page by cursor (Lists).
Background jobs on a real queue. Large exports, imports and queued actions run on the
workerservice, with Redis as the queue (Background jobs).The queue dashboard. At
/queuesin either admin (Queue dashboard). To give it failed jobs and metrics, rundocker compose exec app vendor/bin/kinetis demo:queue-flaky.The audit page. At
/auditin either admin (Audit trail and impersonation).Both sign-ins. The JWT API under
/auth/*for the decoupled admin, and the session form at/loginfor the hosted one (Authentication).UI extensions and translations.
backend/public/vector-extensions/adds a stock-level cell and a “Stock overview” page (Customizing the UI);backend/translations/translates labels (Languages).AI on a scripted provider.
kinetis/vector-airuns on afakeprovider that needs no model (AI). To use a real model, or none, changeVECTOR_AI_PROVIDERSinbackend/.env(Setup). Things to try:On the Orders list, type paid orders over 500 (Plain-language filters).
On the Products list, open the assistant with the sparkle button and ask Which products are low on stock? (The assistant).
Turn Assistant may propose changes on in the AI settings, then ask Set the stock of products#9 to 42. (Changes the assistant proposes).
In an order’s notes, choose Shorten under Writing help (Writing help).
Select orders and run Propose AI rewrites of Notes (Bulk rewrite proposals).
FrankenPHP worker mode. The same application on a second port, under Kinetis’s primary runtime (below).
An AI coding agent setup.
AGENTS.mdand the MCP configuration for building on the demo (AI coding agents).
Run it#
Docker is the only requirement.
Create the project and its environment file:
docker run --rm -v "$PWD":/app -w /app composer:2.11 \ create-project --no-install kinetis/vector-demo vector cd vector cp backend/.env.example backend/.env
Set
JWT_SECRETinbackend/.envto at least 32 bytes, for example the output ofopenssl rand -hex 32. Without it, every request fails.Start the stack, then create and seed the databases:
docker compose up --build -d docker compose exec app vendor/bin/kinetis migrate docker compose exec --user www-data app vendor/bin/kinetis demo:seed
Then pick a frontend. Both sign in as admin@vector.local with the
password password.
The decoupled admin. Open
http://localhost:3000. There is nothing more to run; its first start installs its packages, so give it a minute.The hosted admin. Install the bundle and restart the PHP services, then open
http://localhost:8080/vector/ui:docker compose exec app vendor/bin/kinetis vector:install-ui docker compose restart app frankenphp
What runs#
Service |
Address |
What it is |
|---|---|---|
|
|
The application under nginx and PHP-FPM, the hosted admin at |
|
|
The same application under FrankenPHP worker mode. |
|
|
The decoupled admin: |
|
none |
|
|
none |
Every hour, |
|
|
The shop. |
|
|
|
|
|
The job queue and, in database 1, the cache. |
The databases publish on loopback only. Uploaded files live on the
private storage volume, never served by nginx or Caddy.
A PHP change applies on the next request on :8080, and the decoupled
admin hot-reloads. :8081 keeps the code each worker booted with, so
run docker compose restart frankenphp after editing PHP. PHP errors go
to the log, not into responses: docker compose logs -f app or
docker compose logs -f frankenphp.
To start again from empty databases (for example when migrate
refuses a migration whose file changed after it ran):
docker compose down -v
docker compose up --build -d
docker compose exec app vendor/bin/kinetis migrate
docker compose exec --user www-data app vendor/bin/kinetis demo:seed
Seed data#
demo:seed fills the demo tables. Run it as www-data, the user the
application runs as, since it stores product images as an upload would.
--freshempties the tables first, restarting identifiers at 1, and clears what Vector recorded: the audit trail, the action log, saved views, jobs and their notifications, AI approvals, rewrites and usage, and the queue metrics. Settings, preferences and stored AI keys stay.--scale=Nmultiplies the row counts, from 1 to 100.
Account |
Password |
Signs in as |
|---|---|---|
|
|
An admin. |
|
|
A user without admin access: refused by the admin. |
|
|
The end-to-end suite’s own admin. |
FrankenPHP worker mode#
frankenphp runs the same public/index.php as PHP-FPM, but each
worker thread boots the application once and serves request after
request. DB_DRIVER=auto selects the native non-blocking MySQL and
PostgreSQL clients there. Both PHP images are built from
docker/Dockerfile with the same extension recipe,
docker/php-extensions.sh, which installs ext-uv and ext-event so the
event loop never falls back to select().
bin/check-frankenphp
bin/benchmark
bin/check-frankenphp checks the worker script, that both runtimes load
the same extensions, worker mode, the native drivers and request
isolation, and exits nonzero when a check fails. bin/benchmark reports
latency, throughput and statements per request on both runtimes; run it
with nothing else using the stack. The check reads
GET /_demo/runtime, which answers only under APP_ENV=development
and is a plain 404 otherwise.
Each worker thread builds its own pool per database connection, sized in
docker-compose.yml:
Connection |
Database |
Per thread |
12 threads |
|---|---|---|---|
|
MySQL |
|
48 |
|
PostgreSQL |
|
24 |
|
PostgreSQL |
|
24 |
MySQL,
max_connections= 151: 48 for FrankenPHP, 5 for PHP-FPM and 1 for the queue worker leave 97 for the CLI and the tests.PostgreSQL,
max_connections= 100: 48 for FrankenPHP, 10 for PHP-FPM and 2 for the queue worker leave 40.
DB_WARM_CONNECTIONS=4 opens each thread’s MySQL pool at boot, so its
descriptors stay below 1024, the limit of the select() mysqli waits
through. When you raise FRANKENPHP_WORKERS or a pool width, redo both
sums.
See also#
Getting started: Vector in your own application.
Using the admin: the admin from a user’s side.
AI coding agents: building on the demo with an AI coding agent.