Mobile App Wireframe Kit
Run ID: 69cbbd1261b1021a29a8bde12026-03-31Design
PantheraHive BOS
BOS Dashboard

Generate a complete mobile app wireframe specification with screen flows, component library, interaction patterns, and developer handoff notes.

Mobile App Wireframe Kit: Architecture Plan

This document outlines the architectural plan for a comprehensive Mobile App Wireframe Kit. This plan establishes the foundational structure, component definitions, interaction patterns, and organizational principles to ensure the kit is robust, reusable, scalable, and facilitates efficient wireframing and seamless developer handoff.


1. Introduction & Core Principles

The purpose of this architecture plan is to define the backbone of a high-quality Mobile App Wireframe Kit. This kit will serve as a foundational tool for rapidly sketching, iterating, and communicating mobile application concepts in a low-fidelity format.

Core Principles:

  • Reusability: Components and patterns are designed for maximum reusability across different projects and screens.
  • Consistency: A unified visual language and interaction model (even in low-fidelity) ensures clarity and reduces ambiguity.
  • Scalability: The architecture supports easy expansion with new components, screens, and interaction patterns.
  • Clarity: Wireframes created with this kit will clearly communicate user flows, screen layouts, and fundamental interactions.
  • Efficiency: Designed to accelerate the wireframing process, allowing designers to focus on problem-solving rather than recreating basic elements.
  • Developer Handoff Ready: Structured with developer needs in mind, facilitating easier interpretation and implementation.

2. Kit Structure & Organization

The Mobile App Wireframe Kit will be organized logically within the design tool (e.g., Figma, Sketch, Adobe XD) using dedicated pages or sections for different asset types.

2.1. Top-Level Organization (Pages/Sections):

  • 00. Start Here / Read Me: Introduction, usage guidelines, version history, and contact information.
  • 01. Foundations: Grid system, spacing, typography, color palette (grayscale), placeholder iconography.
  • 02. UI Components (Atomic): Individual, reusable UI elements (buttons, inputs, etc.).
  • 03. UI Modules (Molecules/Organisms): Combinations of atomic components forming larger, functional units (e.g., navigation bars, cards, forms).
  • 04. Screen Templates: Common mobile app screen layouts (e.g., Login, Profile, Dashboard, Detail View).
  • 05. Interaction Patterns: Common mobile gestures and UI interactions.
  • 06. Flow Examples: Pre-built examples of common user flows.
  • 07. Project Wireframes: Dedicated space for creating and managing project-specific wireframes. (Often a separate file or user-managed pages).

2.2. Naming Conventions:

  • Pages: Numbered prefixes for logical ordering (e.g., 01. Foundations, 02. UI Components).
  • Components/Symbols: Hierarchical naming using slashes (e.g., Button/Primary/Default, Input Field/Text/Default).
  • Layers: Clear, descriptive names that reflect content or function (e.g., Text Label, Icon/Arrow Left).
  • States: Explicitly named states (e.g., /Default, /Active, /Disabled, /Error).

3. Component Library Architecture

The core of the wireframe kit will be a robust, modular component library, following principles similar to Atomic Design.

3.1. Component Hierarchy:

  • Atoms: Basic HTML elements or UI elements that cannot be broken down further without losing their meaning (e.g., Button, Input Field, Icon, Avatar, Text Label).
  • Molecules: Groups of atoms bonded together to form a relatively simple, reusable UI component (e.g., Search Bar (Input + Button + Icon), Navigation Item (Text + Icon)).
  • Organisms: Groups of molecules and/or atoms joined together to form a more complex, distinct section of an interface (e.g., Header Bar, Product Card, List Item with multiple actions).
  • Templates (Screen Templates): Page-level objects that place components into a layout, focusing on content structure rather than final content. These are wireframe layouts without specific data.
  • Pages (Project Wireframes): Specific instances of templates with real placeholder content, demonstrating actual user journeys.

3.2. Key Component Categories (Examples):

  • Buttons: Primary, Secondary, Tertiary, Icon Button, Text Button (various sizes, states: default, pressed, disabled, loading).
  • Input Fields: Text, Password, Number, Email, Search, Text Area, Date Picker (various states: default, focused, error, disabled, filled).
  • Navigation: Tab Bar, Bottom Navigation, Top App Bar, Drawer/Sidebar, Breadcrumbs.
  • Lists: Simple List Item, List Item with Icon, List Item with Avatar, Swipeable List Item, Expandable List Item.
  • Cards: Basic Card, Image Card, Product Card, Article Card.
  • Media: Image Placeholder, Video Placeholder, Avatar.
  • Indicators: Progress Bar, Spinner, Badge, Toast/Snackbar.
  • Modals & Sheets: Dialog, Bottom Sheet, Action Sheet, Full-screen Modal.
  • Selection Controls: Checkbox, Radio Button, Toggle Switch (various states).
  • Placeholders: Text lines (single/multi), Image boxes, Skeleton loaders.

3.3. Component States & Variants:

Each component will include defined states and variants to cover common scenarios:

  • States: Default, Hover (if applicable), Pressed/Active, Focused, Disabled, Error, Loading, Empty.
  • Variants: Size (Small, Medium, Large), Type (Primary, Secondary), Icon presence (Left, Right, None), Content (Text, Icon, Both).

4. Screen Flow Architecture**

The kit will support the clear articulation of user journeys and screen-to-screen navigation.

4.1. Common Flow Patterns:

  • Onboarding: Welcome, Feature Tour, Permissions.
  • Authentication: Sign Up, Login, Forgot Password, OTP Verification.
  • Data Entry: Form submission, Profile editing.
  • Information Display: Detail View, List View, Search Results.
  • Action & Confirmation: Add to Cart, Purchase Flow, Confirmation Screens.
  • Settings & Preferences: User settings, App settings.

4.2. Navigation Models:

The kit will include components and patterns to represent standard mobile navigation:

  • Tab-based Navigation: Bottom Tab Bar.
  • Stack Navigation: Headers with back buttons, title, and actions.
  • Drawer Navigation: Side menus.
  • Modal Navigation: Full-screen or partial overlays.

4.3. Interaction Triggers & Annotations:

  • Clear Hotspots: Interactive areas will be clearly marked (e.g., clickable buttons, tappable list items).
  • Flow Arrows: Standardized arrows and connectors to indicate screen transitions.
  • Annotation System: A consistent method for adding textual notes directly onto wireframes to describe interactions, specific logic, error states, or conditional visibility. This will use a dedicated annotation component (e.g., a numbered sticky note or text box).

5. Interaction Patterns Library

Beyond basic navigation, the kit will define common mobile interaction patterns to guide user experience.

5.1. Fundamental Patterns:

  • Tap: Standard button/link activation.
  • Long Press: Contextual menus, drag activation.
  • Swipe: Navigation (e.g., carousels), dismiss (e.g., list items), pull-to-refresh.
  • Drag & Drop: Reordering lists, moving elements.
  • Pinch/Zoom: Image manipulation.

5.2. Advanced Patterns:

  • Pull-to-Refresh: Indicated by a loading spinner at the top of a scrollable area.
  • Lazy Loading/Infinite Scroll: Placeholder for additional content loading.
  • Accordions/Expandable Sections: Components demonstrating open/closed states.
  • Carousels/Sliders: Indicated by pagination dots and swipe gestures.
  • Modals/Sheets: Overlay components for critical actions or supplementary information.
  • Empty States: Dedicated wireframes or components showing what a screen looks like when there is no content.
  • Error States: Visual indicators for input errors, network issues, or other system failures.

5.3. Representing Interaction Intent:

  • Low-Fidelity Animations: While not fully animated, the intent of animations (e.g., slide in, fade out) can be conveyed through annotations and sequential wireframes.
  • State Changes: Showing before and after states for interactions like toggles, checkboxes, or input focus.

6. Styling & Theming (Wireframe Level)

The kit will adhere to a consistent low-fidelity visual language.

6.1. Grayscale Palette:

  • A defined set of grayscale values (e.g., Grey-900 for primary text, Grey-500 for secondary, Grey-200 for backgrounds, Grey-100 for borders) to establish visual hierarchy without introducing color distractions.
  • A single accent color (e.g., a light blue) may be used sparingly to highlight interactive elements or primary actions in a low-fidelity context.

6.2. Typography:

  • Placeholder fonts (e.g., Roboto, Inter, system default) with a defined scale for headings, body text, captions, and buttons.
  • Emphasis on hierarchy using font size and weight rather than specific font families.

6.3. Spacing & Grid System:

  • A consistent 4pt or 8pt baseline grid system for all components and layouts to ensure alignment and rhythm.
  • Defined spacing tokens (e.g., Space-XS, Space-SM, Space-MD, Space-LG) for internal component padding and external margins.

6.4. Iconography:

  • Placeholder icons (e.g., simple outlines, common symbols like arrows, home, settings) to represent functionality without committing to a specific icon set.

7. Developer Handoff & Documentation Strategy

The architecture will incorporate practices to streamline the handoff process.

7.1. Clear Annotations:

  • Every wireframe and flow will utilize the standardized annotation system to explain functionality, conditional logic, states, and user interactions.
  • Annotations will describe what happens, when it happens, and why it happens.

7.2. Consistent Naming:

  • Component and layer naming will be consistent and descriptive, aiming for alignment with potential front-end component names.
  • Example: A button component named Button/Primary/Default in the design tool corresponds to a PrimaryButton in code.

7.3. Documenting Screen States:

  • Each relevant screen will have variants or accompanying notes illustrating its different states:

* Empty State: What the screen looks like with no data.

* Loading State: How content appears while loading.

* Error State: How errors are communicated (e.g., network error, form validation error).

* Partial Data State: If applicable, how a screen looks with incomplete information.

7.4. Version Control:

  • Leverage the design tool's built-in version history for tracking changes.
  • Establish a clear process for major updates to the kit, including release notes.

8. Scalability & Maintenance

The kit is designed for long-term use and evolution.

8.1. Future Expansion:

  • The modular component structure allows for easy addition of new components, modules, and screen templates without disrupting
gemini Output

This deliverable provides a comprehensive mobile app wireframe specification, detailing screen flows, a reusable component library, interaction patterns, and essential developer handoff notes. This structured output is designed to serve as a definitive guide for design and development teams, ensuring clarity and consistency throughout the implementation phase.


Mobile App Wireframe Kit Specification

This document outlines the complete wireframe specification for your mobile application. It is presented in a structured JSON format, accompanied by detailed explanations, making it a "production-ready" blueprint for development.

1. Introduction

The following JSON object represents a complete, machine-readable specification for the mobile application's wireframes. It includes metadata, a defined set of UI components, a list of application screens with their respective component layouts, a description of user interaction patterns, and the logical screen flows. This structured approach facilitates automated processing, consistency checking, and direct interpretation by development tools or engineers.

2. Specification Structure Overview

The core of this deliverable is a single JSON object with the following top-level keys:

  • metadata: General information about the wireframe kit.
  • componentLibrary: Definitions of reusable UI components.
  • screens: Definitions of individual application screens, including their layouts.
  • interactionPatterns: Descriptions of how users interact with components and the system.
  • screenFlows: Logical sequences of screens based on user interactions.
  • developerHandoffNotes: Crucial instructions and recommendations for developers.

3. Detailed Specification & Code Output

Below is the complete JSON specification, designed for direct consumption by development teams. Each section is commented within the JSON for clarity, and further explanations are provided in the markdown.


{
  // Metadata about this wireframe kit specification.
  "metadata": {
    "kitName": "Mobile App Wireframe Kit",
    "version": "1.0.0",
    "dateGenerated": "2023-10-27",
    "description": "Comprehensive specification for mobile app wireframes, including screen flows, component library, and interaction patterns. This serves as a blueprint for development."
  },

  // Defines a reusable library of UI components.
  // Each component has an ID, name, type, description, properties, and an example.
  "componentLibrary": [
    {
      "id": "button_primary",
      "name": "Primary Button",
      "type": "Button",
      "description": "Main call-to-action button, typically used for primary actions on a screen.",
      "properties": {
        "label": {"type": "string", "default": "
gemini Output

Mobile App Wireframe Kit: Complete Specification

Project: Mobile App Wireframe Kit

Deliverable: Complete Wireframe Specification

Date: October 26, 2023


1. Introduction and Purpose

This document provides a comprehensive wireframe specification for a mobile application, serving as a foundational blueprint for its design and development. It details the app's structural layout, user flows, core components, and interaction patterns, ensuring a clear understanding of functionality before visual design and development commence.

The primary goals of this specification are:

  • To outline the app's key screens and their interconnections.
  • To define a consistent set of UI components for efficient design and development.
  • To describe essential user interactions and system behaviors.
  • To provide clear guidelines for developers, facilitating a smooth handoff and implementation process.

This document is a living artifact and will be updated as the project evolves.


2. Screen Flows

This section details the primary user journeys within the mobile application, illustrating the sequence of screens a user will navigate to complete specific tasks. Each flow outlines the entry point, key screens involved, user actions, and the logical progression.

Note: Specific screen names and details are placeholders and should be replaced with actual app-specific content.

2.1. User Onboarding & Account Creation Flow

  • Objective: Allow new users to sign up or existing users to log in.
  • Screens Involved:

* Splash Screen: (Initial app launch)

* Welcome/Onboarding Screens (3-5 screens): Introduction to app's core value proposition.

Action:* Swipe left/right, "Skip" button.

* Login/Signup Selection Screen: Option to "Log In" or "Sign Up".

Action:* Tap "Log In" / "Sign Up".

* Sign Up Screen: Collect user details (email, password, name).

Action:* Input fields, "Create Account" button.

* Login Screen: Collect credentials (email/username, password).

Action:* Input fields, "Log In" button, "Forgot Password" link.

* Account Verification Screen (Optional): OTP or email verification.

Action:* Input OTP, "Verify" button.

* Profile Setup Screen (Optional): Add profile picture, preferences.

Action:* Upload image, select options, "Complete Setup" button.

* Home Screen: Upon successful login/signup.

2.2. Main Feature X Usage Flow (e.g., "Create New Post")

  • Objective: Enable users to utilize the app's primary function.
  • Screens Involved:

* Home Screen: User initiates the action.

Action:* Tap "New Post" button (e.g., floating action button).

* Content Creation Screen: Input text, add images/video, tags.

Action:* Input text field, "Add Media" button, "Select Tags" button.

* Media Selection Screen: Gallery access, camera capture.

Action:* Select images/videos, "Take Photo" button.

* Preview/Edit Screen: Review content before publishing.

Action:* Edit content, "Publish" button, "Save Draft" button.

* Confirmation/Success Screen (Optional): Brief confirmation.

* Home Screen / User Profile: Return to main view or view new post.

2.3. User Profile Management Flow

  • Objective: Allow users to view and edit their profile information and settings.
  • Screens Involved:

* Home Screen / Navigation Menu: Access profile.

Action:* Tap profile icon/menu item.

* User Profile Screen: Displays user info, posts, activity.

Action:* Tap "Edit Profile" button, "Settings" icon.

* Edit Profile Screen: Update name, bio, profile picture, etc.

Action:* Input fields, "Save Changes" button.

* Settings Screen: General app settings (notifications, privacy, logout).

Action:* Toggle switches, tap menu items (e.g., "Change Password").

* Change Password Screen: Input current and new password.

Action:* Input fields, "Update Password" button.

* Logout Confirmation Modal: Confirm user wants to log out.

Action:* "Yes, Log Out" / "Cancel" buttons.


3. Wireframe Specification Template (Per Screen)

For each screen identified in the flows, a detailed wireframe specification will be provided. This section outlines the standard structure for each screen's documentation.

[SCREEN NAME/ID]

  • Unique ID: SCR-001 (e.g., SCR-HOME, SCR-LOGIN)
  • Purpose: Briefly describe the screen's main objective and what the user can accomplish here.
  • Key Elements:

* Header: Title, back button, menu icon, search icon, etc.

* Navigation: Tab bar, bottom navigation, side drawer.

* Content Area: Main interactive elements (lists, cards, forms, images).

* Footer/FAB: Floating action button, persistent footer.

  • User Interactions:

* List all possible user actions on this screen (e.g., tap button, swipe list, input text).

* Specify the expected system response for each interaction.

  • Navigation:

* From: Which screens can lead to this screen?

* To: Which screens can this screen navigate to?

  • States (Optional):

* Empty State: What does the screen look like with no data?

* Loading State: How is data loading indicated?

* Error State: How are errors displayed?

  • Notes: Any specific considerations for this screen (e.g., data validation rules, platform-specific behaviors).
  • Visual Wireframe: (Placeholder for actual wireframe image/link)

Example:* [Link to Figma/Sketch/XD wireframe for SCR-001]


4. Component Library

This section defines the reusable UI components that will form the building blocks of the mobile application. Each component includes its name, description, states, and usage guidelines to ensure consistency across the app.

4.1. Buttons

  • Description: Interactive elements that trigger an action.
  • Types:

* Primary Button: Main call to action (e.g., "Submit," "Continue").

States:* Default, Hover (web only), Pressed, Disabled, Loading.

* Secondary Button: Less prominent actions (e.g., "Cancel," "Learn More").

States:* Default, Hover (web only), Pressed, Disabled.

* Tertiary/Ghost Button: Minimal styling, often text-only (e.g., "Skip," "View All").

States:* Default, Pressed, Disabled.

* Icon Button: Button with only an icon.

States:* Default, Pressed, Disabled.

* Floating Action Button (FAB): Prominent, circular button for primary actions (e.g., "Add," "Create").

States:* Default, Pressed.

  • Usage: Use sparingly for primary actions. Maintain clear hierarchy.

4.2. Input Fields

  • Description: Areas for users to input data.
  • Types:

* Text Input: Single-line text (e.g., name, email, password).

States:* Default, Focused, Filled, Error, Disabled.

Variants:* Label (inside/outside), Placeholder text, Helper text, Clear button, Password toggle.

* Text Area: Multi-line text (e.g., comments, descriptions).

States:* Default, Focused, Filled, Error, Disabled.

* Search Input: Text input with search icon and optional clear button.

* Dropdown/Picker: Select from a predefined list (e.g., date picker, country selector).

States:* Default, Open, Selected, Disabled.

  • Usage: Provide clear labels and helpful placeholder text. Implement appropriate keyboard types.

4.3. Navigation Components

  • Description: Elements guiding users through the app.
  • Types:

* Top App Bar/Header: Contains screen title, navigation icons (back, menu), action icons (search, settings).

Variants:* With title, with search, with tabs.

* Bottom Navigation Bar: Persistent navigation for 3-5 top-level destinations.

States:* Default, Selected.

* Tab Bar (within screen): Used to switch between distinct content views within a single screen.

States:* Default, Selected.

* Side Drawer/Navigation Drawer: Hidden menu for less frequent destinations or app-wide settings.

* Breadcrumbs (Web-like, less common in mobile): Indicate current location in a hierarchy.

4.4. Cards & Lists

  • Description: Containers for related content.
  • Types:

* List Item: Single row in a list, often with title, subtitle, icon, and action.

States:* Default, Pressed, Swiped (for actions).

* Card: Flexible container for various content types (image, text, buttons).

Variants:* Media card, text card, action card.

  • Usage: Use lists for homogeneous data, cards for heterogeneous or more visually distinct items.

4.5. Modals & Dialogs

  • Description: Overlays that demand user attention for critical information or actions.
  • Types:

* Alert Dialog: Brief, critical information with limited actions (e.g., "Confirm Delete").

* Bottom Sheet: Presents a set of choices or a small amount of content from the bottom of the screen.

* Full-Screen Dialog: For complex tasks or input that requires more screen real estate.

  • Usage: Use sparingly to avoid interrupting user flow. Ensure clear dismiss actions.

4.6. Other Components

  • Checkboxes & Radio Buttons: For single or multiple selections.
  • Switches/Toggles: For on/off settings.
  • Sliders: Select a value from a range.
  • Progress Indicators: Loading spinners, progress bars.
  • Badges/Tags: Small labels for status or categorization.
  • Image Placeholders: For images that are loading or not available.
  • Avatars: User profile pictures.

5. Interaction Patterns

This section describes common interaction patterns and their expected behavior within the mobile application, ensuring a consistent and intuitive user experience.

5.1. Tapping & Pressing

  • Single Tap: Activates buttons, selects list items, opens new screens.
  • Long Press: Reveals contextual menus or enables selection mode (e.g., for multiple item selection).
  • Double Tap: Primarily for zooming in/out on images or maps.

5.2. Swiping

  • Horizontal Swipe:

* Carousel/Gallery: Navigate between images or content cards.

* Tab Navigation: Switch between tabs (less common if tabs are interactive directly).

* Dismissal: Swipe to dismiss notifications or temporary elements.

  • Vertical Swipe:

* Scrolling: Navigate through long lists or content.

* Pull-to-Refresh: Refresh content at the top of a list.

* Swipe-to-Action: Swipe left/right on list items to reveal actions (e.g., delete, archive).

5.3. Gestures

  • Pinch-to-Zoom: Enlarge or shrink content (images, maps).
  • Drag-and-Drop: Reorder list items, move elements (less common for core app interactions).

5.4. Form Submissions & Validation

  • Submission: Tapping a primary button (e.g., "Save," "Submit") submits form data.
  • Validation:

* Real-time: Provide instant feedback for invalid input (e.g., email format, password strength).

* On Submit: Display error messages for all invalid fields if validation fails on submission.

* Clear Errors: Error messages should disappear once the user corrects the input.

5.5. Feedback & States

  • Loading States:

* Spinners/Progress Bars: For content loading or action processing.

* Skeleton Screens: Placeholder content that mimics the layout of the actual content while loading.

  • Empty States: Clear messages and optional calls-to-action when a section has no content.
  • Error States:

* Inline Error Messages: For specific field validation.

* Toast/Snackbar: Brief, temporary messages for non-critical errors or confirmations (e.g., "Network error," "Item added to cart").

* Full-Screen Error: For critical failures (e.g., "Something went wrong, please try again").

  • Confirmation: Visual feedback after a successful action (e.g., "Saved successfully," checkmark icon).

5.6. Notifications

  • Push Notifications: System-level alerts for critical updates or engagement.
  • In-App Notifications: Banners or badges within the app for less critical updates.

6. Developer Handoff Notes

This section provides essential information and guidelines for the development team to ensure a smooth transition from design to implementation and to maintain the integrity of the app's vision.

6.1. Design System & Component Usage

  • Component-Based Development: Emphasize building reusable components as defined in the "Component Library" section.
  • Consistency: Encourage strict adherence to the defined components, states, and interaction patterns to ensure a unified user experience. Avoid creating custom components unless absolutely necessary and approved by the design team.
  • Naming Conventions: Align component and variable naming with the design system where possible.

6.2. Responsive & Adaptive Design

  • Screen Sizes: The wireframes are designed with a typical mobile viewport in mind. Developers should consider how layouts and components adapt to various mobile screen sizes (e.g., small phones, large phones, tablets if in scope).
  • Orientation: Consider how the app behaves in both portrait and landscape orientations. If landscape is not supported, ensure the app is locked to portrait.
  • Platform Guidelines:

* iOS (Human Interface Guidelines): Adhere to Apple's guidelines for navigation, gestures, typography, and common UI patterns to provide a native feel.

* Android (Material Design): Adhere to Google's Material Design principles for visual, motion, and interaction design to provide a native Android experience.

* Cross-Platform Considerations: For hybrid or cross-platform apps, prioritize platform-agnostic patterns where possible, but be prepared to implement platform-specific nuances where appropriate.

6.3. Accessibility (A11y)

  • Semantic HTML/Widgets: Use appropriate semantic elements
mobile_app_wireframe_kit.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);}});}