Mobile App Wireframe Kit
Run ID: 69cb061258b35c7ea758c2d22026-03-30Design
PantheraHive BOS
BOS Dashboard

Mobile App Wireframe Kit Specification

This document provides a comprehensive wireframe specification for a mobile application, outlining screen flows, a reusable component library, interaction patterns, and essential developer handoff notes. The goal is to establish a clear blueprint for the app's structure, functionality, and user experience, facilitating efficient design and development.


1. Introduction

This specification serves as the foundational design document for the mobile application. It details the app's core screens, their constituent UI components, and the intended user interactions. By providing a structured, data-driven representation, this document aims to minimize ambiguity and streamline the handoff process between design and development teams.

The "code" examples provided are designed to illustrate the structural and interactive properties of the wireframes. This includes JSON/YAML for component and screen definitions, and pseudo-code for interaction logic, aiming for clarity and machine-readability where applicable.


2. Overall App Structure & Screen Flows

This section describes the high-level architecture and primary user journeys within the application.

2.1. Core User Journeys

User Onboarding & Setup:

  1. Splash Screen: App branding, loading indicator.
  2. Welcome/Intro Screens (Optional): Carousel of app features/benefits.
  3. Sign Up/Log In: Account creation or existing user authentication.
  4. Profile Setup (First Time): Collect essential user information (e.g., name, preferences).
  5. Permissions Request: Camera, location, notifications, etc.
  6. Home Screen: Main dashboard/content feed.

Main Feature Flow (Example: "Product Browsing & Purchase"):

  1. Home Screen: Browse featured items, categories.
  2. Category List/Search Results: Filter, sort products.
  3. Product Detail Screen: View product images, description, price, reviews.
  4. Add to Cart/Wishlist: User action.
  5. Shopping Cart: Review items, modify quantities.
  6. Checkout Process: Shipping address, payment method, order summary.
  7. Order Confirmation: Success message, order details.

2.2. Screen Flow Diagram Representation (Conceptual)

Below is a simplified, structured representation of key screen transitions. This can be expanded into a full state-transition diagram using tools like Mermaid or Graphviz, but for this specification, we use a textual, JSON-like structure.

text • 1,107 chars
---

### 3. Component Library

This section defines the reusable UI components that form the building blocks of the application. Each component includes a description, usage guidelines, states, and a structural definition (JSON/YAML) or illustrative code snippet.

#### 3.1. General Principles

*   **Modularity:** Components are designed to be independent and reusable across different screens.
*   **Consistency:** A consistent set of components ensures a cohesive user experience.
*   **Accessibility:** All components should be designed with accessibility in mind (e.g., touch target sizes, contrast).

#### 3.2. Core Components

##### 3.2.1. Button

*   **Description:** An interactive element that triggers an action when tapped.
*   **Usage:** Primary calls to action, secondary actions, destructive actions.
*   **States:**
    *   `Default`: Normal appearance.
    *   `Pressed`: Visual feedback when tapped.
    *   `Disabled`: Non-interactive, greyed out appearance.
    *   `Loading`: Optional state with spinner.
*   **Variants:** Primary (filled), Secondary (outline), Text-only, Icon-only.

Sandboxed live preview

Mobile App Wireframe Kit: Comprehensive Study Plan

This document outlines a detailed study plan designed to equip you with the knowledge and practical skills required to architect, design, and assemble a professional Mobile App Wireframe Kit. This plan is structured to provide a comprehensive learning path, covering fundamental concepts, practical application, and best practices for creating a robust and reusable wireframe solution.


1. Introduction & Purpose

The goal of this study plan is to guide you through the process of understanding, planning, and ultimately creating a high-quality Mobile App Wireframe Kit. Such a kit is an invaluable asset for any design or development team, streamlining the early stages of app conceptualization and ensuring consistency across projects. By the end of this program, you will be proficient in defining screen flows, designing reusable components, understanding interaction patterns, and preparing developer-friendly documentation.

2. Overall Learning Goal

Upon completion of this study plan, participants will be able to:

  • Articulate the purpose and benefits of a Mobile App Wireframe Kit.
  • Conduct effective research to inform wireframe kit architecture.
  • Design and document a comprehensive library of mobile UI components following best practices.
  • Create intuitive screen flows and interaction patterns for various mobile app scenarios.
  • Utilize industry-standard tools for wireframing and prototyping.
  • Develop clear developer handoff notes and specifications for wireframe implementation.
  • Assemble, organize, and maintain a reusable Mobile App Wireframe Kit.

3. Weekly Schedule

This study plan is designed for a 4-week duration, with an estimated commitment of 8-12 hours per week.

Week 1: Foundations & Research

  • Learning Objectives:

* Understand the role of wireframing in the product development lifecycle.

* Differentiate between low-fidelity, mid-fidelity, and high-fidelity wireframes.

* Identify common mobile UI patterns and conventions (iOS Human Interface Guidelines, Android Material Design).

* Conduct competitive analysis of existing wireframe kits and mobile apps.

* Define the scope and target audience for your own Mobile App Wireframe Kit.

* Set up your chosen wireframing tool.

  • Topics:

* Introduction to Wireframing & Prototyping

* UI/UX Design Principles for Mobile

* Mobile Platform Guidelines (iOS HIG, Material Design)

* User Research & Competitive Analysis

* Choosing and Setting Up Wireframing Tools (Figma, Sketch, Adobe XD)

  • Activities:

* Read articles/chapters on wireframing fundamentals.

* Analyze 3-5 popular mobile apps, identifying common UI elements and flows.

* Explore existing wireframe kits (free/paid) to understand structure and content.

* Define the core categories and types of components your kit will include.

* Create a basic project file in your chosen tool.

Week 2: Component Library & Interaction Patterns

  • Learning Objectives:

* Design a consistent and scalable set of atomic UI components (buttons, input fields, icons).

* Develop complex components (navigation bars, cards, lists) from atomic elements.

* Understand and apply common mobile interaction patterns (tap, swipe, pinch, long press).

* Document component states (default, hover, active, disabled).

* Establish a naming convention and organization strategy for components.

  • Topics:

* Atomic Design Principles for Wireframing

* Designing Core UI Components (Typography, Color Palettes, Iconography, Buttons, Forms)

* Advanced UI Components (Navigation, Cards, Modals, Loaders)

* Mobile Interaction Patterns & Gestures

* Component States & Variations

* Asset Organization and Naming Conventions

  • Activities:

* Begin creating your core component library (buttons, text fields, checkboxes, radio buttons, toggles).

* Design various states for each component.

* Create a basic style guide within your wireframing tool (colors, typography).

* Experiment with interaction patterns using simple prototypes (e.g., button tap leading to a new screen).

* Start documenting component usage guidelines.

Week 3: Screen Flows & Prototyping

  • Learning Objectives:

* Translate user stories or basic requirements into logical screen flows.

* Design key screens for typical mobile app functionalities (onboarding, login, home, profile).

* Connect screens to create navigable prototypes.

* Incorporate feedback loops and error states into flows.

* Understand the principles of user journey mapping in relation to wireframes.

  • Topics:

* User Flows vs. Task Flows

* Mapping User Journeys with Wireframes

* Designing Core Application Screens (Splash, Onboarding, Authentication, Home/Dashboard, Detail Views, Settings)

* Prototyping Tools & Techniques (linking screens, basic interactions)

* Feedback Mechanisms & Error Handling

  • Activities:

* Choose a small app concept (e.g., a simple To-Do app, a weather app) to apply your kit components.

* Map out 2-3 key user flows for this concept (e.g., "User signs up," "User adds a task").

* Design the wireframes for all screens involved in these flows using your newly built component library.

* Create a navigable prototype connecting these screens.

* Review and refine flows for clarity and efficiency.

Week 4: Kit Assembly, Documentation & Handoff

  • Learning Objectives:

* Organize the complete wireframe kit for ease of use and maintenance.

* Develop comprehensive developer handoff notes and specifications.

* Create templates and examples demonstrating kit usage.

* Understand version control and collaboration best practices for wireframe kits.

* Present the completed wireframe kit and its capabilities.

  • Topics:

* Structuring and Organizing a Wireframe Kit (Pages, Sections, Libraries)

* Developer Handoff Best Practices

* Wireframe Annotations & Specifications

* Creating Reusable Templates (e.g., common screen layouts)

* Version Control and Collaboration in Wireframing Tools

* Presentation and Communication of Wireframes

  • Activities:

* Refine and organize your component library, screen flows, and templates within your chosen tool.

* Add detailed annotations and specifications to key components and screens.

* Create a "How-to-Use" guide or introductory page for your kit.

* Generate developer handoff documentation (e.g., exportable assets, design specs).

* Prepare a brief presentation showcasing your wireframe kit and a sample application built with it.

4. Recommended Resources

Books:

  • "Don't Make Me Think, Revisited: A Common Sense Approach to Web Usability" by Steve Krug (fundamental UX principles)
  • "About Face: The Essentials of Interaction Design" by Alan Cooper et al. (deeper dive into interaction design)
  • "Atomic Design" by Brad Frost (for structuring component libraries)
  • "Designing Interfaces" by Jenifer Tidwell (comprehensive guide to UI patterns)

Online Courses & Tutorials:

  • Coursera/edX/Udemy: Search for "UI/UX Design Fundamentals," "Wireframing & Prototyping," or specific tool courses (Figma, Sketch, Adobe XD).
  • YouTube Channels: The Futur, AJ&Smart, Flux, Figma Tutorials, Sketch Tutorials.
  • Design Blogs: NN/g Nielsen Norman Group, Smashing Magazine, UX Collective, Medium (for specific case studies).

Tools:

  • Primary Wireframing Tools:

* Figma: Collaborative, cloud-based, excellent for component libraries and prototyping.

* Sketch: Industry-standard for macOS, strong plugin ecosystem.

* Adobe XD: Part of Adobe Creative Cloud, good for rapid prototyping.

  • Other Useful Tools:

* Miro/Whimsical: For brainstorming, user flows, and whiteboard sessions.

* Notion/Confluence: For project documentation and study notes.

* Maze/Usability Hub: For basic usability testing (optional, for advanced learning).

Design Guidelines:

  • Apple Human Interface Guidelines: [developer.apple.com/design/human-interface-guidelines/](https://developer.apple.com/design/human-interface-guidelines/)
  • Google Material Design: [m2.material.io/design](https://m2.material.io/design) or [material.io](https://material.io) (Material 3)

5. Milestones

  • End of Week 1: Completed competitive analysis, defined kit scope, and initial tool setup.
  • End of Week 2: Core atomic and complex UI components designed with various states and basic interaction patterns. Established naming conventions.
  • End of Week 3: Full screen flows for a sample app concept designed and prototyped using the kit components.
  • End of Week 4: Complete Mobile App Wireframe Kit organized, documented with developer handoff notes, and ready for presentation.

6. Assessment Strategies

  • Self-Assessment Checklists: At the end of each week, review your work against the learning objectives and activities.
  • Peer Review (Optional): Share your progress with a colleague or mentor for feedback on component consistency, flow logic, and documentation clarity.
  • Portfolio Piece: The final Mobile App Wireframe Kit itself will serve as a significant portfolio piece, demonstrating your understanding and practical skills.
  • Presentation: Presenting your completed kit and a sample application built with it to a relevant audience (e.g., a mock design review) to articulate your design decisions and demonstrate its utility.
  • Practical Application: Attempt to use your newly created kit to wireframe a new, small app concept. This will test the reusability and effectiveness of your kit.

json

// COMPONENT_NAV_BAR_TOP.json

{

"component_name": "NavBar_Top",

"type": "layout",

"properties": {

"title": {"type": "string", "default": "App Title"},

"has_back_button": {"type": "boolean", "default": true},

"left_action_icon": {"type": "string", "optional": true, "description": "Icon name for left side (e.g., 'menu')"},

"right_action_icons": {"type": "array", "items": {"type": "string"}, "optional": true, "description": "Array of icon names for right side (e.g., ['search', 'cart'])"}

},

"events": [

{"name": "on

gemini Output

Mobile App Wireframe Kit Specification

This document provides a comprehensive wireframe specification for your mobile application, outlining the structural blueprint, user flows, reusable UI components, interaction patterns, and essential notes for seamless developer handoff. This specification serves as a foundational guide for the design and development phases, ensuring clarity and consistency across the project.


1. Introduction & Scope

This wireframe kit details the low-fidelity structure and functionality of the mobile application. It focuses on content hierarchy, layout, and user interaction pathways, rather than visual aesthetics or branding. The primary goal is to establish a clear understanding of the app's core functionality and user experience before moving into high-fidelity design.

Key Objectives:

  • Define the primary user journeys and screen sequences.
  • Establish a consistent library of reusable UI components.
  • Document fundamental interaction patterns.
  • Provide actionable guidelines for development.

Scope of this Document:

  • Screen Flows for core user journeys.
  • A comprehensive Component Library.
  • Standardized Interaction Patterns.
  • Developer Handoff Notes and best practices.

2. Screen Flows

This section details the primary user journeys within the application, illustrating the sequence of screens a user will navigate to complete specific tasks. Each flow outlines the entry point, decision points, and potential exit points.

General Flow Notation:

  • [Screen Name]: Represents a distinct screen within the application.
  • : Indicates a transition or action leading to the next screen.
  • [Action]: Describes the user's interaction (e.g., Tap, Submit, Swipe).
  • (Conditional): Notes where a flow path depends on specific user input or system state.

2.1. Core User Journeys

A. Onboarding & Account Creation Flow

  1. [Splash Screen] (Optional, timed) →
  2. [Welcome/Intro Screens] (Swipeable, 3-5 screens highlighting app benefits) → [Tap "Get Started"]
  3. [Login / Sign Up Screen]

* [Tap "Sign Up"] → [Registration Form Screen] (Email, Password, Name) → [Tap "Create Account"]

* (Success)[Email Verification Screen] (Instructions to check email) → (User verifies email) → [Profile Setup Screen] (Optional: Avatar, Bio, Preferences) → [Tap "Complete Profile"] → [Home Screen]

* (Error)[Registration Form Screen] (with error messages)

* [Tap "Login"] → [Login Form Screen] (Email, Password) → [Tap "Login"]

* (Success)[Home Screen]

* (Error)[Login Form Screen] (with error messages)

* [Tap "Forgot Password"] → [Forgot Password Screen] (Enter Email) → [Tap "Send Reset Link"] → [Password Reset Confirmation Screen] (Instructions to check email)

* [Tap "Continue with Google/Apple"] → (OAuth flow) → [Home Screen]

B. Main Feature X Flow (Example: Content Browsing & Viewing)

  1. [Home Screen] (Displays featured content, categories)

* [Scroll Down] → More content loads.

* [Tap Category Tab] → [Category Listing Screen] (Filtered content)

* [Tap Search Icon] → [Search Screen] (Input field, recent searches, popular searches)

* [Type Query] → [Search Results Screen]

* [Tap Content Card] → [Content Detail Screen] (Title, description, media player, related content)

* [Tap Play Button] → [Content Player Screen] (Full screen player, controls) → [Tap Back] → [Content Detail Screen]

* [Tap Share Icon] → [Share Sheet] (Native OS share options)

* [Tap Save/Bookmark Icon] → (Toggle state, confirmation toast)

* [Tap Back from Detail Screen] → [Previous Screen] (e.g., Home, Category Listing, Search Results)

C. Profile & Settings Management Flow

  1. [Home Screen] → [Tap Profile Icon/Tab]
  2. [Profile Screen] (User info, saved items, activity history)

* [Tap "Edit Profile"] → [Edit Profile Screen] (Editable fields: Name, Email, Avatar, Bio) → [Tap "Save Changes"] → (Confirmation toast) → [Profile Screen]

* [Tap "Settings"] → [Settings Screen]

* [Tap "Notifications"] → [Notification Settings Screen] (Toggle push notifications, email notifications) → [Tap Back] → [Settings Screen]

* [Tap "Privacy"] → [Privacy Settings Screen] (Toggle data sharing, view privacy policy) → [Tap Back] → [Settings Screen]

* [Tap "Logout"] → (Confirmation dialog) → [Tap "Yes"] → [Login / Sign Up Screen]

* [Tap Back] → [Home Screen]


3. Component Library

This section outlines a library of reusable UI components, defining their states, basic properties, and intended usage. Consistency in component application is crucial for a cohesive user experience and efficient development.


3.1. General Principles

  • Reusability: Components are designed to be used across multiple screens.
  • Consistency: Maintain uniform appearance and behavior across the app.
  • Responsiveness: Components should adapt gracefully to different screen sizes and orientations (implicitly handled by mobile platforms).
  • Accessibility: Consider touch target sizes, contrast, and semantic meaning for screen readers.

3.2. Core Component Categories

A. Buttons

  • Primary Button:

* States: Default, Pressed, Disabled, Loading.

* Usage: Main call to action (e.g., "Submit," "Next," "Create Account").

  • Secondary Button:

* States: Default, Pressed, Disabled.

* Usage: Less prominent actions, often paired with a primary button (e.g., "Cancel," "Skip").

  • Tertiary/Text Button:

* States: Default, Pressed, Disabled.

* Usage: Text-only actions, often inline (e.g., "Forgot Password?", "View All").

  • Icon Button:

* States: Default, Pressed, Disabled.

* Usage: Actions represented solely by an icon (e.g., "Share," "Like," "Menu").

B. Input Fields

  • Text Input:

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

* Properties: Label, Placeholder Text, Helper Text, Keyboard Type (text, number, email, password), Clear Button (optional).

* Usage: Single-line text entry (e.g., Name, Email, Search).

  • Text Area:

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

* Properties: Label, Placeholder Text, Helper Text, Character Count (optional).

* Usage: Multi-line text entry (e.g., Bio, Description).

  • Password Input:

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

* Properties: Label, Placeholder Text, Toggle visibility icon.

* Usage: Secure password entry.

  • Dropdown/Picker:

* States: Default, Active, Disabled.

* Usage: Selecting an option from a predefined list.

  • Date/Time Picker:

* States: Default, Active.

* Usage: Selecting a date or time using native OS picker.

C. Navigation

  • Top App Bar / Header:

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

* Usage: Provides context, primary navigation, and actions at the top of the screen.

  • Bottom Navigation Bar:

* Elements: 3-5 primary destination icons/labels.

* States: Active, Inactive.

* Usage: Persistent navigation for main sections of the app.

  • Tab Bar (within content):

* Elements: Tab labels/icons.

* States: Active, Inactive.

* Usage: Sectioning content within a single screen.

  • Drawer Navigation (Hamburger Menu):

* Elements: List of navigation links, user profile info (optional).

* Usage: For less frequently accessed sections or supplementary navigation.

D. Cards & Lists

  • Content Card:

* Elements: Image, Title, Subtitle, Description, Action Buttons/Icons.

* Usage: Grouping related content, often tappable to a detail screen.

  • List Item:

* Elements: Icon/Thumbnail, Primary Text, Secondary Text, Trailing Icon (e.g., Chevron, Toggle).

* Usage: Displaying lists of data, settings, or menu items.

E. Feedback & Modals

  • Dialog / Alert:

* Elements: Title, Message, Action Buttons (e.g., "Confirm," "Cancel").

* Usage: Critical information, confirmations, or errors requiring user action.

  • Bottom Sheet:

* Elements: Title, Content, Actions.

* Usage: Contextual actions or additional information that slides up from the bottom.

  • Snackbar / Toast:

* Elements: Short message, optional action button.

* Usage: Brief, non-disruptive feedback messages (e.g., "Item added to cart," "Changes saved").

  • Loading Indicator (Spinner/Progress Bar):

* Usage: Indicate ongoing processes.

F. Media

  • Image Placeholder:

* States: Loading, Error, Loaded.

* Usage: Displaying images.

  • Video Player Controls:

* Elements: Play/Pause, Progress Bar, Volume, Fullscreen, Seek.

* Usage: Interacting with video content.


4. Interaction Patterns

This section defines the standard ways users will interact with the application and how the app will respond to those interactions. Consistency in interaction patterns enhances usability and learnability.


4.1. Touch Gestures

  • Tap:

* Behavior: Activates a button, selects an item, navigates to a new screen.

* Feedback: Visual highlight/ripple effect on tap.

  • Double Tap:

* Behavior: (Context-specific) Zoom in/out on images, like content.

* Feedback: Visual confirmation.

  • Long Press (Press & Hold):

* Behavior: Activates contextual menus, drag-and-drop functionality, selection mode.

* Feedback: Haptic feedback, visual highlight, or pop-up menu.

  • Swipe (Horizontal):

* Behavior: Navigate between tabs, dismiss items (e.g., delete a list item), carousel navigation.

* Feedback: Content slides visually.

  • Swipe (Vertical):

* Behavior: Scroll content, pull-to-refresh.

* Feedback: Content scrolls, refresh indicator appears.

  • Pinch-to-Zoom:

* Behavior: Zoom in/out on images or maps.

* Feedback: Content scales visually.

4.2. Common Interaction Flows

  • Form Submission:

* Process: User fills out fields → Taps "Submit" button.

* Validation: Input fields show error states for invalid data.

* Feedback: Loading indicator on button/screen, then success/error message (toast, dialog, or inline).

  • Error Handling:

* Input Errors: Inline error messages below the field.

* Server Errors: Snackbar/Toast for non-critical errors, Dialog for critical errors (e.g., "No internet connection," "Failed to load data").

* Empty States: Display clear messages and optional actions when lists/sections are empty.

  • Loading States:

* Initial Load: Full-screen skeleton loaders or spinners.

* Partial Load: Inline spinners or shimmer effects for specific content blocks.

* Pull-to-Refresh: Standard indicator at the top of a scrollable view.

  • Confirmation & Alerts:

* Critical Actions: Use a Dialog with clear "Confirm" and "Cancel" options (e.g., "Delete Account").

* Non-Critical Actions: Use a Toast/Snackbar for immediate, temporary feedback (e.g., "Item added to favorites").

  • Notifications:

* Push Notifications: System-level alerts (requires user permission).

* In-App Notifications: Badge counts on icons, notification center screen.


5. Developer Handoff Notes

This section provides critical guidelines and considerations for developers to ensure the successful implementation of the wireframe specification into a functional mobile application.


5.1. General Guidelines

  • Platform-Specific Adaptations: While wireframes are generally platform-agnostic, actual implementation should adhere to native iOS (Human Interface Guidelines) and Android (Material Design) principles where appropriate for optimal user experience.
  • Semantic Naming: Use clear, descriptive names for components, screens, and actions in the codebase to match the wireframe and future design specifications.
  • Responsiveness & Layout:

* All layouts should be flexible and adapt to different screen sizes and orientations (portrait/landscape).

* Prioritize common mobile aspect ratios during development.

  • Accessibility:

* Ensure all interactive elements have appropriate touch target sizes (minimum 48x48 dp/pt).

* Implement proper content descriptions for images and interactive elements for screen readers.

* Maintain sufficient color contrast ratios (to be defined in the high-fidelity design phase).

  • Performance:

* Optimize image loading, network requests, and animations to ensure a smooth user experience.

* Implement skeleton screens or shimmer effects for content loading to reduce perceived latency.

5.2. Assets & Resources

  • Placeholder Assets: For this wireframe stage, generic placeholders are used. High-fidelity design will provide final image, icon, and font assets.
  • Iconography: Use a consistent icon set. If using a library (e.g., Font Awesome, Material Icons), ensure uniform styling.
  • Typography: Default system fonts will be used at this stage. Final font families and sizes will be specified in the UI design.
  • Color Palette: Wireframes use a grayscale palette. The brand's color palette will be introduced in the UI design phase.

5.

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