Industries
Edit Industry
Template Matrix
Edit Template
Industry Templates
Edit Template
Admin Registry
Base Template Files
Manage versioned admin.html and master_template.html variants per industry. Stored in R2 with local IDB cache.
Generate Admin File
Create a new standalone admin.html from a template. The generated file has all template values baked in.
Operations Dashboard
Settings
Cloud Settings
Client Organizations
Each organization in Clerk maps to a client. Client users log into the portal and see only their org's projects.
No organizations
Configure cloud settings first, then create organizations.
Client Details
Client Users
Manage client portal users. Users are invited to an organization and can access that org's projects.
No users
Configure cloud settings first, then invite users.
Credit Pricing Tiers
Define credit packs that clients can purchase. Each pack needs a corresponding Stripe Price ID.
No pricing tiers
Create credit packs for clients to purchase.
Credit Management
Per-client credit balances, purchase history, and usage reporting. Toggle test mode for unlimited credits during development.
Loading...
Fetching client credit data.
Client Portal
Access the Client Portal to test, manage, and troubleshoot the client experience. Use this to verify projects, files, credits, and organisation access from the client's perspective.
/api/health).Help & Documentation
Create new: Click New Industry, optionally clone from an existing one.
Edit: Click the pencil icon to open the 5-tab editor: General, Categories, Project Types, Industry Defaults, Category Defaults.
Industry Defaults: These are inherited by ALL templates in the industry — UI labels, survey fields, experience phases, dashboard cards, AI prompts, and report sections.
AI Scaffold: On the General tab, click Scaffold Industry with AI to auto-generate categories, project types, labels, fields, and prompts for any industry.
AI Suggest (single): Click the brain icon on a category card to generate themes specific to that category. The AI is instructed to differentiate from other categories in the same industry.
AI Suggest All: Click AI Suggest All Categories to generate themes for every category at once. The AI ensures no two categories share generic bucket names.
Edit manually: Click the pencil icon on a category card to expand the inline editor with bucket name + keywords inputs for strength and friction, plus a guidance textarea.
Guidance: A paragraph instructing the AI analyst what to look for when analysing feedback in this category. This is injected into the admin portal's analysis pipeline.
Create template: Click "+" in an empty cell. The template starts with empty overrides (inherits everything from category/industry defaults).
Edit template: Click "Edit" in a filled cell. The scoped editor shows scope badges (Industry → Category → Project Type) and only stores what's different from defaults.
AI Scaffold: In the scoped template editor, click Scaffold Overrides with AI to generate project-type-specific themes, guidance, survey fields, report sections, and agent prompts. The AI only generates the DELTA — not everything from scratch.
Contextual fields: The AI scaffold adds 1-3 survey fields specific to the study type (e.g., "Taste Profile" for sensory studies, "Eco Perception" for sustainability studies).
Bulk scaffold: Click Scaffold All Empty Cells to AI-generate templates for every empty cell in the matrix.
Step 2 — Admin details: Enter a name (used as filename) and client name.
Step 3 — Initial admin user: Create the first user who can log into this admin portal. Provide their name, email, role (Super Admin/Admin/Analyst), and a login PIN (min 4 characters). More users can be added after launching.
Step 4 — Permissions: Toggle which features the admin portal can access (AI pipeline, CSV import, theme editing, etc.).
Step 5 — Lock mode: Locked portals are read-only (clients can view but not change configuration).
Step 6 — Generate: Click Generate Admin File. The system auto-generates a random admin password, injects all template config, and saves the file.
Password: Displayed in the Admin Registry. Share this with the client — it's the global admin PIN for the portal.
Regenerate: Click the 🔄 icon to re-open the Factory pre-filled with the original settings. Modify and regenerate to update the admin.
Lock/Unlock: Toggle read-only mode for a portal.
Permissions: Click the permission count badge to edit which features are enabled.
Password & User: Each entry displays the auto-generated password and initial user details (name, role, email). Share these credentials with the client team.
Archive: Mark completed projects as archived. Filter by status using the dropdown.
Recent projects: Table of projects created in the last 30 days with client name, status, and respondent count.
Admin health: Table of all admin portals with user count and status.
Storage: R2 usage by file type + cleanup recommendations for files older than 90 days.
Template assignment: Templates are grouped by industry in the creation modal. Check the ones this client needs access to.
Requires: Cloud Settings must be configured (API URL + Key). The amber warning banner tells you if it's not.
Bulk Invite: Click Bulk Invite (CSV) — upload a CSV file with columns:
org_id, email, role (optional, defaults to org:member). One row per user. The system sends Clerk invitations for all rows at once.
Manual sync: Go to Settings → Cloud Sync (D1). Click Migrate All to Cloud to push everything, or Pull from Cloud to refresh from D1.
Why it matters: localStorage is scoped by origin. Opening
file:///super_admin.html and http://localhost:8899/super_admin.html creates two separate data stores. D1 sync solves this — both origins read from the same database.Cloud badge: The header shows "● Cloud" (green) when connected, "● Offline" (amber) when the API is unreachable.
Recommendation: Always use
http://localhost:8899 for full functionality. file:// blocks API calls due to browser security.
https://piaza-api.syed-332.workers.dev).Admin API Key: The shared secret set as a Cloudflare Worker secret (
ADMIN_API_KEY). Used for all authenticated API calls.Clerk Keys: Publishable key for client portal authentication. Secret key is stored as a Worker secret and never exposed client-side.
Test: Click Test Connection to verify the API is reachable.
1. Client logs in via Clerk (Google or email).
2. Clicks "New Project" — sees templates assigned to their org.
3. Selects a template, fills in project name and details (labels adapt to the template's industry terminology).
4. Confirms — a credit is deducted and the project is created in D1.
Troubleshooting checklist: Verify Clerk config, org exists, user invited, API connectivity, credits available, files published, PINs communicated.
Credit Management: View per-client balances, purchase history, and usage log. Toggle test mode for development.
Consumption: Automatic on project creation via Client Portal. Can also be consumed manually via the API.
AI Configuration: Configure Ollama URL/model, OpenAI key, Claude key, and primary backend for AI scaffold operations.
Data Management: Export/import the admin registry as JSON. Clear all data (destructive).
Cloud Sync: Migrate all local data to D1 or pull latest from cloud.