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

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

Mobile App Wireframe Kit: Detailed Study Plan

This study plan is designed to guide you through the process of mastering mobile app wireframing, from foundational UX principles to creating comprehensive wireframe specifications, interactive prototypes, and developer-ready documentation. By the end of this 4-week program, you will possess the skills and a tangible portfolio piece to showcase your expertise.


Overall Goal

To equip you with the knowledge and practical skills required to design, document, and deliver comprehensive mobile app wireframe specifications. This includes creating detailed user flows, building a reusable component library, defining interaction patterns, and preparing clear developer handoff documentation.

Target Audience: Aspiring UX/UI designers, product managers, developers looking to understand the design process, or anyone seeking to build a strong foundation in mobile app wireframing.

Duration: 4 Weeks


Week 1: Foundations of Mobile Wireframing & UX Principles

This week focuses on understanding the core concepts of wireframing and the fundamental principles of user experience design specific to mobile applications.

  • Learning Objectives:

* Understand the purpose and importance of wireframes in the product development lifecycle.

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

* Grasp fundamental UX principles (usability, accessibility, learnability, efficiency).

* Learn to create basic user flows and information architecture diagrams.

* Become familiar with the chosen design tool (Figma basics).

  • Weekly Schedule:

* Day 1-2: Introduction to Wireframing & Design Thinking

* What are wireframes? Why are they crucial in product development?

* Overview of the Design Thinking process (Empathize, Define, Ideate, Prototype, Test).

* Understanding different fidelity levels: Sketching, Wireframes, Mockups, Prototypes.

* Day 3-4: Core UX Principles & Mobile Design Guidelines

* Explore Nielsen's 10 Usability Heuristics and their application.

* Introduction to basic Accessibility principles (e.g., contrast, font size, touch targets).

* Understanding user needs, problem statements, and user stories.

* Overview of mobile platform guidelines: iOS Human Interface Guidelines and Android Material Design.

* Day 5-6: Information Architecture & User Flows

* Learn to create sitemaps and app maps to define structure.

* Practice mapping user journeys and task flows for common app scenarios.

* Figma Introduction: Familiarize yourself with the workspace, frames, basic shapes, text, and layer management.

* Practical Task: Sketch a simple 3-5 screen user flow for a common app feature (e.g., user login/signup, adding an item to a cart). Translate one of these screens into a low

gemini Output

This deliverable provides a comprehensive mobile app wireframe specification for "Chef's Companion," a recipe management application. This specification is presented in a structured, machine-readable JSON format, serving as a blueprint for the user interface, user flows, and interaction logic. It includes detailed screen flows, a reusable component library, defined interaction patterns, and crucial developer handoff notes to ensure a smooth transition to the development phase.

The output adheres to the generate_code step by providing a structured JSON output that can be directly consumed by development teams or design tools for further elaboration. Explanations for each section are provided both in the markdown text and within the JSON structure via _comment fields.


Mobile App Wireframe Specification: Chef's Companion

Project Overview

App Name: Chef's Companion

App Description: A mobile application designed to help users discover, manage, and share recipes. It aims to provide an intuitive interface for browsing, searching, and organizing culinary inspirations.

Version: 1.0.0-wireframe

Date Generated: 2023-10-27

This specification outlines the foundational structure and behavior of the Chef's Companion mobile application. It details the user journey through various screens, defines reusable UI components, specifies how users will interact with the app, and provides essential guidelines for developers.

Specification Structure (JSON)

The following JSON object encapsulates the entire wireframe specification. Each top-level key corresponds to a major section of the specification, as detailed below.


{
  "_comment": "Chef's Companion Mobile App Wireframe Specification - Generated Code",
  "app_name": "Chef's Companion",
  "app_description": "A mobile application for discovering, managing, and sharing recipes, providing an intuitive interface for browsing, searching, and organizing culinary inspirations.",
  "version": "1.0.0-wireframe",
  "date_generated": "2023-10-27",
  "wireframe_specification": {
    "_comment": "This section contains the core wireframe details: screen flows, component library, interaction patterns, and developer handoff notes.",

    "screen_flows": [
      {
        "_comment": "SCR001: Splash Screen - Initial app launch screen.",
        "id": "SCR001_Splash",
        "name": "Splash Screen",
        "description": "Displays the app logo and branding. Automatically transitions to Onboarding for new users or Home for logged-in users.",
        "ui_elements": [
          {"type": "Image", "id": "IMG001_AppLogo", "description": "Chef's Companion logo"},
          {"type": "Text", "id": "TXT001_AppName", "content": "Chef's Companion", "style": "H1"}
        ],
        "navigation_paths": [
          {
            "trigger": "Automatic after 2 seconds",
            "target_screen_id": "SCR002_Onboarding",
            "condition": "First launch or user not logged in",
            "effect": "Fade out, fade in"
          },
          {
            "trigger": "Automatic after 2 seconds",
            "target_screen_id": "SCR004_HomeFeed",
            "condition": "User already logged in",
            "effect": "Fade out, fade in"
          }
        ]
      },
      {
        "_comment": "SCR002: Onboarding Screen - Introduces app features to new users.",
        "id": "SCR002_Onboarding",
        "name": "Onboarding Screen",
        "description": "A series of introductory slides highlighting key app features. Ends with a 'Get Started' button.",
        "ui_elements": [
          {"type": "Carousel", "id": "CAR001_OnboardingSlides", "items": [
            {"image": "onboarding_1.png", "title": "Discover New Recipes", "description": "Explore a world of culinary delights."},
            {"image": "onboarding_2.png", "title": "Organize Your Favorites", "description": "Save and categorize your must-try dishes."},
            {"image": "onboarding_3.png", "title": "Share Your Creations", "description": "Inspire others with your unique recipes."}
          ]},
          {"type": "Button", "id": "BTN001_GetStarted", "component_id": "COMP001_PrimaryButton", "text": "Get Started"}
        ],
        "navigation_paths": [
          {
            "trigger": "Tap on BTN001_GetStarted",
            "target_screen_id": "SCR003_Auth",
            "effect": "Slide left"
          }
        ]
      },
      {
        "_comment": "SCR003: Authentication Screen - Login or Signup.",
        "id": "SCR003_Auth",
        "name": "Authentication Screen",
        "description": "Allows users to log in with existing accounts or create new ones, including social login options.",
        "ui_elements": [
          {"type": "Text", "id": "TXT002_Welcome", "content": "Welcome to Chef's Companion", "style": "H2"},
          {"type": "Input", "id": "INP001_Email", "component_id": "COMP002_InputField", "placeholder": "Email Address", "keyboard_type": "email-address"},
          {"type": "Input", "id": "INP002_Password", "component_id": "COMP002_InputField", "placeholder": "Password", "secure_text_entry": true},
          {"type": "Button", "id": "BTN002_Login", "component_id": "COMP001_PrimaryButton", "text": "Log In"},
          {"type": "TextLink", "id": "LNK001_ForgotPassword", "content": "Forgot Password?", "target_screen_id": "SCR_ForgotPassword"},
          {"type": "Divider", "id": "DIV001_Or", "content": "OR"},
          {"type": "Button", "id": "BTN003_GoogleLogin", "component_id": "COMP003_SocialButton", "icon": "google", "text": "Continue with Google"},
          {"type": "Button", "id": "BTN004_AppleLogin", "component_id": "COMP003_SocialButton", "icon": "apple", "text": "Continue with Apple"},
          {"type": "TextLink", "id": "LNK002_SignUp", "content": "Don't have an account? Sign Up", "target_screen_id": "SCR_SignUp"}
        ],
        "navigation_paths": [
          {
            "trigger": "Tap on BTN002_Login (successful)",
            "target_screen_id": "SCR004_HomeFeed",
            "effect": "Replace stack"
          },
          {
            "trigger": "Tap on BTN003_GoogleLogin (successful)",
            "target_screen_id": "SCR004_HomeFeed",
            "effect": "Replace stack"
          },
          {
            "trigger": "Tap on LNK002_SignUp",
            "target_screen_id": "SCR_SignUp",
            "effect": "Slide left"
          }
        ]
      },
      {
        "_comment": "SCR004: Home
gemini Output

Mobile App Wireframe Specification & Kit: Comprehensive Deliverable

This document serves as the complete mobile app wireframe specification, detailing the user experience, interaction patterns, component library, and developer handoff notes for your upcoming mobile application. It is designed to provide a clear blueprint for development, ensuring alignment across design, product, and engineering teams.


1. Executive Summary

This deliverable provides a foundational design specification for your mobile application, focusing on core user flows and key screen layouts. It encompasses a detailed breakdown of user journeys, a comprehensive component library, defined interaction patterns, and essential notes for seamless developer handoff. The goal is to establish a clear, consistent, and actionable framework for the app's structure and user interaction before visual design and development commence.


2. Overall App Vision & Goals (Wireframe Context)

The wireframes outlined in this specification are designed to achieve the following high-level objectives:

  • Clarity: Provide a clear, intuitive user experience for core functionalities.
  • Efficiency: Enable users to complete primary tasks with minimal friction.
  • Consistency: Establish a uniform look, feel, and interaction model across the application.
  • Scalability: Lay a robust foundation that can easily accommodate future features and iterations.

3. Wireframe Specification Overview

This section details the purpose, scope, and target audience for this wireframe specification.

3.1. Purpose of Wireframes

  • Define Information Hierarchy: Clearly outline the structure and organization of content on each screen.
  • Map User Flows: Illustrate the sequence of screens and interactions users will experience to complete tasks.
  • Establish Core Functionality: Focus on the essential features and their placement without distraction from visual styling.
  • Facilitate Early Feedback: Provide a tangible artifact for stakeholders to review and provide feedback on usability and functionality early in the development cycle.
  • Bridge Design & Development: Serve as a critical communication tool between design, product, and engineering teams.

3.2. Scope of This Document

This specification covers:

  • Key User Journeys: Core pathways users will take through the application.
  • Screen-by-Screen Layouts: Textual descriptions of primary screens and their content organization.
  • Core UI Component Library: A catalog of reusable interface elements.
  • Standard Interaction Patterns: Definitions of how users will interact with the app and its components.
  • Developer Handoff Notes: Practical guidance for engineering implementation.

This document does not include: visual design (colors, typography, imagery), animations beyond basic transitions, or detailed technical architecture.

3.3. Target Audience

This document is intended for:

  • Product Managers: To validate functionality and user experience.
  • UI/UX Designers: As a foundation for visual design and high-fidelity prototyping.
  • Software Developers: To understand the application structure, functionality, and interaction logic for implementation.
  • Quality Assurance (QA) Engineers: To inform test case development.

4. Screen Flows (User Journeys)

This section outlines the primary user flows within the application, detailing the sequence of screens and key actions. Each flow is designed to achieve a specific user goal.

4.1. Flow 1: New User Onboarding & Account Creation

  • Goal: Allow a new user to understand the app's value and create an account.
  • Screens:

1. Welcome/Splash Screen: App logo, brief tagline.

2. Onboarding Carousel (3-5 screens):

* Screen 1: "Discover [App Benefit 1]" with illustration.

* Screen 2: "Organize [App Benefit 2]" with illustration.

* Screen 3: "Connect [App Benefit 3]" with illustration.

Call to Action:* "Get Started" button, "Skip" (optional).

3. Sign Up/Login Choice Screen:

* Options: "Sign Up with Email," "Continue with Google," "Continue with Apple," "Already have an account? Log In."

4. Sign Up (Email) Screen:

* Input Fields: Full Name, Email Address, Password (with "Show/Hide" toggle), Confirm Password.

* Checkbox: "I agree to the Terms of Service and Privacy Policy." (with links).

* Button: "Create Account."

5. Verification Screen (Optional):

* Message: "Check your email for a verification link."

* Input Field: OTP/Code (if email verification is in-app).

* Button: "Verify," "Resend Code."

6. Profile Setup (Optional):

* Fields: Profile Picture upload, Username, Bio (optional).

* Button: "Continue," "Skip for now."

7. Permissions Request (Optional):

* Pop-ups for Push Notifications, Location, Camera, etc. (system-level prompts).

* Button: "Allow," "Deny."

8. Home Screen: User lands on the main dashboard/feed.

4.2. Flow 2: Existing User Login

  • Goal: Allow a returning user to access their account.
  • Screens:

1. Welcome/Splash Screen.

2. Sign Up/Login Choice Screen (user selects "Log In").

3. Login Screen:

* Input Fields: Email Address, Password (with "Show/Hide" toggle).

* Link: "Forgot Password?".

* Button: "Log In."

* Divider: "Or log in with."

* Buttons: "Continue with Google," "Continue with Apple."

4. Home Screen.

4.3. Flow 3: Main Feature X (e.g., Creating a New Task/Post)

  • Goal: Enable a user to create and publish new content.
  • Screens:

1. Home Screen: User taps "Add New" (+) button in navigation bar/FAB.

2. Create New Screen:

* Input Field: Title (single line).

* Input Field: Description (multi-line textarea).

* Options: Add Image/Video (icon button), Add Tag (chip input), Set Due Date/Time (date/time picker), Assign To (user picker).

* Button: "Publish/Save."

* Button: "Cancel."

3. Confirmation/Success Message: Toast or brief overlay indicating success.

4. Home Screen (with new content displayed).

4.4. Flow 4: Profile Management

  • Goal: Allow a user to view and update their profile information.
  • Screens:

1. Home Screen: User taps "Profile" icon in bottom navigation or menu.

2. Profile View Screen:

* Display: Profile Picture, Username, Bio, Stats (e.g., "Posts: 10," "Followers: 100").

* Buttons: "Edit Profile," "Settings," "Logout."

* Sections: User's posts/activities feed.

3. Edit Profile Screen:

* Input Fields: Name, Username, Bio.

* Action: "Change Profile Picture" (opens camera/gallery).

* Button: "Save Changes."

* Button: "Cancel."

4. Settings Screen:

* List Items: Account Settings, Notification Preferences, Privacy Settings, Help & Support, About App.

* Toggle: Dark Mode.

* Button: "Log Out."


5. Component Library

This section outlines the reusable UI components that form the building blocks of the application. For each component, typical states and usage guidelines are provided.

5.1. Navigation Components

  • Top App Bar (Header):

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

* States: Default, Scrolled (can shrink or change background), Contextual (e.g., "Edit" mode with different actions).

  • Bottom Navigation Bar:

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

* States: Default, Selected (highlighted icon/text), Inactive.

  • Floating Action Button (FAB):

* Usage: Primary action (e.g., "Create New," "Add").

* States: Default, Pressed, Disabled, Expanded (if it reveals sub-actions).

  • Side Drawer/Hamburger Menu (Optional):

* Elements: User profile summary, list of secondary navigation links, settings, logout.

* Usage: Accessed via hamburger icon in top app bar.

5.2. Input Components

  • Text Input Field:

* Elements: Label, Placeholder text, Input area, Optional helper text/error message.

* States: Default, Focused, Filled, Error (red border/text), Disabled.

* Variations: Single-line, Multi-line (Textarea), Password (with toggle for visibility).

  • Search Bar:

* Elements: Search icon, Placeholder text, Input area, Clear button (X).

* States: Default, Focused (keyboard active), With results, No results.

  • Dropdown/Picker:

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

* States: Default, Active (opens selection list/native picker), Disabled.

  • Checkbox:

* Elements: Square box, Label text.

* States: Unchecked, Checked, Indeterminate, Disabled (checked/unchecked).

  • Radio Button:

* Elements: Circular button, Label text.

* States: Unselected, Selected, Disabled (selected/unselected).

  • Toggle Switch:

* Elements: Switch control, Label text.

* States: Off, On, Disabled (off/on).

  • Date/Time Picker:

* Usage: Select dates or times, typically invokes native OS picker.

5.3. Buttons

  • Primary Button:

* Usage: Main call to action on a screen.

* States: Default, Pressed, Hover (web-only, but consider visual feedback), Disabled.

  • Secondary/Outline Button:

* Usage: Less prominent actions, often paired with a primary button.

* States: Default, Pressed, Disabled.

  • Text Button:

* Usage: Low-emphasis actions, typically within a sentence or alongside other content.

* States: Default, Pressed, Disabled.

  • Icon Button:

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

* States: Default, Pressed, Disabled.

5.4. Content Display

  • Cards:

* Usage: Grouping related information into a digestible block.

* Elements: Image (optional), Title, Subtitle, Body text, Action buttons/links.

  • Lists:

* Usage: Displaying a series of items (e.g., settings, feed items).

* Elements: Leading icon/image, Primary text, Secondary text, Trailing icon/action.

* Variations: Simple, Two-line, Three-line, Divider lines.

  • Avatars:

* Usage: Representing users or entities.

* Variations: Circular, Square; various sizes.

  • Badges/Tags (Chips):

* Usage: Small, informative labels (e.g., categories, status).

* States: Default, Interactive (tappable), Dismissible (with 'X' icon).

  • Progress Indicators:

* Usage: Show loading status.

* Variations: Linear (progress bar), Circular (spinner).

5.5. Feedback & Notifications

  • Toast/Snackbar:

* Usage: Brief, non-intrusive messages (e.g., "Item saved successfully").

* Elements: Message text, Optional action button ("Undo").

* Behavior: Appears temporarily, disappears automatically.

  • Alert Dialog:

* Usage: Critical information, requires user action (e.g., "Confirm Delete").

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

* Behavior: Modal, blocks interaction with background.


6. Interaction Patterns

This section defines the standard ways users will interact with the application and its components.

6.1. Navigation Interactions

  • Tap: Primary interaction for activating buttons, list items, and links.
  • Back Button: Always navigates to the previous screen in the stack. In the root screen, it typically exits the app or minimizes it.
  • Bottom Navigation: Tapping an icon navigates directly to the associated root screen, clearing the current navigation stack for that tab.
  • Side Drawer: Swiping from the left edge (or tapping hamburger icon) reveals the menu. Tapping outside or swiping right closes it.

6.2. Content Interaction

  • Scroll: Vertical scrolling for lengthy content. Horizontal scrolling for carousels or tab views.
  • Swipe:

* Horizontal: Used for tab navigation, image carousels, or dismissing items (e.g., swipe to delete a list item).

* Vertical (Pull-to-Refresh): Pulling down on a scrollable view refres

mobile_app_wireframe_kit.md
Download as Markdown
Copy all content
Full output as text
Download ZIP
IDE-ready project ZIP
Copy share link
Permanent URL for this run
Get Embed Code
Embed this result on any website
Print / Save PDF
Use browser print dialog
\n\n\n"); var hasSrcMain=Object.keys(extracted).some(function(k){return k.indexOf("src/main")>=0;}); if(!hasSrcMain) zip.file(folder+"src/main."+ext,"import React from 'react'\nimport ReactDOM from 'react-dom/client'\nimport App from './App'\nimport './index.css'\n\nReactDOM.createRoot(document.getElementById('root')!).render(\n \n \n \n)\n"); var hasSrcApp=Object.keys(extracted).some(function(k){return k==="src/App."+ext||k==="App."+ext;}); if(!hasSrcApp) zip.file(folder+"src/App."+ext,"import React from 'react'\nimport './App.css'\n\nfunction App(){\n return(\n
\n
\n

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

\n
\n
\n )\n}\nexport default App\n"); zip.file(folder+"src/index.css","*{margin:0;padding:0;box-sizing:border-box}\nbody{font-family:system-ui,-apple-system,sans-serif;background:#f0f2f5;color:#1a1a2e}\n.app{min-height:100vh;display:flex;flex-direction:column}\n.app-header{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:40px}\nh1{font-size:2.5rem;font-weight:700}\n"); zip.file(folder+"src/App.css",""); zip.file(folder+"src/components/.gitkeep",""); zip.file(folder+"src/pages/.gitkeep",""); zip.file(folder+"src/hooks/.gitkeep",""); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nnpm run dev\n\`\`\`\n\n## Build\n\`\`\`bash\nnpm run build\n\`\`\`\n\n## Open in IDE\nOpen the project folder in VS Code or WebStorm.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n"); } /* --- Vue (Vite + Composition API + TypeScript) --- */ function buildVue(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var extracted=extractCode(panelTxt); zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "0.0.0",\n "type": "module",\n "scripts": {\n "dev": "vite",\n "build": "vue-tsc -b && vite build",\n "preview": "vite preview"\n },\n "dependencies": {\n "vue": "^3.5.13",\n "vue-router": "^4.4.5",\n "pinia": "^2.3.0",\n "axios": "^1.7.9"\n },\n "devDependencies": {\n "@vitejs/plugin-vue": "^5.2.1",\n "typescript": "~5.7.3",\n "vite": "^6.0.5",\n "vue-tsc": "^2.2.0"\n }\n}\n'); zip.file(folder+"vite.config.ts","import { defineConfig } from 'vite'\nimport vue from '@vitejs/plugin-vue'\nimport { resolve } from 'path'\n\nexport default defineConfig({\n plugins: [vue()],\n resolve: { alias: { '@': resolve(__dirname,'src') } }\n})\n"); zip.file(folder+"tsconfig.json",'{"files":[],"references":[{"path":"./tsconfig.app.json"},{"path":"./tsconfig.node.json"}]}\n'); zip.file(folder+"tsconfig.app.json",'{\n "compilerOptions":{\n "target":"ES2020","useDefineForClassFields":true,"module":"ESNext","lib":["ES2020","DOM","DOM.Iterable"],\n "skipLibCheck":true,"moduleResolution":"bundler","allowImportingTsExtensions":true,\n "isolatedModules":true,"moduleDetection":"force","noEmit":true,"jsxImportSource":"vue",\n "strict":true,"paths":{"@/*":["./src/*"]}\n },\n "include":["src/**/*.ts","src/**/*.d.ts","src/**/*.tsx","src/**/*.vue"]\n}\n'); zip.file(folder+"env.d.ts","/// \n"); zip.file(folder+"index.html","\n\n\n \n \n "+slugTitle(pn)+"\n\n\n
\n \n\n\n"); var hasMain=Object.keys(extracted).some(function(k){return k==="src/main.ts"||k==="main.ts";}); if(!hasMain) zip.file(folder+"src/main.ts","import { createApp } from 'vue'\nimport { createPinia } from 'pinia'\nimport App from './App.vue'\nimport './assets/main.css'\n\nconst app = createApp(App)\napp.use(createPinia())\napp.mount('#app')\n"); var hasApp=Object.keys(extracted).some(function(k){return k.indexOf("App.vue")>=0;}); if(!hasApp) zip.file(folder+"src/App.vue","\n\n\n\n\n"); zip.file(folder+"src/assets/main.css","*{margin:0;padding:0;box-sizing:border-box}body{font-family:system-ui,sans-serif;background:#fff;color:#213547}\n"); zip.file(folder+"src/components/.gitkeep",""); zip.file(folder+"src/views/.gitkeep",""); zip.file(folder+"src/stores/.gitkeep",""); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nnpm run dev\n\`\`\`\n\n## Build\n\`\`\`bash\nnpm run build\n\`\`\`\n\nOpen in VS Code or WebStorm.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n"); } /* --- Angular (v19 standalone) --- */ function buildAngular(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var sel=pn.replace(/_/g,"-"); var extracted=extractCode(panelTxt); zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "0.0.0",\n "scripts": {\n "ng": "ng",\n "start": "ng serve",\n "build": "ng build",\n "test": "ng test"\n },\n "dependencies": {\n "@angular/animations": "^19.0.0",\n "@angular/common": "^19.0.0",\n "@angular/compiler": "^19.0.0",\n "@angular/core": "^19.0.0",\n "@angular/forms": "^19.0.0",\n "@angular/platform-browser": "^19.0.0",\n "@angular/platform-browser-dynamic": "^19.0.0",\n "@angular/router": "^19.0.0",\n "rxjs": "~7.8.0",\n "tslib": "^2.3.0",\n "zone.js": "~0.15.0"\n },\n "devDependencies": {\n "@angular-devkit/build-angular": "^19.0.0",\n "@angular/cli": "^19.0.0",\n "@angular/compiler-cli": "^19.0.0",\n "typescript": "~5.6.0"\n }\n}\n'); zip.file(folder+"angular.json",'{\n "$schema": "./node_modules/@angular/cli/lib/config/schema.json",\n "version": 1,\n "newProjectRoot": "projects",\n "projects": {\n "'+pn+'": {\n "projectType": "application",\n "root": "",\n "sourceRoot": "src",\n "prefix": "app",\n "architect": {\n "build": {\n "builder": "@angular-devkit/build-angular:application",\n "options": {\n "outputPath": "dist/'+pn+'",\n "index": "src/index.html",\n "browser": "src/main.ts",\n "tsConfig": "tsconfig.app.json",\n "styles": ["src/styles.css"],\n "scripts": []\n }\n },\n "serve": {"builder":"@angular-devkit/build-angular:dev-server","configurations":{"production":{"buildTarget":"'+pn+':build:production"},"development":{"buildTarget":"'+pn+':build:development"}},"defaultConfiguration":"development"}\n }\n }\n }\n}\n'); zip.file(folder+"tsconfig.json",'{\n "compileOnSave": false,\n "compilerOptions": {"baseUrl":"./","outDir":"./dist/out-tsc","forceConsistentCasingInFileNames":true,"strict":true,"noImplicitOverride":true,"noPropertyAccessFromIndexSignature":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"paths":{"@/*":["src/*"]},"skipLibCheck":true,"esModuleInterop":true,"sourceMap":true,"declaration":false,"experimentalDecorators":true,"moduleResolution":"bundler","importHelpers":true,"target":"ES2022","module":"ES2022","useDefineForClassFields":false,"lib":["ES2022","dom"]},\n "references":[{"path":"./tsconfig.app.json"}]\n}\n'); zip.file(folder+"tsconfig.app.json",'{\n "extends":"./tsconfig.json",\n "compilerOptions":{"outDir":"./dist/out-tsc","types":[]},\n "files":["src/main.ts"],\n "include":["src/**/*.d.ts"]\n}\n'); zip.file(folder+"src/index.html","\n\n\n \n "+slugTitle(pn)+"\n \n \n \n\n\n \n\n\n"); zip.file(folder+"src/main.ts","import { bootstrapApplication } from '@angular/platform-browser';\nimport { appConfig } from './app/app.config';\nimport { AppComponent } from './app/app.component';\n\nbootstrapApplication(AppComponent, appConfig)\n .catch(err => console.error(err));\n"); zip.file(folder+"src/styles.css","* { margin: 0; padding: 0; box-sizing: border-box; }\nbody { font-family: system-ui, -apple-system, sans-serif; background: #f9fafb; color: #111827; }\n"); var hasComp=Object.keys(extracted).some(function(k){return k.indexOf("app.component")>=0;}); if(!hasComp){ zip.file(folder+"src/app/app.component.ts","import { Component } from '@angular/core';\nimport { RouterOutlet } from '@angular/router';\n\n@Component({\n selector: 'app-root',\n standalone: true,\n imports: [RouterOutlet],\n templateUrl: './app.component.html',\n styleUrl: './app.component.css'\n})\nexport class AppComponent {\n title = '"+pn+"';\n}\n"); zip.file(folder+"src/app/app.component.html","
\n
\n

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

\n
\n \n
\n"); zip.file(folder+"src/app/app.component.css",".app-header{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:60vh;gap:16px}h1{font-size:2.5rem;font-weight:700;color:#6366f1}\n"); } zip.file(folder+"src/app/app.config.ts","import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';\nimport { provideRouter } from '@angular/router';\nimport { routes } from './app.routes';\n\nexport const appConfig: ApplicationConfig = {\n providers: [\n provideZoneChangeDetection({ eventCoalescing: true }),\n provideRouter(routes)\n ]\n};\n"); zip.file(folder+"src/app/app.routes.ts","import { Routes } from '@angular/router';\n\nexport const routes: Routes = [];\n"); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nng serve\n# or: npm start\n\`\`\`\n\n## Build\n\`\`\`bash\nng build\n\`\`\`\n\nOpen in VS Code with Angular Language Service extension.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n.angular/\n"); } /* --- Python --- */ function buildPython(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^\`\`\`[\w]*\n?/m,"").replace(/\n?\`\`\`$/m,"").trim(); var reqMap={"numpy":"numpy","pandas":"pandas","sklearn":"scikit-learn","tensorflow":"tensorflow","torch":"torch","flask":"flask","fastapi":"fastapi","uvicorn":"uvicorn","requests":"requests","sqlalchemy":"sqlalchemy","pydantic":"pydantic","dotenv":"python-dotenv","PIL":"Pillow","cv2":"opencv-python","matplotlib":"matplotlib","seaborn":"seaborn","scipy":"scipy"}; var reqs=[]; Object.keys(reqMap).forEach(function(k){if(src.indexOf("import "+k)>=0||src.indexOf("from "+k)>=0)reqs.push(reqMap[k]);}); var reqsTxt=reqs.length?reqs.join("\n"):"# add dependencies here\n"; zip.file(folder+"main.py",src||"# "+title+"\n# Generated by PantheraHive BOS\n\nprint(title+\" loaded\")\n"); zip.file(folder+"requirements.txt",reqsTxt); zip.file(folder+".env.example","# Environment variables\n"); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n\`\`\`\n\n## Run\n\`\`\`bash\npython main.py\n\`\`\`\n"); zip.file(folder+".gitignore",".venv/\n__pycache__/\n*.pyc\n.env\n.DS_Store\n"); } /* --- Node.js --- */ function buildNode(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^\`\`\`[\w]*\n?/m,"").replace(/\n?\`\`\`$/m,"").trim(); var depMap={"mongoose":"^8.0.0","dotenv":"^16.4.5","axios":"^1.7.9","cors":"^2.8.5","bcryptjs":"^2.4.3","jsonwebtoken":"^9.0.2","socket.io":"^4.7.4","uuid":"^9.0.1","zod":"^3.22.4","express":"^4.18.2"}; var deps={}; Object.keys(depMap).forEach(function(k){if(src.indexOf(k)>=0)deps[k]=depMap[k];}); if(!deps["express"])deps["express"]="^4.18.2"; var pkgJson=JSON.stringify({"name":pn,"version":"1.0.0","main":"src/index.js","scripts":{"start":"node src/index.js","dev":"nodemon src/index.js"},"dependencies":deps,"devDependencies":{"nodemon":"^3.0.3"}},null,2)+"\n"; zip.file(folder+"package.json",pkgJson); var fallback="const express=require(\"express\");\nconst app=express();\napp.use(express.json());\n\napp.get(\"/\",(req,res)=>{\n res.json({message:\""+title+" API\"});\n});\n\nconst PORT=process.env.PORT||3000;\napp.listen(PORT,()=>console.log(\"Server on port \"+PORT));\n"; zip.file(folder+"src/index.js",src||fallback); zip.file(folder+".env.example","PORT=3000\n"); zip.file(folder+".gitignore","node_modules/\n.env\n.DS_Store\n"); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\n\`\`\`\n\n## Run\n\`\`\`bash\nnpm run dev\n\`\`\`\n"); } /* --- Vanilla HTML --- */ function buildVanillaHtml(zip,folder,app,code){ var title=slugTitle(app); var isFullDoc=code.trim().toLowerCase().indexOf("=0||code.trim().toLowerCase().indexOf("=0; var indexHtml=isFullDoc?code:"\n\n\n\n\n"+title+"\n\n\n\n"+code+"\n\n\n\n"; zip.file(folder+"index.html",indexHtml); zip.file(folder+"style.css","/* "+title+" — styles */\n*{margin:0;padding:0;box-sizing:border-box}\nbody{font-family:system-ui,-apple-system,sans-serif;background:#fff;color:#1a1a2e}\n"); zip.file(folder+"script.js","/* "+title+" — scripts */\n"); zip.file(folder+"assets/.gitkeep",""); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Open\nDouble-click \`index.html\` in your browser.\n\nOr serve locally:\n\`\`\`bash\nnpx serve .\n# or\npython3 -m http.server 3000\n\`\`\`\n"); zip.file(folder+".gitignore",".DS_Store\nnode_modules/\n.env\n"); } /* ===== MAIN ===== */ var sc=document.createElement("script"); sc.src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"; sc.onerror=function(){ if(lbl)lbl.textContent="Download ZIP"; alert("JSZip load failed — check connection."); }; sc.onload=function(){ var zip=new JSZip(); var base=(_phFname||"output").replace(/\.[^.]+$/,""); var app=base.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")||"my_app"; var folder=app+"/"; var vc=document.getElementById("panel-content"); var panelTxt=vc?(vc.innerText||vc.textContent||""):""; var lang=detectLang(_phCode,panelTxt); if(_phIsHtml){ buildVanillaHtml(zip,folder,app,_phCode); } else if(lang==="flutter"){ buildFlutter(zip,folder,app,_phCode,panelTxt); } else if(lang==="react-native"){ buildReactNative(zip,folder,app,_phCode,panelTxt); } else if(lang==="swift"){ buildSwift(zip,folder,app,_phCode,panelTxt); } else if(lang==="kotlin"){ buildKotlin(zip,folder,app,_phCode,panelTxt); } else if(lang==="react"){ buildReact(zip,folder,app,_phCode,panelTxt); } else if(lang==="vue"){ buildVue(zip,folder,app,_phCode,panelTxt); } else if(lang==="angular"){ buildAngular(zip,folder,app,_phCode,panelTxt); } else if(lang==="python"){ buildPython(zip,folder,app,_phCode); } else if(lang==="node"){ buildNode(zip,folder,app,_phCode); } else { /* Document/content workflow */ var title=app.replace(/_/g," "); var md=_phAll||_phCode||panelTxt||"No content"; zip.file(folder+app+".md",md); var h=""+title+""; h+="

"+title+"

"; var hc=md.replace(/&/g,"&").replace(//g,">"); hc=hc.replace(/^### (.+)$/gm,"

$1

"); hc=hc.replace(/^## (.+)$/gm,"

$1

"); hc=hc.replace(/^# (.+)$/gm,"

$1

"); hc=hc.replace(/\*\*(.+?)\*\*/g,"$1"); hc=hc.replace(/\n{2,}/g,"

"); h+="

"+hc+"

Generated by PantheraHive BOS
"; zip.file(folder+app+".html",h); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\nFiles:\n- "+app+".md (Markdown)\n- "+app+".html (styled HTML)\n"); } zip.generateAsync({type:"blob"}).then(function(blob){ var a=document.createElement("a"); a.href=URL.createObjectURL(blob); a.download=app+".zip"; a.click(); URL.revokeObjectURL(a.href); if(lbl)lbl.textContent="Download ZIP"; }); }; document.head.appendChild(sc); } function phShare(){navigator.clipboard.writeText(window.location.href).then(function(){var el=document.getElementById("ph-share-lbl");if(el){el.textContent="Link copied!";setTimeout(function(){el.textContent="Copy share link";},2500);}});}function phEmbed(){var runId=window.location.pathname.split("/").pop().replace(".html","");var embedUrl="https://pantherahive.com/embed/"+runId;var code='';navigator.clipboard.writeText(code).then(function(){var el=document.getElementById("ph-embed-lbl");if(el){el.textContent="Embed code copied!";setTimeout(function(){el.textContent="Get Embed Code";},2500);}});}