Mobile App Wireframe Kit
Run ID: 69cd158e3e7fb09ff16a7cf22026-04-01Design
PantheraHive BOS
BOS Dashboard

Mobile App Wireframe Kit: Complete Specification

This document provides a comprehensive wireframe specification for a mobile application, outlining screen flows, a reusable component library, interaction patterns, and crucial developer handoff notes. This serves as a foundational blueprint for design and development, ensuring a clear understanding of the application's structure and user experience.


1. Introduction

Project Name: [Your Mobile App Name Here - e.g., "PantheraConnect Social App"]

Document Version: 1.0

Date: October 26, 2023

Purpose: This document specifies the low-fidelity wireframes, defining the structural layout, information hierarchy, and basic user interactions for the mobile application. It is intended to facilitate communication between design, product, and development teams, serving as a critical reference point before high-fidelity design and development begins.

Target Audience: Product Managers, UI/UX Designers, Mobile Developers (iOS & Android), QA Engineers.

Scope: This specification covers the core user journeys and essential features of the mobile application, providing a detailed breakdown of screens, components, and interaction models.


2. Core App Concept & User Stories

Brief App Concept:

The application aims to provide a seamless platform for users to [briefly describe app's primary function, e.g., "connect with like-minded individuals, share their experiences, and discover local events related to wildlife conservation."]. It prioritizes user-friendly navigation and intuitive interactions.

Key User Stories (Examples):


3. Screen Flows: Core User Journeys

This section outlines the primary user flows within the application, demonstrating the sequence of screens a user will encounter for key tasks.

3.1. User Onboarding & Authentication Flow

text • 927 chars
**Description:**
1.  **Home/Dashboard:** Access profile via a dedicated icon (e.g., bottom navigation bar or top app bar).
2.  **My Profile Screen:** Displays user's public profile, posts, activities.
3.  **Edit Profile Screen:** Allows users to modify personal information (name, bio, profile picture).
4.  **Settings Screen:** Provides access to app settings (notifications, privacy, account management).
5.  **Login Screen:** Returns user to login after logging out.

---

### 4. Wireframe Specifications & Screen Structures

This section provides detailed specifications for key screens, defining their layout and primary elements. Each screen structure is presented using a hierarchical, code-like format for clarity and ease of development translation.

#### 4.1. Screen: `SplashScreen`

**Purpose:** Display app branding and load initial assets.
**Key Elements:**
*   App Logo
*   Optional: Loading Indicator, Tagline

Sandboxed live preview

Executing Step 1 of 3: gemini → plan_architecture

Workflow: Mobile App Wireframe Kit

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


Mobile App Wireframe Kit: Architectural Plan

This document outlines the foundational architecture for the "Mobile App Wireframe Kit," ensuring a structured, scalable, and easy-to-use resource for designing mobile application flows and interfaces. The architecture focuses on modularity, clarity, and seamless integration with design and development workflows.

1. Core Principles & Philosophy

The architecture of this wireframe kit is built upon the following principles:

  • Modularity: All elements (screens, components, patterns) are designed to be independent and reusable.
  • Scalability: The kit can easily accommodate new screens, components, and interaction patterns without requiring a complete overhaul.
  • Consistency: Standardized naming conventions, organizational structures, and annotation methods across the entire kit.
  • Clarity: Clear labeling, logical grouping, and intuitive navigation within the kit for all users (designers, product managers, developers).
  • Actionability: Designed to facilitate quick wireframing, clear communication, and efficient developer handoff.
  • Tool Agnostic (Conceptual): While an implementation tool will be chosen, the architectural principles are designed to be adaptable.

2. Kit Structure & Organization

The wireframe kit will be organized into logical sections, typically represented as pages or artboards within a design tool (e.g., Figma, Sketch, Adobe XD).

  • 00. Start Here / Overview:

* Purpose: Introduction to the kit, how to use it, core principles, and version control.

* Content: Welcome message, kit version, contact info, quick start guide, link to documentation.

  • 01. Global Elements / Foundations:

* Purpose: Define global styles and foundational elements used throughout the kit.

* Content:

* Typography: Font families, sizes, weights, line heights (for H1-H6, Body, Caption, etc.).

* Color Palette: Primary, secondary, accent, grayscale, semantic colors (success, warning, error).

* Spacing & Grid: Standardized spacing units (e.g., 4pt or 8pt grid), column definitions.

* Iconography: Library of common icons (system, action, navigation).

* Shadows / Elevation: Standardized shadow styles.

  • 02. Component Library:

* Purpose: A comprehensive collection of reusable UI components, categorized for easy access.

* Content:

* Atomic Components: Buttons (primary, secondary, ghost, icon), text inputs, checkboxes, radio buttons, toggles, avatars, badges.

* Molecular Components: Navigation bars (top, bottom), tab bars, cards, list items, dialogs/modals, dropdowns, date pickers, search bars.

* Organism Components: Headers, footers, complex forms, data tables (if applicable to mobile).

* States: Each component will show its various states (e.g., default, hover, active, disabled, error, focused).

* Variants: Different visual styles or configurations for a component.

  • 03. Screen Flows:

* Purpose: Demonstrate common user journeys and application flows.

* Content:

* Categorization: Flows will be grouped by feature or user journey (e.g., Onboarding Flow, Login/Auth Flow, Profile Management Flow, Product Discovery Flow, Checkout Flow).

* Flow Representation: Each flow will be a sequence of interconnected screens with clear directional arrows and annotations.

* Key Screens: Represent core app functionality and user interactions.

* Naming Convention: Consistent naming for flows and individual screens within flows (e.g., [Feature] - [Action] - [ScreenName]).

  • 04. Interaction Patterns:

* Purpose: Document common mobile interaction patterns and their expected behaviors.

* Content:

* Navigation: Global navigation, contextual navigation, breadcrumbs (if applicable).

* Input & Forms: Data entry, validation, error handling.

* Feedback: Toasts, snackbars, alerts, empty states, loading indicators.

* Gestures: Swipe, pinch, drag, long press (with visual cues/descriptions).

* Data Display: Lists, grids, carousels, expandable sections.

  • 05. Annotations & Handoff Notes:

* Purpose: Provide guidelines and templates for annotating wireframes for developer handoff.

* Content:

* Annotation Legend: Standardized symbols and colors for interactions, states, and developer notes.

* Information Hierarchy: Guidelines on what information to include (e.g., screen title, unique ID, user story, key interactions, edge cases).

* Developer Notes Template: A structure for providing clear instructions, expected behaviors, and linking to relevant component documentation.

* Measurement Guidelines: How to specify spacing, sizing, and alignment.

  • 06. Templates & Examples:

* Purpose: Provide pre-built screen templates and full application examples to kickstart new projects.

* Content:

* Common Screen Layouts: Empty state, search results, profile view, product detail, settings.

* Full App Examples: Simple example app flows demonstrating the kit's usage.

3. Component Library Architecture

The component library will follow an atomic design approach, ensuring reusability and maintainability.

  • Naming Conventions:

* Components will be named clearly and consistently (e.g., Button/Primary/Large/Enabled, Input/Text/Default, Card/Product/Horizontal).

* Use forward slashes / for grouping variants within design tools.

  • Variants & Properties:

* Each component will leverage variants to define different states (e.g., enabled, disabled, hover, focused), sizes (e.g., small, medium, large), and types (e.g., primary, secondary, icon-only).

* Boolean properties for optional elements (e.g., hasIcon: true/false).

  • Documentation:

* Each component will have a brief description of its intended use, behavior, and any specific constraints.

* Links to any relevant design system documentation or code snippets.

4. Screen Flow Architecture

  • Clear Entry & Exit Points: Each flow will clearly indicate its starting and ending screens.
  • Directional Arrows: Standardized arrows will denote user navigation paths and conditional logic.
  • Annotations: Key interactions, system responses, and conditional logic will be annotated directly on the wireframes or linked to a separate annotation section.
  • Unique Screen IDs: Every screen will have a unique identifier for easy referencing in documentation and discussions.
  • User Story Mapping: Optionally, flows can be linked to specific user stories or use cases.

5. Interaction Pattern Architecture

  • Categorization: Patterns will be grouped by functionality (e.g., Navigation, Data Input, Feedback).
  • Visual Examples: Each pattern will be illustrated with a minimal wireframe example demonstrating its usage.
  • Behavioral Description: Clear textual descriptions of how the pattern functions, user expectations, and common use cases.
  • Edge Cases: Brief notes on how the pattern handles errors, empty states, or other specific conditions.

6. Developer Handoff Architecture

  • Integrated Annotations: Handoff notes will be integrated directly into the wireframe files using a consistent annotation system.
  • Structured Notes: A standardized template for developer notes will ensure all critical information is covered (e.g., unique screen ID, feature name, key interactions, expected behavior, error states, accessibility considerations).
  • Component References: Annotations will directly reference components from the component library, including their specific variants and states.
  • Export Specifications: Guidelines for exporting assets and specifications (e.g., using design tool plugins for CSS/code snippets, spacing measurements).

7. Scalability & Maintainability

  • Modularity: New components or screens can be added without disrupting existing structures.
  • Centralized Foundations: Changes to global styles (colors, typography) will propagate automatically to all linked components and screens.
  • Version Control: The kit will be versioned, and updates will be communicated clearly, potentially with a changelog.
  • Team Collaboration: Designed for collaborative use within a design team, leveraging shared libraries and components.

8. Recommended Tooling & Format

While the architecture is conceptual, for practical implementation, a modern collaborative design tool is recommended:

  • Figma: Highly recommended due to its robust component system (variants, properties), real-time collaboration, and excellent developer handoff features (Inspect panel, plugins).
  • Alternatives: Sketch (with Libraries and Abstract for versioning), Adobe XD (with Components and Shared Links).

This architectural plan provides a solid foundation for developing a comprehensive and effective Mobile App Wireframe Kit, streamlining the design process from concept to developer handoff.

json

{

"screenName": "LoginScreen",

"layout": "vertical_stack_with_padding",

"elements": [

{

"type": "Image",

"id": "app_icon_small",

"properties": {

"src": "app_icon_small.png",

"alt": "App Icon",

"size": "medium",

"alignment": "center",

"margin_bottom": "32px"

}

},

{

"type": "TextInput",

"id": "email_input",

"properties": {

"placeholder": "Email Address",

"keyboardType": "email-address",

"autoCapitalize": "none",

"label": "Email",

"validation_rules": ["required", "email_format"]

}

},

{

"type": "TextInput",

"id": "password_input",

"properties": {

"placeholder": "Password",

"keyboardType": "default",

"secureTextEntry": true,

"label": "Password",

"validation_rules": ["required", "min_length_8"]

}

},

{

"type": "TextButton",

"id": "forgot_password_link",

"properties": {

"text": "Forgot Password?",

"alignment": "right",

"color": "accent"

},

"interactions": [

{

"event": "onPress",

"action": "navigate_to_forgot_password_screen"

}

]

},

{

"type": "Button",

"id": "login_button",

"properties": {

"text": "Log In",

"variant": "primary",

"fullWidth": true,

"margin_top": "24px"

},

"interactions": [

{

"event": "onPress",

"action": "authenticate_user",

"success_navigate_to": "HomeScreen",

"error_display": "snackbar_or_alert"

}

]

},

{

"type": "Divider",

"id": "or_divider",

"properties": {

"text": "OR",

"margin_vertical": "24px"

}

},

{

"type": "SocialLoginButton",

"id": "google_login_button",

"properties": {

"provider": "Google",

"icon": "google_icon.png"

},

"interactions": [

{

"event": "onPress",

"action": "authenticate_with_google",

"success_navigate_to": "HomeScreen"

}

]

},

{

"type": "SocialLoginButton",

"id": "facebook_login_button",

"properties": {

"provider": "Facebook",

"icon": "facebook_icon.png"

},

"interactions": [

{

"event": "onPress",

"action": "authenticate_with_facebook",

"success_navigate_to": "HomeScreen"

}

]

},

{

"type": "TextButton",

"id": "signup_link",

"properties": {

"text": "Don't have an account? Sign Up",

"alignment": "center",

"margin_top": "32px",

"color": "secondary_text"

},

"interactions": [

{

"event": "onPress",

"action": "navigate_to_signup_screen"

}

]

gemini Output

Mobile App Wireframe Kit - Complete Specification

Client: [Client Name/Project Name]

Date: October 26, 2023

Version: 1.0

Prepared By: PantheraHive


1. Introduction & Overview

This document presents the complete Mobile App Wireframe Specification, serving as a foundational blueprint for the proposed mobile application. It details the core user interface (UI) structure, user interaction flows, a reusable component library, and essential notes for development handoff.

The purpose of this kit is to:

  • Visually communicate the app's structure and functionality.
  • Define key user journeys and screen-to-screen navigation.
  • Establish a consistent set of UI components and interaction patterns.
  • Provide clear guidelines for the development team to build upon.
  • Facilitate early feedback and iteration on the app's core experience before detailed visual design and development.

This specification focuses on functionality, information hierarchy, and user experience, rather than final visual aesthetics (color, typography, high-fidelity graphics), which will be addressed in subsequent design phases.


2. General Principles & Design Philosophy

The wireframes are designed with the following core principles in mind:

  • User-Centricity: Prioritizing the user's needs, goals, and context throughout all interactions.
  • Simplicity & Clarity: Ensuring the interface is easy to understand, with clear labels, intuitive navigation, and minimal cognitive load.
  • Consistency: Maintaining uniform UI elements, interaction patterns, and information architecture across the entire application.
  • Efficiency: Streamlining user tasks and minimizing steps required to achieve desired outcomes.
  • Accessibility: Considering users with diverse abilities by adhering to basic accessibility guidelines (e.g., clear tap targets, logical focus order).
  • Scalability: Designing a flexible structure that can accommodate future features and content growth.

3. Screen Flows (User Journeys)

This section outlines critical user journeys, illustrating how users navigate through the application to accomplish specific goals. Each flow details the sequence of screens and key actions.

3.1 Flow 1: User Onboarding & Account Creation

  • Purpose: Guide new users through initial setup and account registration.
  • Screens Involved:

1. WF-001: Welcome/Intro Screens (Optional): Carousel of app benefits/features.

2. WF-002: Sign Up/Login Options: Choice between email/password, social login, or 'Continue as Guest'.

3. WF-003: Registration Form: Email, password, name, agreement to T&Cs.

4. WF-004: Email Verification: Prompt to check email for verification link.

5. WF-005: Profile Setup (Initial): Optional steps like adding a profile picture, selecting interests, setting preferences.

6. WF-006: Permissions Request: Push notifications, location access, etc.

7. WF-007: Home Screen: Redirects to the main app experience.

  • Key Interactions: Tap (buttons), Text Input, Swipe (onboarding carousel).

3.2 Flow 2: Main Feature X Usage (Example: Viewing a List Item & Detail)

  • Purpose: Demonstrate how a user browses a list of items and views details for a selected item.
  • Screens Involved:

1. WF-100: Dashboard/Home Screen: Entry point, potentially showing recent activity or featured items.

2. WF-101: Item List Screen: Displays a scrollable list of items (e.g., products, articles, tasks).

3. WF-102: Item Detail Screen: Shows comprehensive information about a selected item.

4. WF-103: Action Confirmation/Success: (Optional) If an action is taken on the detail screen (e.g., 'Add to Cart', 'Save').

  • Key Interactions: Scroll (list), Tap (list item, action buttons), Back Navigation.

3.3 Flow 3: Profile Management & Settings

  • Purpose: Allow users to view and update their personal information and app preferences.
  • Screens Involved:

1. WF-200: Profile Menu/Tab: Access point to profile and settings.

2. WF-201: My Profile Screen: Displays user's name, email, profile picture, editable fields.

3. WF-202: Edit Profile Screen: Form fields for updating personal details.

4. WF-203: Settings Screen: List of categories like 'Notifications', 'Privacy', 'Account', 'About'.

5. WF-204: Specific Setting Screen (e.g., Notification Preferences): Toggles, radio buttons for specific settings.

6. WF-205: Logout Confirmation: Dialog to confirm logout.

  • Key Interactions: Tap (menu items, fields, toggles), Text Input, Back Navigation.

4. Wireframe Specifications (Example Screens)

This section provides detailed specifications for key screens, including their purpose, content, and navigation. Each screen is given a unique ID for reference.

4.1. WF-007: Home Screen

  • Purpose: The primary entry point after login/onboarding, offering an overview and quick access to main features.
  • Key Elements:

* Header: App Logo/Name, Search Icon (top right), Profile Icon/Avatar (top left).

* Main Content Area:

* Personalized Welcome Message (e.g., "Good morning, [User Name]!").

* Quick Action Buttons/Cards (e.g., "Start New Task", "View Recent Activity").

* Scrollable Feed/Content Blocks (e.g., "Recommended for You", "Latest Updates").

* Bottom Navigation Bar (WF-C-001): Icons for Home, Explore, [Main Feature], Profile.

  • Navigation:

* In: From WF-006 (Permissions Request), WF-002 (Login Success).

* Out: To WF-101 (Explore/List Screen via bottom nav), WF-201 (Profile Screen via bottom nav or header icon), WF-300 (Search Results via search icon), WF-102 (Item Detail via tapping a content block).

  • Relevant Interaction Patterns: Tap (icons, buttons, content blocks), Scroll (main content area).

4.2. WF-101: Item List Screen (e.g., Products/Articles)

  • Purpose: Display a categorized or searchable list of items for the user to browse.
  • Key Elements:

* Header: Back Button (top left), Screen Title (e.g., "Products", "Articles"), Filter/Sort Icon (top right).

* Optional Search Bar (WF-C-005): Located below the header for in-list search.

* Content Area: Vertical scrollable list of Item Cards (WF-C-004). Each card typically includes an image, title, brief description, and a primary action (e.g., 'View', 'Add').

* Floating Action Button (WF-C-006): (Optional) For creating new items or a primary action.

  • Navigation:

* In: From WF-007 (Home Screen via bottom nav/card tap).

* Out: To WF-102 (Item Detail Screen via tapping an Item Card), WF-301 (Filter/Sort Options Screen via icon), WF-300 (Search Results via search bar).

  • Relevant Interaction Patterns: Scroll (list), Tap (item card, icons), Pull-to-Refresh (list).

4.3. WF-102: Item Detail Screen

  • Purpose: Present comprehensive information about a single selected item and allow for related actions.
  • Key Elements:

* Header: Back Button (top left), Item Title, Share Icon (top right), More Options (...) Icon (top right).

* Hero Section: Large image/media carousel of the item.

* Key Information Block: Item Name, Price/Status, Rating/Reviews (if applicable).

* Description/Detailed Content: Scrollable text area for full details.

* Related Items/Suggestions: (Optional) Horizontal scrollable list of similar items.

* Call-to-Action Button (WF-C-002): Prominent button (e.g., "Add to Cart", "Contact Seller", "Bookmark").

  • Navigation:

* In: From WF-101 (Item List Screen), WF-007 (Home Screen via content block).

* Out: To WF-101 (Back via back button), WF-302 (Share Sheet via share icon), WF-303 (More Options Modal via (...) icon).

  • Relevant Interaction Patterns: Tap (buttons, icons), Scroll (content area), Swipe (image carousel).

5. Component Library

This section defines reusable UI components, ensuring consistency and efficiency in design and development. Each component includes a description, states, and usage guidelines.

5.1. WF-C-001: Bottom Navigation Bar

  • Description: A persistent navigation element at the bottom of the screen, providing quick access to primary app sections.
  • States:

* Default: Inactive icon and label.

* Active: Highlighted icon and label (e.g., different color, bolder text).

  • Usage Guidelines:

* Typically used for 3-5 top-level destinations.

* Icons should be clear and descriptive.

* Avoid using scrolling content within the nav bar.

5.2. WF-C-002: Button (Primary & Secondary)

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

* Default: Standard appearance.

* Pressed/Hover: Visual feedback when interacted with.

* Disabled: Greyed out, non-interactive.

* Loading: Optional spinner/indicator within the button.

  • Usage Guidelines:

* Primary Button: For the most important action on a screen (e.g., "Submit", "Save", "Add to Cart"). High contrast.

* Secondary Button: For less critical actions (e.g., "Cancel", "Learn More"). Often outlined or text-only.

* Ensure adequate tap target size (min 44x44 dp/pt).

5.3. WF-C-003: Input Field (Text, Password, Number)

  • Description: Allows users to enter text or numerical data.
  • States:

* Default: Empty, with placeholder text.

* Focused: Active border/highlight.

* Filled: Contains user input.

* Error: Red border/icon with error message.

* Disabled: Greyed out, non-editable.

  • Usage Guidelines:

* Always include a clear label or placeholder text.

* Use appropriate keyboard types (text, number, email, URL).

* Provide clear error messages for invalid input.

* For password fields, include a 'show/hide password' toggle.

5.4. WF-C-004: Card Component

  • Description: A flexible container for grouping related content (e.g., an image, title, description, and action).
  • States:

* Default: Standard background, shadow (optional).

* Pressed: Subtle visual feedback (e.g., slight lift, background change).

  • Usage Guidelines:

* Ideal for displaying items in a list or grid.

* Maintain consistent padding and content hierarchy within cards.

* Can be tappable to navigate to a detail screen.

5.5. WF-C-005: Search Bar/Input

  • Description: An input field specifically for searching content within the app.
  • States:

* Default: Placeholder text (e.g., "Search...").

* Focused: Keyboard active, possibly showing recent searches or suggestions.

* With Input: Showing entered text, often with a clear 'X' button.

  • Usage Guidelines:

* Prominently placed in headers or dedicated search screens.

* Provide real-time search suggestions if possible.

* Clear search history options are beneficial.

5.6. WF-C-006: Floating Action Button (FAB)

  • Description: A circular button that floats above the UI, representing the primary action on a screen.
  • States:

* Default: Circular, with an icon.

* Pressed: Visual feedback.

  • Usage Guidelines:

* Use sparingly, typically one per screen.

* Should represent the most important or frequent action (e.g., 'Add New', 'Compose', 'Create').

* Positioned at the bottom-right or bottom-center.


6. Interaction Patterns

This section defines common interaction patterns used throughout the application, outlining how users engage with the interface and the expected system responses.

6.1. Tap (Single Tap)

  • Description: A quick touch and release on an interactive element.
  • Expected User Feedback:

* Visual: Highlight, color change, ripple effect, or state change (e.g., button press).

* Haptic: Optional subtle vibration.

  • Contexts of Use: Activating buttons, selecting list items, toggling switches, opening links.

6.2. Swipe (Horizontal/Vertical)

  • Description: Dragging a finger across the screen in a specific
mobile_app_wireframe_kit.txt
Download source file
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
"); 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' import ReactDOM from 'react-dom/client' import App from './App' import './index.css' ReactDOM.createRoot(document.getElementById('root')!).render( ) "); 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' import './App.css' function App(){ return(

"+slugTitle(pn)+"

Built with PantheraHive BOS

) } export default App "); zip.file(folder+"src/index.css","*{margin:0;padding:0;box-sizing:border-box} body{font-family:system-ui,-apple-system,sans-serif;background:#f0f2f5;color:#1a1a2e} .app{min-height:100vh;display:flex;flex-direction:column} .app-header{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:40px} h1{font-size:2.5rem;font-weight:700} "); 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)+" Generated by PantheraHive BOS. ## Setup ```bash npm install npm run dev ``` ## Build ```bash npm run build ``` ## Open in IDE Open the project folder in VS Code or WebStorm. "); zip.file(folder+".gitignore","node_modules/ dist/ .env .DS_Store *.local "); } /* --- 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",'{ "name": "'+pn+'", "version": "0.0.0", "type": "module", "scripts": { "dev": "vite", "build": "vue-tsc -b && vite build", "preview": "vite preview" }, "dependencies": { "vue": "^3.5.13", "vue-router": "^4.4.5", "pinia": "^2.3.0", "axios": "^1.7.9" }, "devDependencies": { "@vitejs/plugin-vue": "^5.2.1", "typescript": "~5.7.3", "vite": "^6.0.5", "vue-tsc": "^2.2.0" } } '); zip.file(folder+"vite.config.ts","import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import { resolve } from 'path' export default defineConfig({ plugins: [vue()], resolve: { alias: { '@': resolve(__dirname,'src') } } }) "); zip.file(folder+"tsconfig.json",'{"files":[],"references":[{"path":"./tsconfig.app.json"},{"path":"./tsconfig.node.json"}]} '); zip.file(folder+"tsconfig.app.json",'{ "compilerOptions":{ "target":"ES2020","useDefineForClassFields":true,"module":"ESNext","lib":["ES2020","DOM","DOM.Iterable"], "skipLibCheck":true,"moduleResolution":"bundler","allowImportingTsExtensions":true, "isolatedModules":true,"moduleDetection":"force","noEmit":true,"jsxImportSource":"vue", "strict":true,"paths":{"@/*":["./src/*"]} }, "include":["src/**/*.ts","src/**/*.d.ts","src/**/*.tsx","src/**/*.vue"] } '); zip.file(folder+"env.d.ts","/// "); zip.file(folder+"index.html"," "+slugTitle(pn)+"
"); 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' import { createPinia } from 'pinia' import App from './App.vue' import './assets/main.css' const app = createApp(App) app.use(createPinia()) app.mount('#app') "); var hasApp=Object.keys(extracted).some(function(k){return k.indexOf("App.vue")>=0;}); if(!hasApp) zip.file(folder+"src/App.vue"," "); 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} "); 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)+" Generated by PantheraHive BOS. ## Setup ```bash npm install npm run dev ``` ## Build ```bash npm run build ``` Open in VS Code or WebStorm. "); zip.file(folder+".gitignore","node_modules/ dist/ .env .DS_Store *.local "); } /* --- 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",'{ "name": "'+pn+'", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test" }, "dependencies": { "@angular/animations": "^19.0.0", "@angular/common": "^19.0.0", "@angular/compiler": "^19.0.0", "@angular/core": "^19.0.0", "@angular/forms": "^19.0.0", "@angular/platform-browser": "^19.0.0", "@angular/platform-browser-dynamic": "^19.0.0", "@angular/router": "^19.0.0", "rxjs": "~7.8.0", "tslib": "^2.3.0", "zone.js": "~0.15.0" }, "devDependencies": { "@angular-devkit/build-angular": "^19.0.0", "@angular/cli": "^19.0.0", "@angular/compiler-cli": "^19.0.0", "typescript": "~5.6.0" } } '); zip.file(folder+"angular.json",'{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", "projects": { "'+pn+'": { "projectType": "application", "root": "", "sourceRoot": "src", "prefix": "app", "architect": { "build": { "builder": "@angular-devkit/build-angular:application", "options": { "outputPath": "dist/'+pn+'", "index": "src/index.html", "browser": "src/main.ts", "tsConfig": "tsconfig.app.json", "styles": ["src/styles.css"], "scripts": [] } }, "serve": {"builder":"@angular-devkit/build-angular:dev-server","configurations":{"production":{"buildTarget":"'+pn+':build:production"},"development":{"buildTarget":"'+pn+':build:development"}},"defaultConfiguration":"development"} } } } } '); zip.file(folder+"tsconfig.json",'{ "compileOnSave": false, "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"]}, "references":[{"path":"./tsconfig.app.json"}] } '); zip.file(folder+"tsconfig.app.json",'{ "extends":"./tsconfig.json", "compilerOptions":{"outDir":"./dist/out-tsc","types":[]}, "files":["src/main.ts"], "include":["src/**/*.d.ts"] } '); zip.file(folder+"src/index.html"," "+slugTitle(pn)+" "); zip.file(folder+"src/main.ts","import { bootstrapApplication } from '@angular/platform-browser'; import { appConfig } from './app/app.config'; import { AppComponent } from './app/app.component'; bootstrapApplication(AppComponent, appConfig) .catch(err => console.error(err)); "); zip.file(folder+"src/styles.css","* { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: system-ui, -apple-system, sans-serif; background: #f9fafb; color: #111827; } "); 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'; import { RouterOutlet } from '@angular/router'; @Component({ selector: 'app-root', standalone: true, imports: [RouterOutlet], templateUrl: './app.component.html', styleUrl: './app.component.css' }) export class AppComponent { title = '"+pn+"'; } "); zip.file(folder+"src/app/app.component.html","

"+slugTitle(pn)+"

Built with PantheraHive BOS

"); 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} "); } zip.file(folder+"src/app/app.config.ts","import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; import { provideRouter } from '@angular/router'; import { routes } from './app.routes'; export const appConfig: ApplicationConfig = { providers: [ provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes) ] }; "); zip.file(folder+"src/app/app.routes.ts","import { Routes } from '@angular/router'; export const routes: Routes = []; "); 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)+" Generated by PantheraHive BOS. ## Setup ```bash npm install ng serve # or: npm start ``` ## Build ```bash ng build ``` Open in VS Code with Angular Language Service extension. "); zip.file(folder+".gitignore","node_modules/ dist/ .env .DS_Store *.local .angular/ "); } /* --- Python --- */ function buildPython(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^```[w]* ?/m,"").replace(/ ?```$/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(" "):"# add dependencies here "; zip.file(folder+"main.py",src||"# "+title+" # Generated by PantheraHive BOS print(title+" loaded") "); zip.file(folder+"requirements.txt",reqsTxt); zip.file(folder+".env.example","# Environment variables "); zip.file(folder+"README.md","# "+title+" Generated by PantheraHive BOS. ## Setup ```bash python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt ``` ## Run ```bash python main.py ``` "); zip.file(folder+".gitignore",".venv/ __pycache__/ *.pyc .env .DS_Store "); } /* --- Node.js --- */ function buildNode(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^```[w]* ?/m,"").replace(/ ?```$/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)+" "; zip.file(folder+"package.json",pkgJson); var fallback="const express=require("express"); const app=express(); app.use(express.json()); app.get("/",(req,res)=>{ res.json({message:""+title+" API"}); }); const PORT=process.env.PORT||3000; app.listen(PORT,()=>console.log("Server on port "+PORT)); "; zip.file(folder+"src/index.js",src||fallback); zip.file(folder+".env.example","PORT=3000 "); zip.file(folder+".gitignore","node_modules/ .env .DS_Store "); zip.file(folder+"README.md","# "+title+" Generated by PantheraHive BOS. ## Setup ```bash npm install ``` ## Run ```bash npm run dev ``` "); } /* --- 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:" "+title+" "+code+" "; zip.file(folder+"index.html",indexHtml); zip.file(folder+"style.css","/* "+title+" — styles */ *{margin:0;padding:0;box-sizing:border-box} body{font-family:system-ui,-apple-system,sans-serif;background:#fff;color:#1a1a2e} "); zip.file(folder+"script.js","/* "+title+" — scripts */ "); zip.file(folder+"assets/.gitkeep",""); zip.file(folder+"README.md","# "+title+" Generated by PantheraHive BOS. ## Open Double-click `index.html` in your browser. Or serve locally: ```bash npx serve . # or python3 -m http.server 3000 ``` "); zip.file(folder+".gitignore",".DS_Store node_modules/ .env "); } /* ===== 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(/ {2,}/g,"

"); h+="

"+hc+"

Generated by PantheraHive BOS
"; zip.file(folder+app+".html",h); zip.file(folder+"README.md","# "+title+" Generated by PantheraHive BOS. Files: - "+app+".md (Markdown) - "+app+".html (styled HTML) "); } 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);}});}