Prompt Chain Studio is a Next.js 14 + TypeScript + Supabase admin tool for managing Humor Project prompt chains (humor flavors), their ordered steps, and a REST-driven flavor testing workflow.
Create .env.local with the existing class Supabase project values:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_keyOptional runtime variable for the Assignment 5-compatible test endpoint:
HUMOR_PROJECT_REST_API_URL=https://your-api.example.com/path-to-caption-test-endpoint- Google OAuth only.
- Unauthenticated users are redirected to
/login. - Authenticated users must have either
public.profiles.is_superadmin = trueorpublic.profiles.is_matrix_admin = true. - Authenticated users without one of those flags are redirected to
/unauthorized.
- Overview — humor flavor summary, counts, recently updated flavor, quick actions.
- Flavors — create, edit, duplicate, and delete humor flavors in a master/detail layout.
- Steps — add, edit, delete, and reorder
humor_flavor_stepsfor the selected flavor. - Test Runner — send a selected flavor + image source through the Humor Project REST API.
- Results / Captions — read recent captions associated with the selected flavor when flavor keys are present on caption rows.
- Audit Trail — read-only inspection of
llm_prompt_chainsandllm_model_responses.
This repo intentionally avoids inventing unsupported columns:
- Structured editing inputs are only shown for columns detected in currently loaded rows.
- Flavor and step writes include
created_by_user_id/modified_by_user_idfor audit compatibility. - DB-managed datetime columns are not sent manually in the new flavor/step write flows.
- If the REST endpoint is not configured, the test runner returns a clear debugging error instead of silently failing.
npm test
npm run dev- The test runner currently assumes
HUMOR_PROJECT_REST_API_URLpoints directly to the Assignment 5-compatible endpoint that accepts a JSON payload containing the selected flavor and image source. - If your deployed backend expects a different payload or route shape, update the internal proxy route in
app/api/prompt-chain-test/route.ts.