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

Mobile App Wireframe Kit: Comprehensive Specification & Developer Handoff

This document outlines the complete wireframe specification for the mobile application, providing a detailed blueprint for its structure, user flows, interactive elements, and technical considerations. This deliverable serves as a foundational guide for both design refinement and development implementation.


1. Introduction & Overview

This specification details the core structure and interaction patterns of the mobile application. It aims to provide clarity on user journeys, component behavior, and screen layouts, ensuring a consistent and intuitive user experience.


2. Core App Concept & User Story

(Example Placeholder - This section would be populated with the specific app's concept)


3. Screen Flows

This section details the primary user journeys within the application, illustrating the sequence of screens and key decision points.

3.1. User Onboarding Flow

  1. Welcome Screen:

* Purpose: Introduce the app's value proposition.

* Elements: Logo, catchy tagline, "Sign Up" button, "Log In" button.

* Transition: Tap "Sign Up" → Account Creation Screen. Tap "Log In" → Login Screen.

  1. Account Creation Screen:

* Purpose: Gather essential user information.

* Elements: Email input, Password input, "Confirm Password" input, "Create Account" button, "Already have an account? Log In" link.

* Transition: Tap "Create Account" (on success) → Profile Setup Screen.

  1. Login Screen:

* Purpose: Allow existing users to access their accounts.

* Elements: Email input, Password input, "Log In" button, "Forgot Password?" link, "Don't have an account? Sign Up" link.

* Transition: Tap "Log In" (on success) → Main Dashboard Screen.

  1. Profile Setup Screen (Optional/Initial):

* Purpose: Collect initial preference/profile data.

* Elements: Name input, Profile Picture upload (optional), Preferences (e.g., interests, goals - checkboxes/dropdowns), "Complete Profile" button.

* Transition: Tap "Complete Profile" → Main Dashboard Screen.

3.2. Main Feature Flow (Example: Task Creation & Management)

  1. Main Dashboard Screen:

* Purpose: Overview of user's current status/tasks.

* Elements: Header (App Name/User Avatar), Summary widgets, List of upcoming tasks, Floating Action Button (FAB) for "Add New Task".

* Transition: Tap FAB → New Task Screen. Tap on a task item → Task Detail Screen.

  1. New Task Screen:

* Purpose: Allow users to create a new task.

* Elements: Task Title input, Description input (multiline), Due Date picker, Priority selector, "Save Task" button, "Cancel" button.

* Transition: Tap "Save Task" (on success) → Main Dashboard Screen (with new task added). Tap "Cancel" → Main Dashboard Screen.

  1. Task Detail Screen:

* Purpose: View and edit details of a specific task.

* Elements: Task Title (editable), Description (editable), Due Date, Priority, "Mark as Complete" button, "Edit" button (in header/footer), "Delete Task" option.

* Transition: Tap "Edit" → Edit Task Screen. Tap "Mark as Complete" → Task status updates, returns to Main Dashboard Screen.

  1. Edit Task Screen:

* Purpose: Modify an existing task.

* Elements: Identical to New Task Screen but pre-populated with existing data.

* Transition: Tap "Save Changes" → Task Detail Screen (with updated data).

3.3. Profile Management Flow

  1. Main Dashboard Screen:

* Transition: Tap User Avatar/Profile Icon in header → User Profile Screen.

  1. User Profile Screen:

* Purpose: View and manage user account settings.

* Elements: Profile Picture, Name, Email, "Edit Profile" button, "Change Password" option, "Notifications Settings" link, "Logout" button.

* Transition: Tap "Edit Profile" → Edit Profile Details Screen. Tap "Change Password" → Change Password Screen. Tap "Logout" → Welcome Screen.


4. Component Library

This section defines the reusable UI elements used throughout the application, including their states and typical usage.

4.1. Buttons

* Purpose: Main call to action.

* States: Default, Pressed, Disabled, Loading.

* Usage: "Sign Up", "Log In", "Save", "Submit".

* Code Example (React Native):

text • 861 chars
*   **Secondary Button:**
    *   Purpose: Alternative action, less emphasis than primary. Often outlined.
    *   States: Default, Pressed, Disabled.
    *   Usage: "Cancel", "Skip", "Learn More".
*   **Text Button:**
    *   Purpose: Low emphasis action, often for navigation or minor actions.
    *   States: Default, Pressed, Disabled.
    *   Usage: "Forgot Password?", "Go Back", "Edit".
*   **Icon Button:**
    *   Purpose: Action represented solely by an icon.
    *   States: Default, Pressed, Disabled.
    *   Usage: Navigation (e.g., back arrow), menu, search.

#### 4.2. Input Fields

*   **Text Input:**
    *   Purpose: Single-line text entry.
    *   Elements: Label, Placeholder text, Input area.
    *   States: Default, Focused, Filled, Error, Disabled.
    *   Usage: Email, Username, Name.
    *   **Code Example (React Native):**
        
Sandboxed live preview

Mobile App Wireframe Kit - Architecture Plan

This document outlines the architectural plan for developing a comprehensive Mobile App Wireframe Kit. The goal is to provide a robust, low-fidelity, and highly organized set of assets that facilitate rapid prototyping, clear communication of user flows, and efficient handoff to development teams.


1. Kit Purpose & Scope

Purpose: To enable product designers, product managers, and developers to quickly conceptualize, prototype, and communicate mobile application structures, user flows, and core interactions without focusing on visual aesthetics. It aims to streamline the initial design phase and ensure alignment before high-fidelity design.

Scope:

  • Platform Focus: General mobile app patterns, primarily covering iOS and Android common UI/UX paradigms.
  • Fidelity: Low-fidelity (grayscale, basic shapes, placeholder text) to emphasize structure and functionality over visual design.
  • Key Deliverables: Component library, screen templates, user flow connectors, interaction patterns, and developer handoff notes.

2. Overall Kit Structure

The Mobile App Wireframe Kit will be organized into logical sections within the chosen design tool (e.g., Figma pages) to ensure ease of navigation and maintainability.

  • Page 1: 🚀 Start Here (Introduction & Guidelines)

* Brief overview of the kit's purpose and how to use it.

* Guidelines for maintaining consistency and best practices.

  • Page 2: 📚 Global Styles & Assets

* Typography scale (sizes, weights, line heights - grayscale).

* Spacing system (e.g., 4pt or 8pt grid).

* Color palette (grayscale for wireframes: background, primary, secondary, text, borders, accents).

* Basic icon set (outline, generic symbols).

* Image/Avatar placeholders.

  • Page 3: 🧩 Component Library

* Categorized collection of all reusable UI elements.

* Each component with its states and variations.

  • Page 4: 📱 Screen Templates

* Pre-designed common screen layouts.

* Ready-to-use full screens for rapid assembly.

  • Page 5: ➡️ User Flows & Patterns

* Connectors for linking screens.

* Common interaction patterns and annotations.

  • Page 6: 📝 Documentation & Handoff

* Templates for adding functional specifications and developer notes.

* Guidelines for effective handoff.

  • Page 7+: 🏗️ Your Project Screens (Working Area)

* Dedicated pages for users to create their specific app screens and flows using the kit's components.


3. Component Library Details

The Component Library will be the core of the kit, featuring a comprehensive set of low-fidelity UI elements. Each component will be designed with variants and states for flexibility.

Categories & Example Components:

  • Input Controls:

* Buttons (Primary, Secondary, Tertiary, Icon, Text-only; states: default, pressed, disabled, loading; sizes: small, medium, large).

* Text Inputs (Single line, Multi-line, Search, Password; states: default, focused, error, disabled).

* Checkboxes & Radio Buttons (Default, selected, disabled).

* Toggles/Switches (Off, On, disabled).

* Dropdowns/Selects (Default, open, disabled).

* Sliders (Single, Range).

  • Navigation:

* Tab Bars (Icons, text, badges; active/inactive states).

* Navigation Bars/App Bars (Title, back button, actions; variations).

* Drawers/Side Menus (Header, menu items, separators).

* Breadcrumbs.

* Pagination indicators.

  • Content Display:

* Cards (Basic, with image, with actions).

* Lists (Single line, Two line, with avatar/icon, with actions).

* Grids (Image grids, content grids).

* Image Placeholders (Various aspect ratios).

* Text Blocks (Headings, paragraphs, captions).

* Avatars (Circular, square; various sizes).

* Badges/Tags.

  • Feedback & Alerts:

* Modals/Dialogs (Alert, confirmation, input; with header, body, actions).

* Toasts/Snackbars (Success, error, info).

* Loaders/Spinners (Circular, linear).

* Empty States (Icon, title, message, optional action).

  • Media:

* Video Player Placeholder (Controls, progress bar).

* Audio Player Placeholder.

  • Layout & Structure:

* Dividers/Separators.

* Spacers (Vertical, horizontal, predefined sizes).

Component Properties:

  • Variants: To handle different types or styles (e.g., Button/Primary, Button/Secondary).
  • States: To represent interaction states (e.g., Button/Default, Button/Pressed, Button/Disabled).
  • Properties: For customizable attributes (e.g., Input/Label, Input/Placeholder).
  • Auto Layout: All components will leverage Auto Layout for responsive resizing and content adaptability.

4. Screen Templates

A collection of commonly used mobile screen layouts will be provided to accelerate initial screen design. These templates will be built using the kit's components.

Example Screen Templates:

  • Authentication: Login, Sign Up, Forgot Password, OTP Verification.
  • Profile: User Profile View, Edit Profile.
  • Home/Dashboard: Feed-based, Grid-based, Card-based.
  • Detail Views: Product Detail, Article Detail, Event Detail.
  • Settings: General Settings, Notifications Settings, Privacy Settings.
  • Search: Search Input, Search Results, Filters.
  • Onboarding: Walkthrough screens (1-3 steps).
  • Empty States: Generic "No Data," "No Internet," "Error."

5. User Flows & Interaction Patterns

The kit will include elements and guidelines for visualizing user journeys and specifying interactions.

  • Screen Flow Connectors:

* Standard arrows (straight, curved, elbow) to link screens.

* Labels for connectors to describe the trigger (e.g., "On Tap 'Login'", "On Swipe Left").

* Start/End nodes for flows.

  • Interaction Annotations:

* Pre-designed sticky notes or text blocks for adding specific interaction details (e.g., "Toast message appears," "Keyboard slides up," "Scrolls to top").

* Numbered annotation system for linking notes to specific UI elements.

  • Common Interaction Patterns:

* Modal/Sheet presentations (full screen, half screen, bottom sheet).

* Swipe gestures (for lists, carousels).

* Drag-and-drop indicators.

* Loading/Skeleton screen patterns.


6. Developer Handoff & Documentation

To ensure a smooth transition from wireframes to development, the kit will include features and guidelines for comprehensive documentation.

  • Dedicated Handoff Templates:

* Screen Specification Template: For each unique screen, including:

* Screen name and ID.

* Brief description of purpose.

* Key functional requirements.

* Data displayed (placeholder examples).

* Error states and empty states.

* Links to relevant user flows.

* Interaction Specification Template: For complex interactions, detailing:

* Trigger event.

* Expected outcome/animation.

* State changes.

* Component Usage Guidelines: Notes on how specific components should behave in different contexts.

  • Annotation System:

* Numbered callouts directly on wireframes, linked to detailed explanations in the documentation section.

* Color-coding for different types of notes (e.g., functional, technical, accessibility).

  • Accessibility Notes:

* Placeholders for adding basic accessibility considerations (e.g., "Ensure sufficient contrast," "Provide descriptive labels for screen readers").


7. Recommended Tooling & Format

The kit will be primarily built and optimized for a leading collaborative design tool to maximize usability and team integration.

  • Primary Tool: Figma

* Reasons: Robust component system (Variants, Auto Layout, Styles), excellent real-time collaboration, built-in prototyping features, extensive plugin ecosystem, cross-platform accessibility.

* Format: Figma file (.fig).

* Organization: Utilizing Figma's pages, frames, sections, and layers for clear structure.

  • Alternative Tooling (if required by specific project constraints):

* Sketch: Strong symbol system, but less real-time collaboration than Figma.

* Adobe XD: Good prototyping capabilities, but component system might be less robust for this scale.


8. Key Principles for Kit Development

  • Low-Fidelity First: Maintain a deliberately unpolished aesthetic to keep the focus on functionality and user experience, not visual design.
  • Modularity & Reusability: Design components to be highly modular and reusable across various screens and projects.
  • Scalability: Structure the kit to easily accommodate new components, screens, and interaction patterns as needed.
  • Clarity & Simplicity: Ensure the kit is intuitive to use and that its components clearly communicate their intended purpose.
  • Consistency: Adhere to a consistent naming convention, styling, and structural approach throughout the kit.

This architectural plan provides a solid foundation for developing a comprehensive and effective Mobile App Wireframe Kit, designed to accelerate the initial phases of mobile application development and foster clear communication among stakeholders.

  • Password Input:

* Purpose: Secure password entry.

* Elements: Label, Placeholder, Input area, Toggle for visibility (eye icon).

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

  • Text Area:

* Purpose: Multi-line text entry.

* Elements: Label, Placeholder, Input area, Character count (optional).

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

  • Dropdown/Picker:

* Purpose: Select an item from a predefined list.

* Elements: Label, Display value, Down arrow icon.

* Interaction: Tapping opens a list/modal for selection.

  • Checkbox:

* Purpose: Toggle a single option.

* States: Unchecked, Checked, Indeterminate, Disabled.

  • Radio Button:

* Purpose: Select one option from a group.

* States: Unselected, Selected, Disabled.

4.3. Navigation

  • Top App Bar (Header):

* Purpose: Displays current screen title, often includes action buttons (e.g., back, menu, search, profile).

* Elements: Title, Back button, Action icons (e.g., Settings, Notifications).

* Behavior: Fixed at the top.

  • Bottom Navigation Bar:

* Purpose: Primary navigation between core sections of the app.

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

* Behavior: Fixed at the bottom, persistent across main screens.

gemini Output

Mobile App Wireframe Kit: Comprehensive Specification

Project: Mobile App Development

Deliverable: Complete Wireframe Specification

Date: October 26, 2023

Version: 1.0


1. Introduction & Purpose

Welcome to the complete Mobile App Wireframe Specification. This document serves as the foundational blueprint for your mobile application, detailing the structural layout, content organization, and core user interactions. It is the culmination of our wireframing phase, providing a clear, low-fidelity representation of the app's user experience (UX) before engaging in visual design.

The purpose of this specification is to:

  • Define the app's architecture and screen hierarchy.
  • Illustrate key user journeys and interaction flows.
  • Establish a consistent library of UI components.
  • Provide essential guidelines and notes for the development team.

This deliverable is designed to facilitate clear communication among stakeholders, designers, and developers, ensuring a shared understanding of the app's functional requirements and user experience.


2. Wireframe Specification Overview

Wireframes are grayscale, skeletal representations of your app's screens. They focus on functionality, content placement, and user interaction rather than visual aesthetics. This specification outlines the following critical aspects:

  • Screen Flows: Visual representation and textual descriptions of how users navigate through the app to complete specific tasks.
  • Component Library: A catalog of reusable UI elements and their states, ensuring consistency across the application.
  • Interaction Patterns: Descriptions of how users interact with the app, including gestures, feedback mechanisms, and system responses.
  • Developer Handoff Notes: Essential instructions and considerations for the development team to ensure accurate and efficient implementation.

3. Screen Flows (User Journeys)

This section details the primary user journeys within the mobile application, illustrating the sequence of screens and interactions required to complete key tasks. Each flow outlines the entry point, the screens visited, and the logical progression.

3.1. Flow 1: User Onboarding & Account Creation

Objective: Guide new users through the initial setup and account registration process.

  • Screen 1.1: Welcome/Splash Screen

* Content: App logo, brief tagline, "Get Started" button, "Sign In" link.

* Interaction: Tap "Get Started" to proceed to onboarding screens. Tap "Sign In" to go to Login.

  • Screen 1.2: Onboarding Carousel (3-4 screens)

* Content: Illustrative graphics, feature highlights, short descriptive text.

* Interaction: Swipe left/right to navigate between screens. "Skip" button, "Next" button on each screen, "Finish" or "Create Account" button on the last screen.

  • Screen 1.3: Sign Up - Email/Password

* Content: Input fields for Email, Password, Confirm Password. "Create Account" button, "Sign In" link.

* Interaction: User enters details. Validation on input. Tap "Create Account."

  • Screen 1.4: Profile Setup (Optional)

* Content: Input fields for Name, Profile Picture (upload/camera), Preferred Categories (multi-select checklist). "Save & Continue" button.

* Interaction: User provides optional details. Tap "Save & Continue."

  • Screen 1.5: Permissions Request (Push Notifications)

* Content: Explanatory text on why notifications are useful. "Allow Notifications" button, "Maybe Later" link.

* Interaction: User grants or denies permission.

  • Screen 1.6: Home Screen (Dashboard)

* Content: Personalized feed/content, main navigation.

* Interaction: User lands on the main app experience.

3.2. Flow 2: User Login

Objective: Allow existing users to access their account.

  • Screen 2.1: Login Screen

* Content: Input fields for Email, Password. "Sign In" button, "Forgot Password?" link, "Create Account" link.

* Interaction: User enters credentials. Tap "Sign In."

  • Screen 2.2: Forgot Password Flow (if triggered)

* Content: Input field for Email. "Send Reset Link" button.

* Interaction: User enters email, receives password reset link via email.

  • Screen 2.3: Home Screen (Dashboard)

* Content: Personalized feed/content, main navigation.

* Interaction: Successful login leads to the main app experience.

3.3. Flow 3: Browse Content & View Details

Objective: Enable users to discover and explore content within the app.

  • Screen 3.1: Home Screen (Dashboard)

* Content: Featured content sections, personalized recommendations, search bar, bottom navigation.

* Interaction: Scroll vertically. Tap on a content card to view details. Tap search bar to initiate search.

  • Screen 3.2: Search Results Screen (if triggered by search)

* Content: Search input, filter options, list of search results.

* Interaction: Refine search, apply filters, tap on a result to view details.

  • Screen 3.3: Content Detail Screen

* Content: Large image/video, title, description, creator info, related content, action buttons (e.g., "Favorite," "Share," "Add to List").

* Interaction: Scroll vertically. Tap action buttons. Tap back arrow to return.

  • Screen 3.4: Related Content/Profile Screen (if triggered from detail)

* Content: Other items by the same creator, or a deeper dive into a related topic.

* Interaction: Navigate to further content.

3.4. Flow 4: Profile Management

Objective: Allow users to view and update their profile information.

  • Screen 4.1: Profile Tab (from Bottom Navigation)

* Content: User's profile picture, name, email, list of editable sections (e.g., "Edit Profile," "Settings," "Notifications," "Privacy," "Help," "Log Out").

* Interaction: Tap on any section to navigate to its respective screen.

  • Screen 4.2: Edit Profile Screen

* Content: Input fields for Name, Email (read-only or editable), Profile Picture (upload/change), Bio. "Save Changes" button.

* Interaction: User edits information. Tap "Save Changes."

  • Screen 4.3: Settings Screen

* Content: Toggle switches for various app settings (e.g., "Dark Mode," "Data Saver"), links to other settings screens (e.g., "Change Password").

* Interaction: Toggle settings, tap links.

  • Screen 4.4: Log Out Confirmation (if triggered)

* Content: Modal with "Are you sure you want to log out?" "Yes, Log Out" button, "Cancel" button.

* Interaction: User confirms or cancels log out.


4. Component Library

This section defines the core UI components used throughout the application, ensuring consistency in design and interaction. Each component includes its name, description, typical states, and usage guidelines.

4.1. Buttons

  • Primary Button:

* Description: Main call-to-action (CTA) button, visually prominent.

* States: Default, Pressed, Disabled, Loading.

* Usage: For critical actions like "Submit," "Create Account," "Buy Now." Only one primary button per screen.

  • Secondary Button:

* Description: Less prominent action, often an alternative or complementary action to the primary.

* States: Default, Pressed, Disabled.

* Usage: For actions like "Cancel," "Save Draft," "Learn More."

  • Tertiary/Text Button:

* Description: Minimalist button, often just text, for less critical actions or navigation.

* States: Default, Pressed, Disabled.

* Usage: "Forgot Password?", "Skip," "View All."

  • Icon Button:

* Description: Button composed solely of an icon.

* States: Default, Pressed, Disabled.

* Usage: "Share," "Favorite," "Close," "Menu."

4.2. Input Fields

  • Text Input Field:

* Description: Single-line text input.

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

* Usage: Email, Username, Name, Search. Includes clear placeholder text.

  • Password Input Field:

* Description: Single-line text input with masked characters.

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

* Usage: Password entry. Includes a "Show/Hide Password" toggle.

  • Text Area:

* Description: Multi-line text input.

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

* Usage: Comments, Descriptions, Bio.

  • Search Input Field:

* Description: Input field specifically for search, often with an icon and clear/cancel button.

* States: Default, Focused (keyboard open), Filled (with clear button), Empty State.

* Usage: Global search, filtering lists.

4.3. Selection Controls

  • Checkbox:

* Description: Allows users to select multiple options from a list.

* States: Unchecked, Checked, Indeterminate, Disabled.

* Usage: "Agree to Terms," multi-select filters.

  • Radio Button:

* Description: Allows users to select a single option from a list of mutually exclusive choices.

* States: Unselected, Selected, Disabled.

* Usage: Gender selection, single-choice preferences.

  • Toggle Switch:

* Description: Binary switch for turning an option on or off.

* States: Off, On, Disabled.

* Usage: "Enable Notifications," "Dark Mode."

4.4. Navigation

  • Bottom Navigation Bar:

* Description: Persistent navigation at the bottom of the screen for primary app destinations.

* States: Default, Active (selected icon/label).

* Usage: Main sections like Home, Search, Favorites, Profile.

  • Top App Bar (Header):

* Description: Top area containing screen title, back button, and optional actions (e.g., search icon, overflow menu).

* States: Default, Scrolled (can change elevation or hide/show elements).

* Usage: Screen title, contextual actions.

  • Hamburger Menu (Drawer Navigation):

* Description: Icon (usually three horizontal lines) that reveals a side navigation panel.

* States: Closed, Open.

* Usage: For secondary navigation or settings not fitting in bottom bar. (Use sparingly for primary navigation).

  • Tab Bar (Top Tabs):

* Description: Horizontal tabs for navigating between sibling views within a single screen.

* States: Unselected, Selected.

* Usage: Sub-sections like "Trending," "Following" within a feed.

4.5. Data Display

  • Cards:

* Description: Self-contained UI components displaying related information (e.g., image, title, description, actions).

* States: Default, Pressed.

* Usage: Product listings, article previews, user profiles.

  • Lists:

* Description: Vertically stacked rows of content.

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

* Usage: Settings menus, search results, message threads.

  • Avatars:

* Description: Circular or square image representing a user or entity.

* States: Default, Placeholder (if no image).

* Usage: User profiles, comments, chat.

4.6. Feedback & Indicators

  • Modals/Dialogs:

* Description: Overlay content that requires user interaction before proceeding.

* States: Visible, Hidden.

* Usage: Confirmation messages, critical alerts, detailed input forms.

  • Toasts/Snackbars:

* Description: Brief, transient messages that appear at the bottom of the screen to provide feedback.

* States: Visible (auto-dismissing).

* Usage: "Item added to cart," "Settings saved," "Offline."

  • Progress Indicators (Spinners/Loaders):

* Description: Visual cues indicating that an action is in progress.

* States: Indeterminate (spinning), Determinate (progress bar).

* Usage: Data loading, form submission.


5. Interaction Patterns

This section describes common interaction patterns within the app, outlining how users engage with the interface and the expected system responses.

5.1. Navigation & Gestures

  • Tap:

* Trigger: Single touch on an interactive element.

* Response: Activates button, navigates to new screen, selects item.

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