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 worker service, with Redis as the queue (Background jobs).

  • The queue dashboard. At /queues in either admin (Queue dashboard). To give it failed jobs and metrics, run docker compose exec app vendor/bin/kinetis demo:queue-flaky.

  • The audit page. At /audit in either admin (Audit trail and impersonation).

  • Both sign-ins. The JWT API under /auth/* for the decoupled admin, and the session form at /login for 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-ai runs on a fake provider that needs no model (AI). To use a real model, or none, change VECTOR_AI_PROVIDERS in backend/.env (Setup). Things to try:

  • FrankenPHP worker mode. The same application on a second port, under Kinetis’s primary runtime (below).

  • An AI coding agent setup. AGENTS.md and the MCP configuration for building on the demo (AI coding agents).

Run it#

Docker is the only requirement.

  1. 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
    
  2. Set JWT_SECRET in backend/.env to at least 32 bytes, for example the output of openssl rand -hex 32. Without it, every request fails.

  3. 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

nginx, app

localhost:8080

The application under nginx and PHP-FPM, the hosted admin at /vector/ui, and /openapi in development. NGINX_HOST_PORT moves it when 8080 is taken.

frankenphp

localhost:8081

The same application under FrankenPHP worker mode.

node

localhost:3000

The decoupled admin: nuxt dev for frontend/, which extends @kinetis/vector-ui.

worker

none

queue:work --queue=default,vector: the application’s jobs first, then Vector’s.

scheduler

none

Every hour, vector:jobs:reap, vector-ai:approvals:prune and vector:jobs:prune --days=30, in the order Bulk rewrite retention gives. In production your scheduler runs these (scheduling).

mysql

localhost:3306

The shop. vector / vector. MYSQL_HOST_PORT moves it when 3306 is taken.

postgres

localhost:5432

vector_support, the support desk, and vector_admin, Vector’s own tables. vector / vector.

redis

localhost:6379

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.

  • --fresh empties 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=N multiplies the row counts, from 1 to 100.

Account

Password

Signs in as

admin@vector.local

password

An admin.

editor@vector.local

password

A user without admin access: refused by the admin.

e2e@vector.local

password

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

default

MySQL

DB_MAX_CONNECTIONS=4

48

admin (Vector’s tables)

PostgreSQL

DB_ADMIN_MAX_CONNECTIONS=2

24

support (the support desk)

PostgreSQL

DB_SUPPORT_MAX_CONNECTIONS=2

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#