# Prompt Vault: The AI Professional's Command Center Prompt Vault is an ultra-premium, local-first Progressive Web App (PWA) for managing, versioning, and optimizing AI prompt libraries. Use this platform to organize your prompts with tags and folders, keep a history of versions, and utilize Google Gemini for prompt enhancement and metadata tagging. ## 🧠 System Architecture - **Stack:** React 19, Vite 6, TypeScript 5, Supabase (PostgreSQL). - **Model:** Local-First PWA with Supabase Realtime sync. - **AI Engine:** Google Gemini (`gemini-2.0-flash`) for prompt optimization and tagging. ## 🔑 Core Entities ### Prompt The fundamental unit of the system. - `title` (string): Descriptive name. - `content` (text): The prompt template. Supports `{{variable}}` syntax. - `model_config` (json): Configuration (temp, topP, etc.) for the target LLM. - `versions` (jsonb): Array of historical content snapshots. - `iap_tags` (relation): Many-to-many relationship with Tags. ### Folder (Collection) Organizes prompts into logical groups. ## 🤖 Agent Interfaces ### 1. Curator API (Ingestion) -> Inbox Agents can ingest prompts via Supabase REST API, which appear in the user's "Inbox" for review. `POST /rest/v1/iap_incoming_prompts` ### 2. Model Context Protocol (MCP) Supports Claude Desktop integration via `mcp-server.js`. - **Server:** `stdio` based. - **Tools:** `list_prompts`, `get_prompt`, `create_prompt`. ### 3. Public Knowledge Graph Shared prompts are accessible via `/#/share/:id`. - **Format:** HTML (SPA). - **Interaction:** Read-only + Playground. ### 4. The Emporium (Marketplace) A registry of premium prompt collections and workflows. - **Format:** JSON-based packages. - **Content:** Prompts, themes, and system instructions. - **Access:** Free & Paid (IAP). ## 🧭 Navigation Map | Route | Description | Access | |-------|-------------|--------| | `/` | Mission Control Dashboard | 🔒 Auth Required | | `/#/share/:id` | Public Prompt View | 🌍 Public | | `/#/store` | The Emporium | 🔒 Auth Required | | `/?action=new` | Shortcut: Create New Prompt | 🔒 Auth Required | | `/?action=inspiration` | Shortcut: Inspiration Hub | 🔒 Auth Required | ## 🛡️ Trust & Security - **Auth:** Supabase Auth (JWT). - **Storage:** Row Level Security (RLS) enforced. - **Sanitization:** DOMPurify for rendered markdown. ## ✨ Advanced UI Components - **CommandBar:** A cmdk-powered Command Palette for rapid navigation and actions. - **SmartTextArea:** An AI-assisted text input for prompt drafting. - **PresentationView:** A full-screen, distraction-free reading mode for prompts.