How tharunpoduru/vibekit works
Project Type and Purpose
• Type: A client-side Adobe Express Add-on built in React + TypeScript.
File Structure
• src/ui: The React app (components, styling, entry point).
• src/sandbox: Code running in the extension’s sandboxed iframe (DOM parsing, CORS proxy calls).
• src/models: TypeScript definitions (e.g., DocumentSandboxApi.ts for messaging).
• manifest.json: Adobe Express Add-on metadata (commands, permissions).
• webpack.config.js: Bundler configuration producing the add-on package.
• package.json & tsconfig.json: Dependencies and TypeScript settings.
Readme Insights
• UI built with Adobe Spectrum Web Components.
• Uses OpenAI GPT-4 API for text generation.
• Requires a CORS proxy to fetch and parse third-party HTML/CSS safely.
• All logic lives client-side; no separate backend service shipping with the add-on.
Main Components
a. Adobe Express Host
• Loads the add-on via manifest.json.
• Provides a container and document API.
b. -On UI (React + Spectrum)
• src/ui/index.tsx → renders UI components (App.tsx).
c. Sandbox Context
• src/sandbox/code.ts
• Runs in an isolated iframe for DOM parsing.
• Communicates with the UI via DocumentSandboxApi (postMessage).
• Calls CORS Proxy to fetch external page HTML/CSS.
d. DocumentSandboxApi
• Typed interface (src/models/DocumentSandboxApi.ts).
e. CORS Proxy (External Service)
• Bypasses browser cross-origin restrictions.
• Fetches target website HTML/CSS on behalf of the sandbox.
f. OpenAI GPT-4 API (External AI Service)
• Used in prompt-based generation modes.
• The UI or sandbox sends HTTP requests (with keys) to produce text outputs.
g. Adobe Express Document
• Receives generated assets (palette, quotes, etc.).
• Inserted via the host’s scripting API.
Relationships and Data Flows
• User triggers action in Add-On UI.
• UI sends a “parse URL” or “generate prompt” message to Sandbox via DocumentSandboxApi.
• Sandbox:
• For prompt mode: directly calls OpenAI API → returns generated brand assets.
• UI receives data, displays previews.
• Upon “insert” commands, UI calls Adobe Express host APIs to add elements to the document.
• All HTTP calls flow through secure channels (HTTPS); secrets held in extension configuration.
Architectural Patterns and Principles
• Separation of concerns: UI vs. sandbox logic.
• Typed messaging contract (DocumentSandboxApi) for reliable component interaction.
• Client-only architecture: no custom backend beyond the CORS proxy and OpenAI.
• Component-driven UI: React + Spectrum.
• Build pipeline: Webpack bundles TSX and sandbox code into the add-on package.
• Title: “VibeKit Add-On System Architecture.”