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

Mobile App Wireframe Kit: Comprehensive Specification & Code Scaffolding

This document delivers the comprehensive wireframe specification for your mobile application, including detailed screen flows, a component library, interaction patterns, and essential developer handoff notes. Additionally, it provides a foundational code scaffolding in React Native to demonstrate how these wireframe specifications translate into a basic application structure, ensuring a smooth transition from design to development.


1. Introduction & Overview

This deliverable serves as the blueprint for your mobile application's user experience (UX) and basic structural design. It focuses on clarity, functionality, and user flow, setting the stage for subsequent visual design (UI) and development phases.

Purpose:

Scope:

This document covers the essential wireframe specifications and a basic code implementation for the specified mobile application. It does not include high-fidelity UI designs, detailed backend logic, or comprehensive error handling, which will be addressed in later stages.


2. Mobile App Wireframe Specification (JSON Format)

This section provides a structured, machine-readable specification of the wireframes, suitable for direct integration into development workflows or as a source for generating documentation.

2.1. Screen Flow Definition

This JSON structure defines each screen, its purpose, and the possible navigation paths from it.

text • 121 chars
#### 2.2. Component Library Specification

This JSON defines the reusable UI components, their properties, and states.

Sandboxed live preview

Mobile App Wireframe Kit: Architecture Plan

This document outlines the comprehensive architecture and planning strategy for developing a robust Mobile App Wireframe Kit. This plan serves as a foundational blueprint, detailing how screen flows, a component library, interaction patterns, and developer handoff notes will be structured and implemented to ensure consistency, efficiency, and clarity throughout the app design and development process.


1. Introduction & Objectives

The primary objective of this architecture plan is to create a detailed framework for a "Mobile App Wireframe Kit." This kit will be a standardized set of resources designed to accelerate the wireframing process, ensure design consistency, and facilitate clear communication between design, product, and development teams.

Key Objectives:

  • Standardization: Establish consistent UI elements and interaction patterns.
  • Efficiency: Reduce design time through reusable components and clear guidelines.
  • Clarity: Provide unambiguous documentation for developers and stakeholders.
  • Scalability: Design a flexible system that can evolve with future app features and platform requirements.
  • Collaboration: Foster better communication and reduce misunderstandings in the development lifecycle.

2. Overall Kit Architecture & Guiding Principles

The Mobile App Wireframe Kit will be structured modularly, allowing for independent development and easy integration of its various parts.

Core Architectural Components:

  1. Screen Flows: Visual representation of user journeys.
  2. Component Library: Reusable UI elements with detailed specifications.
  3. Interaction Patterns: Documented user interaction behaviors.
  4. Developer Handoff Guidelines: Standards and best practices for design-to-development communication.

Guiding Principles:

  • Modularity: Each section (Screen Flows, Component Library, etc.) will be designed to be self-contained yet interconnected.
  • Clarity over Aesthetics: Wireframes will prioritize functionality, layout, and information hierarchy.
  • Platform Agnostic (Initially): Focus on common mobile UI/UX patterns, with the potential for platform-specific (iOS/Android) considerations in later stages.
  • Versioning: A clear versioning strategy will be established for the kit's evolution.
  • Accessibility: Basic accessibility considerations will be baked into component designs and interaction patterns where applicable.

3. Detailed Plan for Screen Flows

Objective: To visually map the primary user journeys and application structure, providing a high-level overview of the user experience and key decision points.

Methodology & Structure:

  • Identify Key User Stories/Use Cases: Based on the application's core functionalities (e.g., User Onboarding, Product Search, Item Checkout, Profile Management).
  • Define Flow Boundaries: Clearly delineate the start and end points for each major user flow.
  • Primary Path Mapping: Diagram the most common or ideal sequence of screens a user will encounter.
  • Alternative Paths & Error States: Include branches for less common scenarios, user choices, and potential error messages or recovery paths.
  • Visual Representation: Utilize standard flowchart symbols (start/end, process, decision, connector) to represent screen transitions and user actions.
  • Annotations: Each screen within a flow will be briefly annotated with its purpose and key interactive elements. Decision points will include conditions.

Deliverables for this Section:

  • A categorized list of all identified key user flows (e.g., "Authentication Flows," "Content Browsing Flows," "Transactional Flows").
  • For each flow:

* A clear title and brief description.

* A visual flowchart diagram illustrating screen sequences, user actions, and decision points.

* Numbered screen references linking to individual wireframes.

* Brief text annotations explaining the purpose of each screen and major interaction within the flow.


4. Detailed Plan for Component Library

Objective: To establish a comprehensive, reusable collection of UI elements with detailed specifications, ensuring consistency, accelerating design, and simplifying development.

Categorization Strategy:

The component library will be organized into logical categories for easy navigation and management:

  • 1. Basic Controls:

* Buttons (Primary, Secondary, Tertiary, Icon-only, Toggle)

* Text Fields (Single-line, Multi-line, Search, Password)

* Checkboxes & Radio Buttons

* Switches/Toggles

* Sliders

* Steppers

  • 2. Navigation:

* Top Bars (App Bar, Header with Title, Search Bar)

* Bottom Navigation Bars (Tab Bar)

* Side Drawers/Navigation Menus

* Tabs (Segmented Controls)

* Breadcrumbs

* Pagination Indicators

  • 3. Content Display:

* Cards (Basic, Image-rich, Actionable)

* Lists (Simple, Complex, Swipeable)

* Avatars & Badges

* Image Galleries & Carousels

* Text Blocks (Headings, Body Text, Captions)

* Dividers

  • 4. Feedback & Modals:

* Alert Dialogs (Confirmation, Information, Warning)

* Action Sheets

* Toasts & Snackbars

* Loading Indicators (Spinners, Progress Bars, Skeletons)

* Empty States (with illustrations/calls to action)

  • 5. Forms & Inputs (Advanced):

* Date/Time Pickers

* Dropdowns/Select Menus

* Tags/Chips

* Multi-step Form Structures

  • 6. Icons:

* Categorized icon sets (Navigation, Action, Status, etc.)

Specification for Each Component:

For every component identified, a detailed specification will be created, including:

  • Component Name: Clear and descriptive.
  • Purpose/Usage: When and why to use the component.
  • States: Visual examples and descriptions for all relevant states (e.g., default, focused, hover, pressed, disabled, error, active, loading, empty).
  • Variations: Different sizes, styles, or content configurations (e.g., small/medium/large button, text-only/icon-only/icon-with-text button).
  • Content Rules: Guidelines for text length, image dimensions, etc.
  • Placement Guidelines: Recommended locations and constraints within the UI.
  • Behavior: How the component responds to user interaction (e.g., tap, swipe).
  • Accessibility Notes: Basic considerations (e.g., minimum touch target size, semantic meaning).

Deliverables for this Section:

  • A comprehensive, categorized inventory of all UI components.
  • For each component:

* A dedicated specification page/section detailing its name, purpose, states, variations, usage guidelines, and basic accessibility notes.

* Visual examples of the component in all its defined states and variations.


5. Detailed Plan for Interaction Patterns

Objective: To define and document common user interaction behaviors within the app, ensuring a consistent, intuitive, and predictable user experience.

Identification of Key Interaction Patterns:

  • 1. Navigation Patterns:

* Primary Navigation (e.g., Tab-based, Drawer-based)

* Hierarchical Navigation (e.g., back button behavior)

* Contextual Navigation (e.g., within a list item)

* Search & Filter Navigation

  • 2. Data Input Patterns:

* Form Submission (e.g., single-page, multi-step)

* Selection (e.g., single-select, multi-select)

* Drag and Drop

* Gesture-based Inputs (e.g., swipe to dismiss, pinch to zoom)

  • 3. Feedback Patterns:

* Loading States (e.g., full-screen loader, inline spinner, skeleton screen)

* Success Messages (e.g., toast, confirmation screen)

* Error Handling (e.g., inline error messages, alert dialogs for critical errors)

* Empty States (e.g., when a list is empty, prompting user action)

  • 4. Content Manipulation Patterns:

* Sorting & Filtering

* Swiping Actions (e.g., swipe to delete/archive)

* Pull-to-Refresh

* Long Press Actions

  • 5. State Management Patterns:

* Login/Logout Flows

* Onboarding/First-run Experiences

* Permissions Requests

Documentation for Each Pattern:

For every identified interaction pattern, the following will be documented:

  • Pattern Name: Descriptive and concise (e.g., "Pull to Refresh," "Inline Form Validation").
  • Description: A brief explanation of the pattern's purpose and typical use cases.
  • Trigger: How the user initiates the interaction (e.g., "user taps button," "user swipes left").
  • Sequence of Events: A step-by-step breakdown of the interaction flow, including any system responses

json

// components.json

{

"components": [

{

"id": "CMP001_Header",

"name": "Header",

"description": "Top bar for screen title and navigation actions.",

"properties": [

{ "name": "title", "type": "string", "description": "Main title text." },

{ "name": "has_back_button", "type": "boolean", "default": false },

{ "name": "has_menu_icon", "type": "boolean", "default": false },

{ "name": "right_action_icon", "type": "string", "optional": true, "description": "Icon name for right-aligned action." }

],

"states": [

{ "name": "default", "description": "Standard state." },

{ "name": "with_back_button", "description": "Displays a back arrow." },

{ "name": "with_menu_icon", "description": "Displays a hamburger menu icon." }

]

},

{

"id": "CMP002_Button",

"name": "Button",

"description": "Interactive element for user actions.",

"properties": [

{ "name": "label", "type": "string", "description": "Text displayed on the button." },

{ "name": "type", "type": "enum", "values": ["primary", "secondary", "link", "danger"], "default": "primary" },

{ "name": "is_disabled", "type": "boolean", "default": false },

{ "name": "icon_name", "type": "string", "optional": true, "description": "Icon to display next to label." }

],

"states": [

{ "name": "default" },

{ "name": "pressed" },

{ "name": "disabled" },

{ "name": "loading", "description": "Shows a spinner instead of label." }

]

},

{

"id": "CMP003_InputField",

"name": "Input Field",

"description": "Allows users to input text.",

"properties": [

{ "name": "label", "type": "string", "description": "Label above the input field." },

{ "name": "placeholder", "type": "string" },

{ "name": "value", "type": "string", "default": "" },

{ "name": "keyboard_type", "type": "enum", "values": ["default", "email-address", "numeric", "phone-pad", "url"], "default": "default" },

{ "name": "secure_text_entry", "type": "boolean", "default": false, "description": "Hides input for passwords." },

{ "name": "error_message", "type": "string", "optional": true, "description": "Text to display on validation error." }

],

"states": [

{ "name": "default" },

{ "name": "focused" },

{ "name": "with_error" },

{ "name": "disabled" }

]

},

{

"id": "CMP004_Card",

"name": "Card",

"description": "Container for grouping related content.",

"properties": [

{ "name": "title", "type": "string", "optional": true },

{ "name": "content_components", "type": "array", "description": "List of components to render inside the card." }

]

},

{

"id": "CMP005_ListItem",

"name": "List Item",

"description": "Row item typically used in lists.",

"properties": [

{ "name": "label", "type": "string" },

{ "name": "description", "type": "string", "optional": true },

{ "name": "has_arrow", "type": "boolean", "default": false },

{ "name": "icon_left", "type": "string", "optional": true },

{ "name": "icon_right", "type": "string", "optional": true }

]

},

{

"id": "CMP006_Image",

"name": "Image",

"description": "Displays an image.",

"properties": [

{ "name": "src", "type": "string", "description": "Source URL or local path of the image." },

{ "name": "alt", "type": "string", "description": "Alternative text for accessibility." },

{ "name": "width", "type": "number", "optional": true },

{ "name": "height", "type": "number", "optional": true },

{ "name": "resize_mode", "type": "enum", "values": ["cover", "contain", "stretch", "repeat", "center"], "default": "contain

gemini Output

Mobile App Wireframe Kit: Complete Specification

Date: October 26, 2023

Project: Mobile App Wireframe Kit

Deliverable: Complete Wireframe Specification


1. Introduction & Overview

This document provides a comprehensive wireframe specification for your mobile application, serving as a foundational blueprint for its structure, content hierarchy, and core user interactions. These low-fidelity wireframes focus on functionality and usability, laying the groundwork before the application of visual design elements.

Purpose:

  • To establish the app's structural layout and content organization.
  • To define key user flows and navigation paths.
  • To outline common UI components and interaction patterns.
  • To provide clear guidance for subsequent UI design and development phases.

Audience: Product Managers, UI/UX Designers, Developers, and Stakeholders.

Scope: This kit details the essential screens, components, and interactions. It is not a final visual design but a functional specification.


2. Wireframe Specification Summary

This wireframe kit outlines the core structure for a versatile mobile application, designed to facilitate [_Insert App's Core Purpose, e.g., "streamlined task management," "intuitive social networking," "efficient e-commerce transactions"_]. The focus is on creating a clear, intuitive, and efficient user experience across key functionalities.

Key Objectives:

  • Enable users to easily [_Insert Primary User Goal 1, e.g., "create and manage tasks"_].
  • Provide a seamless experience for [_Insert Primary User Goal 2, e.g., "browsing and discovering content"_].
  • Ensure straightforward navigation and access to essential features.

3. Screen Flows

This section details critical user journeys within the application, illustrating the sequence of screens and navigation logic.

3.1. User Onboarding & Account Creation Flow

This flow guides new users through the initial setup process, from first launch to accessing the main application content.

  • Sequence:

1. Splash Screen:

* Description: Displays app logo and branding briefly (e.g., 2-3 seconds).

* Navigation: Auto-advances to Welcome/Intro Screens.

2. Welcome/Intro Screens (3-5 steps):

* Description: Short, informative screens highlighting key app benefits or features. Each screen typically has an image/illustration, a title, and a brief description.

* Navigation: Swipe left/right to navigate between screens. "Skip" button (top right) to jump to Sign Up/Log In. "Next" or "Get Started" button (bottom) to advance.

3. Sign Up / Log In Screen:

* Description: Provides options for new users to register and existing users to sign in.

* Sign Up: Fields for Email, Password, Confirm Password. "Sign Up" button. Options for social login (Google, Apple, Facebook).

* Log In: Fields for Email, Password. "Log In" button. "Forgot Password" link. Options for social login.

* Navigation:

* Successful Sign Up/Log In → Profile Setup (if applicable) or Home Screen.

* "Forgot Password" → Forgot Password Flow (separate flow).

4. Profile Setup Screen (Optional):

* Description: Allows users to add initial profile details (e.g., Username, Profile Picture, Interests).

* Navigation: "Skip" or "Complete" button → Home Screen.

5. Home Screen:

* Description: The main dashboard or feed of the application, showing primary content.

* Navigation: Access to main app functionalities via Bottom Navigation Bar or Top App Bar actions.

3.2. Core Task: Browsing & Detail View Flow

This flow demonstrates how users discover and view specific content or items within the app.

  • Sequence:

1. Home Screen:

* Description: Displays a curated feed, list, or grid of primary content categories/items. Includes a search bar and potentially filters/sort options.

* Navigation:

* Tap on a content item → Item/Detail View.

* Tap on Search Bar → Search Results Screen.

* Tap on Category/Filter → Category/Filter Results Screen.

* Tap on Bottom Navigation Bar items → respective main sections.

2. Category/Filter Results Screen (Optional):

* Description: Displays a list or grid of items filtered by a selected category or criteria.

* Navigation:

* Tap on an item → Item/Detail View.

* Back button (top left) → Home Screen.

3. Search Results Screen (Optional):

* Description: Displays results based on user search query. May include suggested searches or recent searches.

* Navigation:

* Tap on a search result → Item/Detail View.

* Back button (top left) → Home Screen.

4. Item/Detail View Screen:

* Description: Dedicated screen displaying comprehensive details of a selected item (e.g., image gallery, description, specifications, user reviews, related items, primary action button).

* Navigation:

* Back button (top left) → Previous screen (Home, Category, or Search Results).

* Primary Action Button (e.g., "Add to Cart", "Bookmark", "Contact") → Respective action flow (e.g., Checkout, Confirmation).

* Share icon → Native Share Sheet.

3.3. Settings & Profile Management Flow

This flow covers how users access and manage their personal settings and profile information.

  • Sequence:

1. Home Screen:

* Description: Access point, typically via a Profile Icon or Menu icon in the Top App Bar, or a "Profile" tab in the Bottom Navigation Bar.

* Navigation: Tap Profile Icon/Tab → Profile Screen.

2. Profile Screen:

* Description: Displays user's profile picture, name, bio, and key statistics. Includes options to "Edit Profile" and "Settings."

* Navigation:

* Tap "Edit Profile" → Edit Profile Screen.

* Tap "Settings" → Settings Menu Screen.

* Back button (top left) → Home Screen.

3. Edit Profile Screen:

* Description: Allows users to update profile details (e.g., Name, Email, Profile Picture, Bio). "Save" button.

* Navigation:

* Tap "Save" → Profile Screen (with updated info).

* Back button (top left) → Profile Screen (discarding changes).

4. Settings Menu Screen:

* Description: A list of various application settings (e.g., Notifications, Privacy, Account, Help, About).

* Navigation:

* Tap on a specific setting item (e.g., "Notifications") → Respective Setting Detail Screen.

* Back button (top left) → Profile Screen.

5. Setting Detail Screen (e.g., Notifications Settings):

* Description: Contains controls relevant to the specific setting (e.g., toggles for different notification types, sound options).

* Navigation: Back button (top left) → Settings Menu Screen.


4. Component Library

This section defines the standard UI elements used throughout the application, ensuring consistency and reusability. Each component description includes its purpose, typical states, and considerations.

4.1. Basic Input & Action Elements

  • Buttons:

* Purpose: Initiate actions or navigate.

* Types: Primary (filled, prominent), Secondary (outlined/text-only), Tertiary (icon-only, subtle text).

* States: Default, Hover/Pressed, Disabled, Loading.

* Considerations: Clear labels, sufficient touch target size (minimum 48x48dp/pt).

  • Input Fields:

* Purpose: Allow users to enter data.

* Types: Text, Password, Email, Number, Search, Text Area.

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

* Considerations: Clear labels/placeholders, validation feedback, keyboard type matching input.

  • Checkboxes:

* Purpose: Select one or more options from a list.

* States: Unchecked, Checked, Disabled.

* Considerations: Clearly associated label.

  • Radio Buttons:

* Purpose: Select a single option from a mutually exclusive set.

* States: Unselected, Selected, Disabled.

* Considerations: Clearly associated label, grouped logically.

  • Toggles/Switches:

* Purpose: Turn an option on or off.

* States: Off, On, Disabled.

* Considerations: Instant effect when toggled, clear label indicating what is being controlled.

4.2. Navigation Elements

  • Top App Bar (Header Bar):

* Purpose: Displays screen title, branding, and key actions/navigation.

* Elements: Title, Back Button, Hamburger Menu Icon, Action Icons (e.g., Search, Notifications, Profile).

* Considerations: Contextual actions, consistent placement of global elements.

  • Bottom Navigation Bar:

* Purpose: Provides quick access to top-level destinations in the app.

* Elements: 3-5 icons with optional text labels.

* Considerations: Icons should be universally recognizable, active state clearly indicated.

  • Tab Bar (Contextual Tabs):

* Purpose: Organizes content within a specific screen into distinct sections.

* Elements: Text labels or icons for each tab.

* Considerations: Visible only when relevant to the screen content.

  • Side Drawer / Navigation Menu (Hamburger Menu):

* Purpose: Access to less frequently used but important sections (e.g., Settings, Help, Logout).

* Elements: List of menu items, often includes user profile info.

* Considerations:

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);}});}