Terraform Infrastructure Builder
Run ID: 69cbcba161b1021a29a8c6422026-03-31Infrastructure
PantheraHive BOS
BOS Dashboard

Generate production-ready Terraform configurations for cloud infrastructure including VPC, compute, storage, databases, and networking.

This document outlines the detailed design specifications, wireframe descriptions, color palettes, and user experience (UX) recommendations for a "Terraform Infrastructure Builder" application. This application aims to provide a user-friendly interface for generating production-ready Terraform configurations for cloud infrastructure, abstracting away much of the manual HCL coding.


1. Introduction & Goal

The "Terraform Infrastructure Builder" is a web-based application designed to simplify and accelerate the creation of cloud infrastructure using Terraform. Its primary goal is to enable users (DevOps engineers, cloud architects, developers) to visually design and configure their infrastructure components across various cloud providers, and then generate clean, modular, and production-ready Terraform code. This reduces errors, enforces best practices, and improves development velocity.

This deliverable focuses on the research_design_requirements phase, establishing the foundational UI/UX design principles and conceptual layout for the builder application.

2. Detailed Design Specifications

2.1 Core Application Functionality

The application will be structured around a project-based approach, allowing users to manage multiple infrastructure configurations.

2.1.1 Project Management

  • Create New Project: Start a new infrastructure design.
  • Load Existing Project: Open previously saved configurations.
  • Save Project: Persist the current configuration (local storage, cloud storage, or Git integration).
  • Delete Project: Remove a project.
  • Project Dashboard: Overview of all projects, their cloud provider, last modified date, and status.

2.1.2 Cloud Provider Selection

  • Multi-Cloud Support: Initial support for AWS, Azure, GCP. Expandable.
  • Provider Configuration: Allow global or project-specific provider configuration (e.g., default region, credentials placeholder).

2.1.3 Resource Management Canvas

  • Interactive Canvas: A central workspace where users can visually add, arrange, and connect infrastructure resources.
  • Resource Palette/Sidebar: A categorized list of available cloud resources (VPC, Subnet, EC2/VM, S3/Storage Account, RDS/SQL Database, Load Balancer, Security Group/NSG, etc.).
  • Drag-and-Drop Functionality: Users can drag resources from the palette onto the canvas.
  • Resource Configuration Panel: Upon selecting a resource on the canvas, a dedicated panel appears to configure its properties (e.g., instance type, storage size, CIDR block, database engine, security rules).
  • Dependency Visualization: Automatically draw connections/arrows between dependent resources (e.g., EC2 instance in a Subnet, Database in a VPC). Allow manual override or creation of implicit dependencies.
  • Resource Grouping: Ability to group related resources visually (e.g., a "Web Tier" group).
  • Search & Filter: Quickly find specific resources in the palette or on the canvas.

2.1.4 Configuration & Best Practices Enforcement

  • Input Validation: Real-time validation for all input fields (e.g., valid CIDR, required fields).
  • Naming Conventions: Enforce or suggest consistent naming conventions across resources (e.g., project-env-resource-name).
  • Tagging Strategy: Centralized interface for defining and applying resource tags (e.g., Environment, Owner, CostCenter).
  • Module Support: Ability to generate code that utilizes Terraform modules, or to define custom modules within the builder.
  • Variables & Outputs: Dedicated sections to define Terraform variables (with types, descriptions, default values) and outputs.
  • Security Best Practices: Built-in recommendations or warnings for common security misconfigurations (e.g., overly permissive security groups).

2.1.5 Terraform Code Generation & Export

  • Real-time Code Preview: Display the generated Terraform HCL code (main.tf, variables.tf, outputs.tf, versions.tf) in real-time as resources are added and configured.
  • Code Quality: Generate clean, formatted, and idiomatic Terraform code.
  • Download Options:

* Download as a .zip archive containing all .tf files.

* Download individual .tf files.

  • Git Integration (Advanced): Directly commit generated code to a specified Git repository branch.

2.2 Technical Requirements

  • Frontend Framework: React, Vue, or Angular for a dynamic and responsive UI.
  • Backend (Optional, for persistent storage/Git integration): Node.js, Python, or Go.
  • State Management: Redux, Vuex, or similar for complex application state.
  • Data Visualization Library: D3.js, React Flow, or similar for interactive canvas and dependency graphs.
  • Cloud Provider APIs/SDKs: To fetch resource definitions and validate configurations (if real-time validation against cloud provider is desired).

3. Wireframe Descriptions

The application will feature a multi-panel layout to optimize user flow and information density.

3.1. Dashboard / Project Overview

  • Layout: Full-width, responsive grid.
  • Components:

* Header: Application logo, user profile/settings.

* Sidebar (Optional): Navigation to "Projects", "Templates", "Settings".

* Main Content:

* "Create New Project" button.

* List of existing projects with cards/rows. Each card shows: Project Name, Cloud Provider, Last Modified, Status (e.g., "Draft"), and actions (Edit, Duplicate, Delete).

* Search/Filter bar for projects.

  • Purpose: Entry point for managing infrastructure projects.

3.2. Cloud Provider Selection (On New Project Creation)

  • Layout: Centered modal or dedicated page.
  • Components:

* Title: "Select Your Cloud Provider".

* Cloud Provider Cards: Large, distinct cards for AWS, Azure, GCP, etc., with their logos.

* "Next" Button: To proceed to the Resource Editor.

  • Purpose: Guides user to choose the target cloud environment.

3.3. Resource Editor (Main Workflow Screen)

  • Layout: Three-panel design:

* Left Sidebar (Resource Palette):

* Categorized list of cloud resources (Compute, Networking, Storage, Database, Security, etc.).

* Search bar within the palette.

* Drag-and-drop handles for each resource.

* Center Canvas (Main Workspace):

* Large, interactive area for drawing/arranging resources.

* Grid background for alignment.

* Zoom in/out, pan functionality.

* Visual representation of resources as nodes, with labels.

* Arrows/lines indicating dependencies.

* Context menu on right-click for selected resources (Edit, Delete, Duplicate).

* Right Sidebar (Configuration Panel):

* Contextual panel that appears when a resource on the canvas is selected.

* Dynamic forms based on the selected resource type.

* Tabs for General Settings, Networking, Security, Tags, Variables, Outputs.

* Inline validation messages.

* "Apply" / "Save Changes" button.

  • Header: Project name, "Save" button, "Preview Code" button, "Download" button, "Settings" icon.
  • Footer (Optional): Status bar, quick tips.
  • Purpose: The primary interface for designing and configuring infrastructure.

3.4. Terraform Code Preview

  • Layout: Full-screen modal or a dedicated tab/view within the Resource Editor.
  • Components:

* Tabbed Interface: main.tf, variables.tf, outputs.tf, versions.tf.

* Code Editor: Syntax-highlighted, read-only display of the generated HCL.

* Copy to Clipboard button.

* Download All button.

* Close button.

  • Purpose: Allows users to review the generated Terraform code before export.

4. Color Palettes

A professional, modern, and accessible color palette will be used, prioritizing clarity and user comfort.

4.1. Primary Palette

  • Primary Brand Color (e.g., Deep Blue/Teal): #007BFF (or #00A388 for a teal variant) - Used for primary actions, active states, branding elements.
  • Secondary Accent Color (e.g., Orange/Green): #FF8C00 (or #4CAF50) - Used for secondary actions, highlights, warnings.

4.2. Neutral Palette

  • Backgrounds:

* Light Gray (Canvas/Workspace): #F8F9FA

* Slightly Darker Gray (Sidebars/Panels): #FFFFFF (pure white) or #F0F2F5

  • Text:

* Dark Gray (Primary Text): #343A40

* Medium Gray (Secondary Text/Labels): #6C757D

* Light Gray (Disabled Text/Placeholders): #ADB5BD

  • Borders/Dividers: #DEE2E6

4.3. Semantic Colors

  • Success: #28A745 (Green) - For successful operations, positive feedback.
  • Warning: #FFC107 (Yellow/Amber) - For warnings, attention required.
  • Danger/Error: #DC3545 (Red) - For errors, critical alerts, destructive actions.
  • Info: #17A2B8 (Light Blue) - For informational messages.

4.4. UI Element Colors

  • Buttons:

* Primary: Primary Brand Color with White text.

* Secondary: White background with Primary Brand Color text, or Light Gray background with Dark Gray text.

  • Icons: Dark Gray by default, Primary Brand Color for active states.
  • Links: Primary Brand Color.
  • Code Editor: Dark theme for readability (e.g., Monokai, Dracula, or a custom dark theme with good contrast).

5. UX Recommendations

5.1. User Flow & Navigation

  • Clear Entry Points: Dashboard should provide clear paths to create or load projects.
  • Intuitive Hierarchy: Consistent navigation structure. Use breadcrumbs for multi-level paths within a project.
  • Progressive Disclosure: Initially show only essential options; reveal more advanced settings as needed (e.g., in configuration panels, use accordions or tabs).
  • Undo/Redo: Implement robust undo/redo functionality for canvas actions and configuration changes.

5.2. Interaction & Feedback

  • Visual Feedback:

* Highlight selected resources on the canvas and in the resource palette.

* Show loading indicators for long-running operations.

* Provide clear success/error messages for actions (e.g., "Project Saved Successfully").

  • Direct Manipulation: Leverage drag-and-drop for resource placement and connection creation.
  • Contextual Help:

* Tooltips on icons and complex fields explaining their purpose.

* Inline help text for configuration options.

* Links to official cloud provider documentation where relevant.

  • Error Prevention & Recovery:

* Real-time input validation with clear error messages.

* Confirmation dialogs for destructive actions (e.g., deleting a resource or project).

* Suggestions for common misconfigurations.

5.3. Consistency & Standards

  • UI Element Consistency: Use a consistent design system for buttons, forms, icons, and typography across the application.
  • Terminology: Use standard cloud and Terraform terminology.
  • Accessibility:

* Ensure sufficient color contrast for text and interactive elements.

* Support keyboard navigation for all interactive components.

* Provide clear focus states for interactive elements.

* Use ARIA attributes where appropriate.

5.4. Performance & Responsiveness

  • Optimized Performance: Ensure the canvas handles a large number of resources smoothly without lag.
  • Responsive Design: While primarily a desktop application, ensure basic responsiveness for different screen sizes (e.g., tablet views) if required, though a
gemini Output

Terraform Infrastructure Builder: Detailed Design Specifications

This document outlines the detailed design specifications for the "Terraform Infrastructure Builder," an intuitive and powerful tool aimed at simplifying the generation of production-ready Terraform configurations. This deliverable focuses on the user interface (UI) and user experience (UX) to ensure a seamless, efficient, and error-resistant process for building cloud infrastructure.


1. Design Specifications

The Terraform Infrastructure Builder is designed to be a guided, step-by-step application that empowers users to define their cloud infrastructure requirements without needing deep Terraform syntax knowledge.

1.1. Core Objectives

  • Simplify Terraform Adoption: Lower the barrier to entry for new users and accelerate configuration generation for experienced ones.
  • Enforce Best Practices: Guide users towards secure, cost-effective, and scalable infrastructure designs.
  • Reduce Configuration Errors: Provide real-time validation and contextual help to minimize misconfigurations.
  • Enhance Productivity: Streamline the infrastructure definition process, allowing users to generate complex configurations rapidly.
  • Promote Modularity and Reusability: Encourage the creation of well-structured and maintainable Terraform code.

1.2. Target Audience

  • DevOps Engineers: To quickly prototype, deploy, and manage infrastructure.
  • Cloud Architects: To design and standardize infrastructure patterns across projects.
  • Developers: To provision development and testing environments efficiently.
  • IT Operations Teams: To automate infrastructure provisioning and management.

1.3. Key Features & Functionality

  • Cloud Provider Selection:

* Support for major cloud providers: AWS, Azure, GCP.

* Future extensibility for other providers (e.g., Oracle Cloud, DigitalOcean).

  • Guided Infrastructure Wizard:

* A multi-step, intuitive wizard for defining infrastructure components.

* Context-sensitive options based on previous selections.

* Progress indicator to show current step and overall progress.

  • Component Configuration Modules:

* Networking: VPC/VNet, Subnets, Route Tables, Internet/NAT Gateways, Security Groups/Network Security Groups, Load Balancers.

* Compute: Virtual Machines (EC2, Azure VM, GCE), Auto Scaling Groups, Container Services (EKS, AKS, GKE).

* Storage: Object Storage (S3, Azure Blob, GCS), Block Storage (EBS, Azure Disk, Persistent Disk), File Storage (EFS, Azure Files, Filestore).

* Databases: Managed Relational Databases (RDS, Azure SQL, Cloud SQL), NoSQL Databases (DynamoDB, Cosmos DB, Firestore).

* Identity & Access Management (IAM): Roles, Policies, Service Principals (simplified creation).

* Monitoring & Logging: Basic integration points (CloudWatch, Azure Monitor, Cloud Logging).

  • Parameterization & Variables:

* Allow users to define input variables for reusable configurations.

* Support for default values and descriptions.

  • Real-time Validation & Feedback:

* Input validation for CIDR blocks, resource names, instance types, etc.

* Contextual help text and tooltips for complex fields.

  • Configuration Review & Summary:

* A comprehensive summary screen displaying all chosen infrastructure components and their configurations.

* Ability to navigate back to previous steps for modifications.

  • Terraform Code Generation:

* Generate .tf files, variables.tf, outputs.tf, and main.tf (or organized by module).

* Option to include providers.tf and backend.tf configurations.

* Display generated code within the UI for review.

* Download options: as a .zip archive or individual files.

  • Configuration Persistence:

* Save in-progress configurations locally or to a user profile for later retrieval.

* Load existing configurations to modify or extend.

1.4. Design Principles

  • Clarity & Simplicity: Clean, uncluttered UI with clear labels and intuitive navigation.
  • Guidance & Education: Provide sufficient context and help to guide users through complex decisions.
  • Consistency: Maintain a consistent look, feel, and interaction model across all screens.
  • Responsiveness: Adapt UI gracefully to various screen sizes and devices.
  • Accessibility: Adhere to WCAG 2.1 AA standards for all UI components.
  • Security by Design: Encourage secure configurations by default and highlight potential security implications.

2. Wireframe Descriptions

The user interface will primarily consist of a multi-step wizard, guided by a persistent sidebar navigation and a main content area.

2.1. Screen 1: Welcome & Project/Provider Selection

  • Layout: Centered content with a prominent call to action.
  • Elements:

* Header: "Terraform Infrastructure Builder" title.

* Welcome Message: Brief explanation of the tool's purpose.

* Cloud Provider Selection: Large, clickable cards or buttons for AWS, Azure, GCP. Each card includes the provider logo and name.

* "Load Existing Configuration" Button: Allows users to upload a previously saved configuration file.

* "Start New Project" Button: Becomes active after provider selection.

  • User Flow: User selects a cloud provider, then clicks "Start New Project" or loads an existing one.

2.2. Screen 2: Infrastructure Configuration Wizard (Multi-Step)

This is the core of the builder, presented as a linear, guided workflow.

  • Persistent Sidebar (Left):

* Step Indicator: A list of major infrastructure categories (e.g., "1. Provider Setup", "2. Networking", "3. Compute", "4. Storage", "5. Databases", "6. Review & Generate").

* Current Step Highlight: Clearly indicates the active step.

* Validation Status: Small icons next to each step showing "Complete," "In Progress," or "Errors."

* Navigation: Users can click on completed steps to revisit, but generally encouraged to proceed linearly.

  • Main Content Area (Right):

* Header: Dynamic title reflecting the current step (e.g., "Configure Networking").

* Step Description: Brief instruction or context for the current step.

* Form Elements:

* Networking:

* VPC/VNet Creation: Input for CIDR block, name.

* Subnet Configuration: Table to add multiple subnets (CIDR, availability zone, type: public/private).

* Gateway Options: Checkboxes for Internet Gateway, NAT Gateway (with instance type/IP options).

* Security Groups/NSGs: Rules definition (inbound/outbound, port, source/destination).

* Compute:

* Instance Creation: Dropdowns for instance type, AMI/Image, key pair, number of instances.

* Auto Scaling Group: Min/Max/Desired capacity, launch template configuration.

* Container Services: Cluster name, node count, instance type, Kubernetes version.

* Storage:

* Object Storage: Bucket name, region, public access settings, versioning.

* Block Storage: Volume size, type (SSD/HDD), IOPS (if applicable), attachment options.

* Databases:

* Engine Selection: MySQL, PostgreSQL, SQL Server, Aurora, etc.

* Instance Class & Storage: Dropdowns for size, storage type, allocated storage.

* Credentials: Master username/password fields.

* Backup & Maintenance: Retention period, window.

* IAM (Simplified):

* Role/Policy Creation: Basic definition for common roles (e.g., EC2 Full Access, S3 Read-Only). Advanced users can upload JSON.

* Navigation Buttons: "Previous Step" and "Next Step" at the bottom of the main content area.

* Contextual Help: Small (i) icons or inline text providing guidance for complex fields.

  • User Flow: User fills out forms, receives real-time validation, and progresses through steps.

2.3. Screen 3: Review & Generate

  • Layout: Two-column or full-width content area.
  • Elements:

* Header: "Review Your Infrastructure"

* Summary Panel (Left/Top):

* A collapsible, tree-like view or categorized list of all configured resources.

* Each item shows key properties (e.g., VPC CIDR, EC2 instance type, S3 bucket name).

* Clicking an item reveals more details or allows direct navigation back to that configuration step.

* Action Panel (Right/Bottom):

* "Generate Terraform" Button: Triggers the code generation process.

* "Save Configuration" Button: Saves the current state of the builder to a JSON/YAML file.

* "Edit Configuration" Button: Returns to the last step of the wizard.

  • User Flow: User reviews the summary, makes any final edits, then generates or saves the configuration.

2.4. Screen 4: Generated Terraform Code

  • Layout: Full-width code display area.
  • Elements:

* Header: "Your Terraform Configuration"

* Code Viewer:

* Syntax-highlighted display of the generated .tf files.

* Tabs or an expandable tree structure to navigate between main.tf, variables.tf, outputs.tf, providers.tf, and any module files.

* Copy-to-clipboard functionality for each file or the entire project.

* Download Options:

* "Download All as ZIP" button.

* Individual "Download" buttons next to each file tab.

* Next Steps Guidance: Brief instructions on how to use the generated code (e.g., terraform init, terraform plan, terraform apply).

* "Start New Project" Button: To begin a new configuration.

  • User Flow: User reviews the code, downloads it, and proceeds to deploy it using Terraform CLI.

3. Color Palettes

A professional, modern, and accessible color palette will be used, emphasizing clarity and brand consistency.

3.1. Primary Palette (PantheraHive Brand)

  • Primary Blue: #007AFF (Action buttons, primary highlights)
  • Secondary Blue: #0056B3 (Hover states, darker accents)
  • Dark Grey: #212529 (Primary text, headings)
  • Light Grey: #F8F9FA (Backgrounds, inactive states)

3.2. Accent & Feedback Palette

  • Accent Green: #28A745 (Success messages, positive indicators)
  • Accent Red: #DC3545 (Error messages, destructive actions)
  • Accent Yellow: #FFC107 (Warning messages, important notices)
  • Accent Teal (Cloud Neutral): #20C997 (Subtle UI elements, non-critical highlights)

3.3. Neutral Palette

  • Background: #FFFFFF (Main content areas, forms)
  • Secondary Background: #F8F9FA (Sidebar, cards, subtle separation)
  • Borders/Dividers: #DEE2E6
  • Text (Secondary): #6C757D (Helper text, labels)
  • Text (Disabled): #ADB5BD

3.4. Cloud Provider Specific (Subtle)

While the primary interface will maintain a consistent look, subtle visual cues (e.g., icons, light border accents) can be used to reflect the chosen cloud provider within its specific configuration steps.

  • AWS: Yellow (#FF9900)
  • Azure: Blue (#0078D4)
  • GCP: Multi-color (Red: #DB4437, Blue: #4285F4, Yellow: #F4B400, Green: #0F9D58) - used sparingly, primarily for logos.

4. UX Recommendations

Optimizing the user experience is paramount for the Terraform Infrastructure Builder to be effective and enjoyable.

4.1. Guided Workflow & Progressive Disclosure

  • Linear Path: Enforce a clear, step-by-step progression through the infrastructure definition.
  • Progress Indicators: Visually represent the user's current position within the workflow (e.g., a progress bar, numbered steps in a sidebar).
  • Contextual Information: Only present relevant options and fields based on previous selections to avoid overwhelming the user.

4.2. Input Validation & Feedback

  • Real-time Validation: Provide immediate feedback on input fields (e.g., valid CIDR block, unique resource name).
  • Clear Error Messages: Explain why an input is invalid and how to correct it, rather than just stating "Error."
  • Success Indicators: Visually confirm successful input or completion of a section.

4.3. Help & Documentation Integration

  • Tooltips: Use (i) icons with tooltips for complex or ambiguous fields, providing brief explanations.
  • **Inline Help
gemini Output

This document outlines the final design assets for the "Terraform Infrastructure Builder" workflow. While the core workflow focuses on generating production-ready Terraform configurations, this step finalizes the design specifications, wireframes, color palettes, and user experience (UX) recommendations for a conceptual user interface (UI) that would empower users to interact with, visualize, and orchestrate the generation of these Terraform configurations. This UI serves as a front-end companion to the robust backend Terraform generation engine.


1. Introduction: Terraform Infrastructure Builder UI

The "Terraform Infrastructure Builder" UI is designed to provide an intuitive and powerful interface for engineers, architects, and DevOps teams to define, review, and generate cloud infrastructure using Terraform. It abstracts away some of the complexity of writing raw HCL (HashiCorp Configuration Language) while maintaining the flexibility and power of Terraform. This UI acts as a visual layer to the underlying Terraform generation engine, ensuring consistency, best practices, and accelerated infrastructure deployment.

The goal is to provide a seamless experience from design concept to deployable infrastructure code, covering key cloud components such as VPC, compute resources (EC2, Kubernetes), storage (S3, EBS), databases (RDS, DynamoDB), and networking (Load Balancers, Route 53).

2. Detailed Design Specifications

The UI will be a web-based application, designed for responsiveness across various screen sizes, though primarily optimized for desktop use cases.

2.1 Core Functionality

  • Project Management: Create, manage, and clone infrastructure projects.
  • Provider Selection: Select target cloud providers (AWS, Azure, GCP, etc.).
  • Infrastructure Definition:

* Visual canvas for drag-and-drop resource placement.

* Form-based configuration panels for detailed resource properties.

* Templating and module reuse capabilities.

  • Validation & Best Practices:

* Real-time validation of configurations against provider schemas and organizational best practices.

* Suggestions for security, cost optimization, and performance.

  • Code Generation:

* Generate production-ready Terraform HCL files.

* Option to include main.tf, variables.tf, outputs.tf, versions.tf.

* Support for remote state backend configuration.

  • Version Control Integration:

* Direct integration with Git repositories (GitHub, GitLab, Bitbucket).

* Generate pull requests (PRs) with the new Terraform code.

  • Preview & Visualization:

* Graph visualization of the infrastructure dependencies.

* Cost estimation preview.

  • Deployment Workflow (Optional Integration):

* Trigger terraform plan and terraform apply (via CI/CD pipeline integration).

2.2 Key Modules/Sections

  1. Dashboard: Overview of active projects, recent activity, and quick links.
  2. Infrastructure Canvas: The primary workspace for building and visualizing infrastructure.

* Resource Palette: Sidebar containing available cloud resources (VPC, EC2, S3, RDS, etc.), categorized by type.

* Drawing Area: Main canvas for dragging resources and defining connections.

* Property Panel: Contextual panel that appears when a resource is selected, allowing detailed configuration.

  1. Project Settings: Define provider credentials, backend configuration, naming conventions, and default regions.
  2. Module Library: Manage custom or common Terraform modules for reuse.
  3. Code Review & Export: Section to review generated HCL, visualize dependencies, and initiate export/PR.
  4. Activity Log/History: Track changes, generations, and deployments.

2.3 Input Mechanisms

  • Drag-and-Drop: For placing resources on the canvas and connecting them.
  • Form Fields: Text inputs, dropdowns, checkboxes, radio buttons, sliders for resource properties.
  • Code Editors (Embedded): For advanced users to directly edit specific HCL blocks or add custom scripts within the UI.
  • Configuration Templates: Pre-defined templates for common infrastructure patterns (e.g., 3-tier web application).

2.4 Output Mechanisms

  • Real-time HCL Preview: A pane displaying the generated Terraform code as changes are made.
  • Infrastructure Graph Visualization: Interactive diagram showing resources and their dependencies.
  • Download Button: To download a .zip archive of the generated Terraform project.
  • Git Integration Button: To automatically create a new branch and open a Pull Request with the generated code.
  • Cost Estimation Report: A summary of estimated cloud costs based on selected resources.

3. Wireframe Descriptions

The following wireframe descriptions outline the key screens and interactions within the Terraform Infrastructure Builder UI.

3.1 Wireframe 1: Dashboard / Project Overview

  • Layout: Two-column layout. Left sidebar for navigation, main content area for project overview.
  • Left Sidebar:

* Logo & App Title.

* Navigation: Dashboard, New Project, Projects, Module Library, Settings.

* User Profile/Account Info.

  • Main Content Area:

* "Welcome, [User Name]!" header.

* "Quick Actions" section: Buttons for Create New Project, Import Existing Project, Browse Templates.

* "Recent Projects" list: Cards or table rows for the last 5-7 projects. Each item includes:

* Project Name.

* Cloud Provider(s).

* Last Modified Date.

* Status (e.g., Draft, Generated, Deployed).

* Action buttons (e.g., Edit, View Code, Delete).

* "Activity Feed" (Optional): A small section showing recent system actions or team collaborations.

3.2 Wireframe 2: Infrastructure Builder Canvas (Main Workspace)

  • Layout: Header, Left Resource Palette, Main Canvas, Right Property Panel.
  • Header:

* Project Name & Status.

* Save button.

* Undo/Redo buttons.

* Zoom In/Out.

* Validate button.

* Generate Code button (leads to Wireframe 4).

* Export dropdown (Download, Create PR).

  • Left Resource Palette (Collapsible):

* Search bar for resources.

* Categorized list of cloud resources (AWS > VPC, EC2, S3; Azure > VNet, VM, Storage Account, etc.).

* Drag-and-drop functionality for placing resources onto the canvas.

  • Main Canvas:

* Large interactive area with a grid background.

* Users drag resources from the palette onto this canvas.

* Resources appear as distinct blocks/icons.

* Clicking on a resource highlights it and opens/updates the Right Property Panel.

* Lines/arrows can be drawn between resources to denote relationships (e.g., EC2 instance in a Subnet, RDS connected to a Security Group).

  • Right Property Panel (Collapsible):

* Appears when a resource is selected on the canvas.

* Displays configurable properties for the selected resource (e.g., for EC2: Instance Type, AMI, Key Pair, Security Groups, User Data).

* Input fields, dropdowns, checkboxes, and validation messages.

* Delete Resource button at the bottom.

3.3 Wireframe 3: Resource Configuration Panel (Detail View)

  • Context: This is the Right Property Panel from Wireframe 2, shown in detail.
  • Layout: Stacked form fields within the panel.
  • Header: Resource Type (AWS EC2 Instance) and Resource Name (editable).
  • Sections (Collapsible):

* General Settings: Name, Region, Tags.

* Compute: Instance Type (dropdown), AMI (searchable dropdown), Key Pair (dropdown), EBS Volume (add/remove block).

* Networking: VPC (dropdown), Subnets (multi-select), Security Groups (multi-select), Public IP (checkbox).

* Advanced: User Data (code editor), IAM Role (dropdown).

* Validation: Real-time feedback on invalid inputs (e.g., "Instance type must be selected").

  • Action Buttons: Apply Changes, Cancel.

3.4 Wireframe 4: Review & Generate Output

  • Layout: Header, Left Navigation (Summary/Code/Diagram/Cost), Main Content Area.
  • Header: Project Name, Back to Canvas button.
  • Left Navigation:

* Summary: High-level overview of resources.

* Terraform Code: Displays generated HCL.

* Infrastructure Diagram: Interactive graph visualization.

* Cost Estimation: Breakdown of estimated monthly costs.

  • Main Content Area (Example: Terraform Code Tab):

* File Tree: Sidebar showing main.tf, variables.tf, outputs.tf, versions.tf.

* Code Editor: Main area displaying the HCL for the selected file, with syntax highlighting.

* Action Buttons:

* Download All .tf Files button.

* Create Git Pull Request button (opens a modal for branch name, commit message, target repo).

* Run Terraform Plan button (if CI/CD integration enabled).

* Run Terraform Apply button (if CI/CD integration enabled).

4. Color Palettes

A clean, professional, and accessible color palette will be used, emphasizing clarity and usability.

  • Primary Brand Color: #007bff (A vibrant, professional blue) - Used for primary actions, active states, and key branding elements.
  • Secondary Color: #6c757d (A neutral, dark gray) - Used for secondary buttons, text, and less prominent UI elements.
  • Accent Color: #28a745 (A clear green) - Used for success messages, positive indicators, and "create" actions.
  • Backgrounds:

* #f8f9fa (Light Gray/Off-white) - Main content background, providing a clean canvas.

* #ffffff (Pure White) - Card backgrounds, modals, and input fields for contrast.

  • Text Colors:

* #212529 (Dark Charcoal) - Primary text, headings.

* #495057 (Medium Gray) - Secondary text, labels.

  • Semantic Colors:

* Success: #28a745 (Green)

* Warning: #ffc107 (Yellow/Amber)

* Error: #dc3545 (Red)

* Info: #17a2b8 (Cyan)

  • Diagram Colors: A set of distinct, accessible colors for different resource types in the infrastructure diagram to improve readability (e.g., Blue for Compute, Green for Networking, Orange for Storage, Purple for Databases).

5. UX Recommendations

5.1 Ease of Use & Intuitive Flow

  • Onboarding: Provide a quick tutorial or guided tour for first-time users.
  • Clear Labeling: Use concise and unambiguous labels for all UI elements, buttons, and form fields.
  • Visual Consistency: Maintain consistent layout, iconography, and interaction patterns across the application.
  • Contextual Help: Provide tooltips and inline help text for complex fields or concepts.
  • Sensible Defaults: Pre-fill common or recommended values where appropriate to reduce user input.
  • Undo/Redo Functionality: Essential for visual builders to correct mistakes easily.

5.2 Feedback & Validation

  • Real-time Validation: Provide immediate feedback on form inputs (e.g., "Required field," "Invalid format").
  • Progress Indicators: Use spinners, progress bars, or toasts for asynchronous operations (e.g., "Generating Terraform code...", "Saving project...").
  • Clear Error Messages: Explain what went wrong and how to fix it, rather than generic error codes.
  • Confirmation Dialogs: For destructive actions (e.g., deleting a project, overwriting code).

5.3 Scalability & Modularity

  • Search & Filtering: Implement robust search and filtering capabilities for resources, modules, and projects.
  • Module Library: Encourage and facilitate the creation and reuse of custom Terraform modules within the UI.
  • Templating: Provide starter templates for common architectures to accelerate project creation.
  • Layered Complexity: Allow users to start with a high-level overview and progressively drill down into detailed configurations.

5.4 Version Control Integration

  • Seamless Git Workflow: Make creating branches, committing changes, and opening pull requests as straightforward as possible.
  • Diff Previews: When generating a PR, show a clear diff of the changes to be committed.
  • Authentication: Support various Git authentication methods (OAuth, SSH keys, personal access tokens).

5

terraform_infrastructure_build.md
Download as Markdown
Copy all content
Full output as text
Download ZIP
IDE-ready project ZIP
Copy share link
Permanent URL for this run
Get Embed Code
Embed this result on any website
Print / Save PDF
Use browser print dialog
\n\n\n"); var hasSrcMain=Object.keys(extracted).some(function(k){return k.indexOf("src/main")>=0;}); if(!hasSrcMain) zip.file(folder+"src/main."+ext,"import React from 'react'\nimport ReactDOM from 'react-dom/client'\nimport App from './App'\nimport './index.css'\n\nReactDOM.createRoot(document.getElementById('root')!).render(\n \n \n \n)\n"); var hasSrcApp=Object.keys(extracted).some(function(k){return k==="src/App."+ext||k==="App."+ext;}); if(!hasSrcApp) zip.file(folder+"src/App."+ext,"import React from 'react'\nimport './App.css'\n\nfunction App(){\n return(\n
\n
\n

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

\n
\n
\n )\n}\nexport default App\n"); zip.file(folder+"src/index.css","*{margin:0;padding:0;box-sizing:border-box}\nbody{font-family:system-ui,-apple-system,sans-serif;background:#f0f2f5;color:#1a1a2e}\n.app{min-height:100vh;display:flex;flex-direction:column}\n.app-header{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:40px}\nh1{font-size:2.5rem;font-weight:700}\n"); zip.file(folder+"src/App.css",""); zip.file(folder+"src/components/.gitkeep",""); zip.file(folder+"src/pages/.gitkeep",""); zip.file(folder+"src/hooks/.gitkeep",""); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nnpm run dev\n\`\`\`\n\n## Build\n\`\`\`bash\nnpm run build\n\`\`\`\n\n## Open in IDE\nOpen the project folder in VS Code or WebStorm.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n"); } /* --- Vue (Vite + Composition API + TypeScript) --- */ function buildVue(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var extracted=extractCode(panelTxt); zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "0.0.0",\n "type": "module",\n "scripts": {\n "dev": "vite",\n "build": "vue-tsc -b && vite build",\n "preview": "vite preview"\n },\n "dependencies": {\n "vue": "^3.5.13",\n "vue-router": "^4.4.5",\n "pinia": "^2.3.0",\n "axios": "^1.7.9"\n },\n "devDependencies": {\n "@vitejs/plugin-vue": "^5.2.1",\n "typescript": "~5.7.3",\n "vite": "^6.0.5",\n "vue-tsc": "^2.2.0"\n }\n}\n'); zip.file(folder+"vite.config.ts","import { defineConfig } from 'vite'\nimport vue from '@vitejs/plugin-vue'\nimport { resolve } from 'path'\n\nexport default defineConfig({\n plugins: [vue()],\n resolve: { alias: { '@': resolve(__dirname,'src') } }\n})\n"); zip.file(folder+"tsconfig.json",'{"files":[],"references":[{"path":"./tsconfig.app.json"},{"path":"./tsconfig.node.json"}]}\n'); zip.file(folder+"tsconfig.app.json",'{\n "compilerOptions":{\n "target":"ES2020","useDefineForClassFields":true,"module":"ESNext","lib":["ES2020","DOM","DOM.Iterable"],\n "skipLibCheck":true,"moduleResolution":"bundler","allowImportingTsExtensions":true,\n "isolatedModules":true,"moduleDetection":"force","noEmit":true,"jsxImportSource":"vue",\n "strict":true,"paths":{"@/*":["./src/*"]}\n },\n "include":["src/**/*.ts","src/**/*.d.ts","src/**/*.tsx","src/**/*.vue"]\n}\n'); zip.file(folder+"env.d.ts","/// \n"); zip.file(folder+"index.html","\n\n\n \n \n "+slugTitle(pn)+"\n\n\n
\n \n\n\n"); var hasMain=Object.keys(extracted).some(function(k){return k==="src/main.ts"||k==="main.ts";}); if(!hasMain) zip.file(folder+"src/main.ts","import { createApp } from 'vue'\nimport { createPinia } from 'pinia'\nimport App from './App.vue'\nimport './assets/main.css'\n\nconst app = createApp(App)\napp.use(createPinia())\napp.mount('#app')\n"); var hasApp=Object.keys(extracted).some(function(k){return k.indexOf("App.vue")>=0;}); if(!hasApp) zip.file(folder+"src/App.vue","\n\n\n\n\n"); zip.file(folder+"src/assets/main.css","*{margin:0;padding:0;box-sizing:border-box}body{font-family:system-ui,sans-serif;background:#fff;color:#213547}\n"); zip.file(folder+"src/components/.gitkeep",""); zip.file(folder+"src/views/.gitkeep",""); zip.file(folder+"src/stores/.gitkeep",""); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nnpm run dev\n\`\`\`\n\n## Build\n\`\`\`bash\nnpm run build\n\`\`\`\n\nOpen in VS Code or WebStorm.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n"); } /* --- Angular (v19 standalone) --- */ function buildAngular(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var sel=pn.replace(/_/g,"-"); var extracted=extractCode(panelTxt); zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "0.0.0",\n "scripts": {\n "ng": "ng",\n "start": "ng serve",\n "build": "ng build",\n "test": "ng test"\n },\n "dependencies": {\n "@angular/animations": "^19.0.0",\n "@angular/common": "^19.0.0",\n "@angular/compiler": "^19.0.0",\n "@angular/core": "^19.0.0",\n "@angular/forms": "^19.0.0",\n "@angular/platform-browser": "^19.0.0",\n "@angular/platform-browser-dynamic": "^19.0.0",\n "@angular/router": "^19.0.0",\n "rxjs": "~7.8.0",\n "tslib": "^2.3.0",\n "zone.js": "~0.15.0"\n },\n "devDependencies": {\n "@angular-devkit/build-angular": "^19.0.0",\n "@angular/cli": "^19.0.0",\n "@angular/compiler-cli": "^19.0.0",\n "typescript": "~5.6.0"\n }\n}\n'); zip.file(folder+"angular.json",'{\n "$schema": "./node_modules/@angular/cli/lib/config/schema.json",\n "version": 1,\n "newProjectRoot": "projects",\n "projects": {\n "'+pn+'": {\n "projectType": "application",\n "root": "",\n "sourceRoot": "src",\n "prefix": "app",\n "architect": {\n "build": {\n "builder": "@angular-devkit/build-angular:application",\n "options": {\n "outputPath": "dist/'+pn+'",\n "index": "src/index.html",\n "browser": "src/main.ts",\n "tsConfig": "tsconfig.app.json",\n "styles": ["src/styles.css"],\n "scripts": []\n }\n },\n "serve": {"builder":"@angular-devkit/build-angular:dev-server","configurations":{"production":{"buildTarget":"'+pn+':build:production"},"development":{"buildTarget":"'+pn+':build:development"}},"defaultConfiguration":"development"}\n }\n }\n }\n}\n'); zip.file(folder+"tsconfig.json",'{\n "compileOnSave": false,\n "compilerOptions": {"baseUrl":"./","outDir":"./dist/out-tsc","forceConsistentCasingInFileNames":true,"strict":true,"noImplicitOverride":true,"noPropertyAccessFromIndexSignature":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"paths":{"@/*":["src/*"]},"skipLibCheck":true,"esModuleInterop":true,"sourceMap":true,"declaration":false,"experimentalDecorators":true,"moduleResolution":"bundler","importHelpers":true,"target":"ES2022","module":"ES2022","useDefineForClassFields":false,"lib":["ES2022","dom"]},\n "references":[{"path":"./tsconfig.app.json"}]\n}\n'); zip.file(folder+"tsconfig.app.json",'{\n "extends":"./tsconfig.json",\n "compilerOptions":{"outDir":"./dist/out-tsc","types":[]},\n "files":["src/main.ts"],\n "include":["src/**/*.d.ts"]\n}\n'); zip.file(folder+"src/index.html","\n\n\n \n "+slugTitle(pn)+"\n \n \n \n\n\n \n\n\n"); zip.file(folder+"src/main.ts","import { bootstrapApplication } from '@angular/platform-browser';\nimport { appConfig } from './app/app.config';\nimport { AppComponent } from './app/app.component';\n\nbootstrapApplication(AppComponent, appConfig)\n .catch(err => console.error(err));\n"); zip.file(folder+"src/styles.css","* { margin: 0; padding: 0; box-sizing: border-box; }\nbody { font-family: system-ui, -apple-system, sans-serif; background: #f9fafb; color: #111827; }\n"); var hasComp=Object.keys(extracted).some(function(k){return k.indexOf("app.component")>=0;}); if(!hasComp){ zip.file(folder+"src/app/app.component.ts","import { Component } from '@angular/core';\nimport { RouterOutlet } from '@angular/router';\n\n@Component({\n selector: 'app-root',\n standalone: true,\n imports: [RouterOutlet],\n templateUrl: './app.component.html',\n styleUrl: './app.component.css'\n})\nexport class AppComponent {\n title = '"+pn+"';\n}\n"); zip.file(folder+"src/app/app.component.html","
\n
\n

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

\n
\n \n
\n"); zip.file(folder+"src/app/app.component.css",".app-header{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:60vh;gap:16px}h1{font-size:2.5rem;font-weight:700;color:#6366f1}\n"); } zip.file(folder+"src/app/app.config.ts","import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';\nimport { provideRouter } from '@angular/router';\nimport { routes } from './app.routes';\n\nexport const appConfig: ApplicationConfig = {\n providers: [\n provideZoneChangeDetection({ eventCoalescing: true }),\n provideRouter(routes)\n ]\n};\n"); zip.file(folder+"src/app/app.routes.ts","import { Routes } from '@angular/router';\n\nexport const routes: Routes = [];\n"); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nng serve\n# or: npm start\n\`\`\`\n\n## Build\n\`\`\`bash\nng build\n\`\`\`\n\nOpen in VS Code with Angular Language Service extension.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n.angular/\n"); } /* --- Python --- */ function buildPython(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^\`\`\`[\w]*\n?/m,"").replace(/\n?\`\`\`$/m,"").trim(); var reqMap={"numpy":"numpy","pandas":"pandas","sklearn":"scikit-learn","tensorflow":"tensorflow","torch":"torch","flask":"flask","fastapi":"fastapi","uvicorn":"uvicorn","requests":"requests","sqlalchemy":"sqlalchemy","pydantic":"pydantic","dotenv":"python-dotenv","PIL":"Pillow","cv2":"opencv-python","matplotlib":"matplotlib","seaborn":"seaborn","scipy":"scipy"}; var reqs=[]; Object.keys(reqMap).forEach(function(k){if(src.indexOf("import "+k)>=0||src.indexOf("from "+k)>=0)reqs.push(reqMap[k]);}); var reqsTxt=reqs.length?reqs.join("\n"):"# add dependencies here\n"; zip.file(folder+"main.py",src||"# "+title+"\n# Generated by PantheraHive BOS\n\nprint(title+\" loaded\")\n"); zip.file(folder+"requirements.txt",reqsTxt); zip.file(folder+".env.example","# Environment variables\n"); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n\`\`\`\n\n## Run\n\`\`\`bash\npython main.py\n\`\`\`\n"); zip.file(folder+".gitignore",".venv/\n__pycache__/\n*.pyc\n.env\n.DS_Store\n"); } /* --- Node.js --- */ function buildNode(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^\`\`\`[\w]*\n?/m,"").replace(/\n?\`\`\`$/m,"").trim(); var depMap={"mongoose":"^8.0.0","dotenv":"^16.4.5","axios":"^1.7.9","cors":"^2.8.5","bcryptjs":"^2.4.3","jsonwebtoken":"^9.0.2","socket.io":"^4.7.4","uuid":"^9.0.1","zod":"^3.22.4","express":"^4.18.2"}; var deps={}; Object.keys(depMap).forEach(function(k){if(src.indexOf(k)>=0)deps[k]=depMap[k];}); if(!deps["express"])deps["express"]="^4.18.2"; var pkgJson=JSON.stringify({"name":pn,"version":"1.0.0","main":"src/index.js","scripts":{"start":"node src/index.js","dev":"nodemon src/index.js"},"dependencies":deps,"devDependencies":{"nodemon":"^3.0.3"}},null,2)+"\n"; zip.file(folder+"package.json",pkgJson); var fallback="const express=require(\"express\");\nconst app=express();\napp.use(express.json());\n\napp.get(\"/\",(req,res)=>{\n res.json({message:\""+title+" API\"});\n});\n\nconst PORT=process.env.PORT||3000;\napp.listen(PORT,()=>console.log(\"Server on port \"+PORT));\n"; zip.file(folder+"src/index.js",src||fallback); zip.file(folder+".env.example","PORT=3000\n"); zip.file(folder+".gitignore","node_modules/\n.env\n.DS_Store\n"); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\n\`\`\`\n\n## Run\n\`\`\`bash\nnpm run dev\n\`\`\`\n"); } /* --- Vanilla HTML --- */ function buildVanillaHtml(zip,folder,app,code){ var title=slugTitle(app); var isFullDoc=code.trim().toLowerCase().indexOf("=0||code.trim().toLowerCase().indexOf("=0; var indexHtml=isFullDoc?code:"\n\n\n\n\n"+title+"\n\n\n\n"+code+"\n\n\n\n"; zip.file(folder+"index.html",indexHtml); zip.file(folder+"style.css","/* "+title+" — styles */\n*{margin:0;padding:0;box-sizing:border-box}\nbody{font-family:system-ui,-apple-system,sans-serif;background:#fff;color:#1a1a2e}\n"); zip.file(folder+"script.js","/* "+title+" — scripts */\n"); zip.file(folder+"assets/.gitkeep",""); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Open\nDouble-click \`index.html\` in your browser.\n\nOr serve locally:\n\`\`\`bash\nnpx serve .\n# or\npython3 -m http.server 3000\n\`\`\`\n"); zip.file(folder+".gitignore",".DS_Store\nnode_modules/\n.env\n"); } /* ===== MAIN ===== */ var sc=document.createElement("script"); sc.src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"; sc.onerror=function(){ if(lbl)lbl.textContent="Download ZIP"; alert("JSZip load failed — check connection."); }; sc.onload=function(){ var zip=new JSZip(); var base=(_phFname||"output").replace(/\.[^.]+$/,""); var app=base.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")||"my_app"; var folder=app+"/"; var vc=document.getElementById("panel-content"); var panelTxt=vc?(vc.innerText||vc.textContent||""):""; var lang=detectLang(_phCode,panelTxt); if(_phIsHtml){ buildVanillaHtml(zip,folder,app,_phCode); } else if(lang==="flutter"){ buildFlutter(zip,folder,app,_phCode,panelTxt); } else if(lang==="react-native"){ buildReactNative(zip,folder,app,_phCode,panelTxt); } else if(lang==="swift"){ buildSwift(zip,folder,app,_phCode,panelTxt); } else if(lang==="kotlin"){ buildKotlin(zip,folder,app,_phCode,panelTxt); } else if(lang==="react"){ buildReact(zip,folder,app,_phCode,panelTxt); } else if(lang==="vue"){ buildVue(zip,folder,app,_phCode,panelTxt); } else if(lang==="angular"){ buildAngular(zip,folder,app,_phCode,panelTxt); } else if(lang==="python"){ buildPython(zip,folder,app,_phCode); } else if(lang==="node"){ buildNode(zip,folder,app,_phCode); } else { /* Document/content workflow */ var title=app.replace(/_/g," "); var md=_phAll||_phCode||panelTxt||"No content"; zip.file(folder+app+".md",md); var h=""+title+""; h+="

"+title+"

"; var hc=md.replace(/&/g,"&").replace(//g,">"); hc=hc.replace(/^### (.+)$/gm,"

$1

"); hc=hc.replace(/^## (.+)$/gm,"

$1

"); hc=hc.replace(/^# (.+)$/gm,"

$1

"); hc=hc.replace(/\*\*(.+?)\*\*/g,"$1"); hc=hc.replace(/\n{2,}/g,"

"); h+="

"+hc+"

Generated by PantheraHive BOS
"; zip.file(folder+app+".html",h); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\nFiles:\n- "+app+".md (Markdown)\n- "+app+".html (styled HTML)\n"); } zip.generateAsync({type:"blob"}).then(function(blob){ var a=document.createElement("a"); a.href=URL.createObjectURL(blob); a.download=app+".zip"; a.click(); URL.revokeObjectURL(a.href); if(lbl)lbl.textContent="Download ZIP"; }); }; document.head.appendChild(sc); } function phShare(){navigator.clipboard.writeText(window.location.href).then(function(){var el=document.getElementById("ph-share-lbl");if(el){el.textContent="Link copied!";setTimeout(function(){el.textContent="Copy share link";},2500);}});}function phEmbed(){var runId=window.location.pathname.split("/").pop().replace(".html","");var embedUrl="https://pantherahive.com/embed/"+runId;var code='';navigator.clipboard.writeText(code).then(function(){var el=document.getElementById("ph-embed-lbl");if(el){el.textContent="Embed code copied!";setTimeout(function(){el.textContent="Get Embed Code";},2500);}});}