Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deck demo

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.

The demos

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

The prompt library

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 step

Edit any markdown file under resources/prompts and reload the page — that is the whole authoring loop.

Getting Started

Prerequisites

  • PHP 8.4+

Installation

  1. Clone the repository

    git clone https://github.com/promptphp/deck-demo.git
    cd deck-demo
  2. Install PHP dependencies

    composer install
  3. Install Node dependencies

    npm install
  4. Copy and configure environment

    cp .env.example .env
    # Add OPENAI_API_KEY for demos 3 and 4
  5. Generate app key

    php artisan key:generate
  6. Run migrations and seeders

    php artisan migrate --seed
  7. Build frontend assets for production

    npm run build
  8. Start development server

    npm run dev

Tracking

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=true

Seeding also mirrors the prompt files into the prompt_versions table, so activating a version updates both the database and the prompt's metadata.json.

The same library from the CLI

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

Development

  • Run tests

    composer test

License

MIT


Authors


About

A Laravel demo app for the promptphp/deck package, a Laravel package for versioned AI prompt management with variable interpolation, performance tracking & A/B testing.

Topics

Resources

Code of conduct

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages