This is a demo app for Deck by PromptPHP.
Four small demos over one prompt library, showing how Deck manages AI prompts as versioned files: rendering with variables, diffing and promoting versions, tracking executions for A/B tests, and feeding a Laravel AI SDK agent its instructions.
| # | Demo | What it shows |
|---|---|---|
| 1 | Prompt Studio (/demos/studio) |
Every version of every prompt, rendered from its files. Deck::get(), {{ $variable }} interpolation, toMessages(), metadata(). |
| 2 | Version Desk (/demos/versions) |
Line-by-line diff between two versions, then promote or roll back with Deck::activate() — the browser equivalent of prompt:diff and prompt:activate. |
| 3 | A/B Lab (/demos/lab) |
The same product run through two prompt versions, both recorded with Deck::track(), scored on latency, tokens, cost and thumbs-up rate. |
| 4 | Agent Desk (/demos/agent) |
An agent with no instructions() method — HasPromptTemplate loads them from the prompt files and fills them with live order data. |
Demos 1 and 2 need no AI provider key. Demos 3 and 4 call your configured provider.
resources/prompts/
├── product-description/
│ ├── metadata.json # "active_version": 1
│ ├── v1/ # baseline
│ ├── v2/ # benefit-led
│ └── v3/ # SEO + few-shot (adds an assistant role)
└── order-summary/
├── metadata.json
├── v1/ # plain summary
└── v2/ # summary + next stepEdit any markdown file under resources/prompts and reload the page — that is the whole authoring loop.
- PHP 8.4+
-
Clone the repository
git clone https://github.com/promptphp/deck-demo.git cd deck-demo -
Install PHP dependencies
composer install
-
Install Node dependencies
npm install
-
Copy and configure environment
cp .env.example .env # Add OPENAI_API_KEY for demos 3 and 4 -
Generate app key
php artisan key:generate
-
Run migrations and seeders
php artisan migrate --seed
-
Build frontend assets for production
npm run build
-
Start development server
npm run dev
The A/B lab writes to Deck's prompt_executions table. Tracking defaults to off while APP_DEBUG=true, so .env.example turns it on explicitly:
DECK_TRACKING_ENABLED=trueSeeding also mirrors the prompt files into the prompt_versions table, so activating a version updates both the database and the prompt's metadata.json.
php artisan prompt:list --all
php artisan prompt:test order-summary --ver=2 --variables='{"tone":"friendly"}'
php artisan prompt:diff product-description --v1=1 --v2=2
php artisan prompt:activate product-description v2-
Run tests
composer test
- Veeqtoh and contributors