Mobile App UI Designer
Run ID: 69cc84c33e7fb09ff16a29942026-04-01Design
PantheraHive BOS
BOS Dashboard

Deliverable: Mobile App UI Design - Code Implementation Examples

This document provides a set of comprehensive, detailed, and production-ready code examples designed to jumpstart the implementation phase of your mobile application's User Interface (UI). As a Mobile App UI Designer, this output translates design concepts into actionable code, focusing on core UI components, layout structures, and styling principles using the Flutter framework.

The goal is to provide a solid foundation that can be directly integrated, modified, and expanded upon by your development team, ensuring a seamless transition from design mockups to a functional, aesthetically pleasing mobile application.


1. Introduction to the Code Deliverable

This deliverable focuses on providing modular, reusable UI code snippets written in Dart for the Flutter framework. Flutter is chosen for its declarative UI approach, excellent performance, and cross-platform capabilities, making it an ideal choice for implementing modern mobile app UIs.

The provided code covers:

Each code block is accompanied by detailed explanations and comments to facilitate understanding and integration.


2. Core UI Component Examples

This section provides code for essential UI components, demonstrating their basic usage and common configurations.

2.1. Text Display

The Text widget is fundamental for displaying static text.

text • 771 chars
**Explanation:**
*   `Image.network`: Loads an image from a URL.
*   `Image.asset`: Loads an image from your project's `assets` folder (requires configuration in `pubspec.yaml`).
*   `Icon`: Displays a material design icon.
*   `width`, `height`: Control the dimensions of the image.
*   `fit`: Determines how the image should be scaled and positioned within its bounds (e.g., `BoxFit.cover`, `BoxFit.contain`).
*   `loadingBuilder`, `errorBuilder`: Provide callbacks for showing loading indicators or error messages during network image loading.

---

### 3. Layout Examples

Effective layouts are crucial for organizing UI elements on a screen.

#### 3.1. Basic Screen Structure (`Scaffold`)

`Scaffold` provides the basic visual structure for a material design app.

Sandboxed live preview

Comprehensive Study Plan: Mobile App UI Designer

This document outlines a detailed, professional study plan designed to equip you with the essential skills and knowledge to become a proficient Mobile App UI Designer. This plan is structured to provide a comprehensive learning journey, combining theoretical understanding with practical application, culminating in a portfolio-ready skillset.


1. Overall Goal

The primary goal of this study plan is to transform you into a competent Mobile App UI Designer capable of creating intuitive, aesthetically pleasing, and user-centered interfaces for mobile applications across various platforms. By the end of this program, you will be able to understand user needs, apply core design principles, utilize industry-standard tools, and effectively communicate your design decisions.


2. Learning Objectives

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

  • Understand Core UI/UX Principles: Grasp fundamental concepts of user experience (UX) and user interface (UI) design, including usability heuristics, user-centered design methodologies, and information architecture.
  • Conduct Basic User Research: Apply foundational techniques for understanding user behaviors, needs, and pain points, such as user interviews and competitive analysis.
  • Master Design Tools: Become proficient in industry-standard UI design software (e.g., Figma) for creating wireframes, mockups, and interactive prototypes.
  • Apply Visual Design Principles: Effectively utilize typography, color theory, iconography, imagery, and layout principles to create visually appealing and branded interfaces.
  • Design for Mobile Platforms: Understand and apply platform-specific guidelines (iOS Human Interface Guidelines, Material Design) and common mobile UI patterns.
  • Create Interactive Prototypes: Develop high-fidelity interactive prototypes to simulate user flows and test design concepts.
  • Develop a Design System Mindset: Understand the importance of consistency and reusability through components and basic design system principles.
  • Ensure Accessibility: Integrate accessibility best practices into UI designs to cater to a wider range of users.
  • Build a Professional Portfolio: Compile and present a curated collection of your design projects, showcasing your skills and design process.
  • Collaborate Effectively: Understand the design handoff process and how to work with developers and other stakeholders.

3. Weekly Schedule (12-Week Intensive Program)

This 12-week schedule is designed for dedicated study, assuming approximately 15-20 hours per week of learning and practice.

Module 1: Foundations of UI/UX & User Understanding (Weeks 1-3)

  • Week 1: Introduction to UI/UX & Design Thinking

* Focus: Core concepts of UI vs. UX, Design Thinking process, User-Centered Design.

* Activities: Readings, introductory online courses, case study analysis of good/bad app UIs.

* Practical: Identify 3 apps with excellent UI/UX and 3 with poor UI/UX, write a short analysis for each.

  • Week 2: User Research & Information Architecture (IA)

* Focus: Basic user research methods (interviews, surveys, competitive analysis), creating user personas, user flows, site maps, IA principles.

* Activities: Learn about user research techniques, practice creating user personas and basic user flows for a hypothetical app.

* Practical: Choose a simple app idea, create 2-3 user personas, and a basic user flow for a key feature.

  • Week 3: Wireframing & Low-Fidelity Prototyping

* Focus: Sketching, paper prototyping, digital wireframing (grayscale, basic layout), understanding hierarchy and layout.

* Activities: Practice sketching app screens, learn a wireframing tool (e.g., Figma), convert sketches to digital wireframes.

* Practical: Based on Week 2's app idea, create low-fidelity wireframes for 5-7 core screens.

Module 2: Visual Design & Tool Mastery (Weeks 4-6)

  • Week 4: Visual Design Principles - Typography & Color

* Focus: Principles of typography (pairing, hierarchy, readability), color theory (palettes, meaning, accessibility), contrast.

* Activities: Study typography and color theory, analyze how professional apps use these elements.

* Practical: Experiment with different font pairings and color palettes for your app idea. Create a basic style guide.

  • Week 5: Visual Design Principles - Iconography, Imagery & Layout

* Focus: Iconography best practices, image selection and optimization, grid systems, spacing, alignment, visual hierarchy.

* Activities: Learn about icon design principles, practice using grid systems in Figma.

* Practical: Design a set of 5-7 icons for your app idea. Apply grid systems to refine your wireframes from Week 3 into more structured layouts.

  • Week 6: Introduction to Figma (or chosen design tool)

* Focus: Mastering essential features of Figma (frames, shapes, text, components, auto layout, plugins).

* Activities: Complete Figma tutorials, practice creating basic UI elements from scratch.

* Practical: Recreate a simple screen from a popular app using Figma, paying attention to details and component creation.

Module 3: Mobile-Specific Design & Interaction (Weeks 7-9)

  • Week 7: UI Components & Design Systems Thinking

* Focus: Understanding common UI components (buttons, input fields, navigation bars), creating reusable components in Figma, introduction to design systems.

* Activities: Learn about atomic design principles, practice building component libraries.

* Practical: Convert your basic style guide into a small component library in Figma for your app idea.

  • Week 8: Interaction Design & Prototyping

* Focus: Principles of interaction design, micro-interactions, animations, creating interactive prototypes in Figma.

* Activities: Study interaction patterns, learn Figma's prototyping features.

* Practical: Turn your wireframes/mockups into an interactive prototype, demonstrating key user flows.

  • Week 9: Platform Guidelines & Accessibility

* Focus: iOS Human Interface Guidelines (HIG), Android Material Design, accessibility standards (WCAG), designing for diverse users.

* Activities: Review HIG and Material Design documentation, learn about common accessibility considerations in mobile UI.

* Practical: Analyze your prototype against HIG/Material Design principles and accessibility checklist, making necessary adjustments.

Module 4: Advanced Concepts, Portfolio & Handoff (Weeks 10-12)

  • Week 10: Advanced Prototyping & User Testing Basics

* Focus: Advanced prototyping techniques (smart animate, overlays), conducting simple usability tests, gathering feedback.

* Activities: Explore advanced Figma prototyping, learn how to prepare for and conduct a quick usability test.

* Practical: Conduct a small-scale usability test (with friends/family) on your app prototype, gather feedback, and iterate on your design.

  • Week 11: Portfolio Building & Case Study Creation

* Focus: Structuring a design portfolio, writing compelling case studies, showcasing process, visual presentation.

* Activities: Research successful designer portfolios, learn how to articulate your design process and decisions.

* Practical: Start documenting your app design project as a comprehensive case study, including problem, solution, process, iterations, and outcomes.

  • Week 12: Design Handoff, Collaboration & Career Prep

* Focus: Preparing design files for developers, understanding design specs, collaboration tools, interview preparation, networking.

* Activities: Learn about Zeplin/Figma Dev Mode, practice presenting your designs.

* Practical: Prepare your app design project for developer handoff (e.g., annotate components, export assets). Refine your portfolio and practice presenting your case study.


4. Recommended Resources

4.1. Online Courses & Tutorials:

  • Figma Learn: Official Figma tutorials and documentation (free).
  • Coursera/edX: "UI/UX Design Specialization" by Google (Coursera), "Introduction to User Experience Design" by Georgia Tech (Coursera).
  • Udemy/Skillshare: Numerous courses on Figma, UI Design, Mobile UX.
  • DesignCode.io: High-quality courses focused on UI design, often with a mobile emphasis.
  • YouTube: Channels like "Mizko," "Femke," "DesignCourse," "Flux Academy" for tutorials and insights.

4.2. Books:

  • "Don't Make Me Think, Revisited" by Steve Krug (Usability)
  • "The Design of Everyday Things" by Don Norman (Design Principles)
  • "Designing Interfaces" by Jenifer Tidwell (UI Patterns)
  • "Refactoring UI" by Adam Wathan & Steve Schoger (Visual Design)
  • "Atomic Design" by Brad Frost (Design Systems)

4.3. Software Tools:

  • Figma (Primary): Industry-standard for UI design, prototyping, and collaboration (free tier available).
  • Miro / FigJam: For brainstorming, user flows, and whiteboarding.
  • Adobe Suite: Photoshop/Illustrator (for image/icon creation, if needed).
  • Maze / UserTesting: For remote usability testing (explore free trials/basic plans).

4.4. Inspiration & Communities:

  • Dribbble / Behance: Portfolio showcases for visual inspiration.
  • Mobbin / Pttrns: Curated libraries of mobile UI patterns.
  • Medium / UX Collective: Articles and insights from design professionals.
  • LinkedIn / Twitter: Follow prominent UI/UX designers, participate in discussions.
  • Local Meetups / Online Forums: Connect with other designers.

4.5. Design Guidelines:

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

5. Milestones

Achieving these milestones will mark significant progress and build your practical capabilities:

  • End of Week 3: Completion of low-fidelity wireframes and basic user flows for a chosen mobile app concept.
  • End of Week 6: Proficiency in Figma basics, creation of a basic style guide (typography, color palette) for your app concept, and high-fidelity mockups for 3-5 core screens.
  • End of Week 9: Development of an interactive prototype for a key user flow of your app concept, incorporating mobile platform guidelines and basic accessibility considerations.
  • End of Week 12: Completion of at least one comprehensive case study for your mobile app design project, ready for portfolio presentation, and understanding of design handoff procedures.
  • Portfolio Ready: A curated online portfolio showcasing 2-3 strong mobile UI/UX projects (including your main project from this plan).

6. Assessment Strategies

Consistent self-assessment and external feedback are crucial for growth.

  • Project-Based Evaluation: Each week's practical activity serves as a mini-project. Evaluate your output against the learning objectives for that week.
  • Self-Critique: Regularly review your own designs. Ask yourself: Is it intuitive? Is it visually appealing? Does it solve the user's problem? Is it consistent?
  • Peer Feedback: Share your work with fellow learners, online communities, or design mentors for constructive criticism. Websites like Dribbble or LinkedIn can be good places for this.
  • Usability Testing (Informal): Conduct simple usability tests with friends, family, or colleagues on your prototypes to identify pain points and areas for improvement.
  • Portfolio Review: Once your portfolio is ready, seek reviews from experienced UI designers. This is a critical step before applying for roles.
  • Checklist Adherence: Use checklists (e.g., accessibility checklists, platform guideline checklists) to ensure your designs meet industry standards.
  • Time-Boxed Challenges: Periodically give yourself a design challenge with a strict deadline to simulate real-world project constraints and assess your efficiency.

This comprehensive study plan provides a structured pathway to becoming a skilled Mobile App UI Designer. Dedication, consistent practice, and active engagement with the design community will be key to your success. Good luck on your journey!

dart

import 'package:flutter/material.dart';

class BasicScreenTemplate extends StatelessWidget {

const BasicScreenTemplate({super.key});

@override

Widget build(BuildContext context) {

return Scaffold(

appBar: AppBar(

title: const Text('My App Screen'),

backgroundColor: Colors.blueAccent, // AppBar background color

elevation: 4, // Shadow below AppBar

actions: [

IconButton(

icon: const Icon(Icons.settings),

onPressed: () {

print('Settings tapped!');

},

),

],

),

body: const Center( // Main content of the screen

child: Text(

'Welcome to the main content area!',

style: TextStyle(fontSize: 20),

),

),

floatingActionButton: FloatingActionButton( // A button floating over the content

onPressed: () {

print('FAB tapped!');

},

backgroundColor: Colors.green,

child: const Icon(Icons.add),

),

bottomNavigationBar: BottomNavigationBar( // A navigation bar at the bottom

items: const [

BottomNavigationBarItem(

icon: Icon(Icons.home),

label: 'Home',

),

BottomNavigationBarItem(

icon: Icon(Icons.search),

label: 'Search',

),

BottomNavigationBarItem(

icon: Icon(Icons.person),

label: 'Profile',

),

],

currentIndex: 0, // Currently selected item

selectedItemColor: Colors.deepPurple,

onTap: (index) {

print('Tapped item $index');

},

),

drawer: Drawer(

gemini Output

Mobile App UI Design Project Deliverable: Comprehensive Review & Documentation

This document provides a detailed overview and documentation of the Mobile App UI Design project, summarizing the design process, presenting key deliverables, explaining design rationale, and outlining next steps. Our goal was to create an intuitive, engaging, and visually appealing user interface that aligns with your brand identity and enhances the user experience.


1. Project Summary & Objectives

Project Title: [Client/App Name] Mobile App UI Design

Project Goal: To design a modern, user-friendly, and highly functional user interface for the [mention app type, e.g., e-commerce, productivity, social networking] mobile application, targeting [mention target audience, e.g., young professionals, busy parents].

Key Objectives Achieved:

  • Intuitive Navigation: Designed clear and consistent navigation patterns to ensure ease of use.
  • Engaging Visuals: Developed a cohesive visual language, including color palettes, typography, and iconography, to create an appealing aesthetic.
  • User-Centric Experience: Prioritized user needs and behaviors through thoughtful layout and interaction design.
  • Brand Alignment: Ensured the UI design reflects and reinforces your brand's core values and identity.
  • Scalability & Consistency: Established a foundational design system for future growth and consistent implementation.

2. Design Philosophy & Approach

Our design process was rooted in a user-centered design (UCD) methodology, emphasizing iterative development and continuous feedback loops.

  • Empathy & Research: We began by understanding the target users' needs, pain points, and existing mental models through [mention methods, e.g., persona development, competitive analysis].
  • Information Architecture (IA): Structured the app's content logically to ensure users can easily find what they need.
  • Wireframing & Prototyping: Iterated through low-fidelity wireframes to define screen layouts and user flows, progressing to high-fidelity prototypes for interaction testing.
  • Visual Design & Branding: Applied your brand guidelines (or established new ones where necessary) to craft a visually consistent and appealing interface.
  • Usability & Accessibility: Designed with a focus on ease of use for all users, considering accessibility standards (WCAG guidelines) from the outset.

3. Key UI Deliverables & Documentation

Below is a detailed breakdown of the primary deliverables from this UI design phase.

3.1. User Flows & Information Architecture

  • Documented Key User Journeys: Visual representations of critical paths users will take within the app (e.g., Onboarding, Product Search & Purchase, Profile Management, Content Creation).

* Actionable Insight: These flows served as the blueprint for screen design, ensuring logical progression and minimal friction.

  • Comprehensive Site Map/App Map: A hierarchical structure of all app screens and their relationships.

* Actionable Insight: Provides a holistic view of the app's content and navigation, crucial for development and future expansion.

3.2. High-Fidelity UI Screens (Mockups)

We have designed and delivered a comprehensive set of high-fidelity screens, showcasing the final visual design and interactive elements. Each screen was meticulously crafted with attention to detail.

Key Screens Designed (Examples):

  • Onboarding & Sign-up/Login:

* Rationale: Designed for clarity and minimal steps, with clear calls-to-action (CTAs) and options for social login to reduce friction.

* Features: Welcome screens, benefit highlights, account creation, password recovery.

  • Home/Dashboard:

* Rationale: Central hub providing quick access to key features and personalized content based on user preferences.

* Features: Dynamic content feed, quick access shortcuts, personalized recommendations, clear navigation to other sections.

  • [Core Feature Screen, e.g., Product Listing/Discovery]:

* Rationale: Optimized for easy browsing, filtering, and clear presentation of items/content.

* Features: Search bar, filter/sort options, visually rich item cards, infinite scroll, quick view options.

  • [Core Feature Detail Screen, e.g., Product Detail Page/Content View]:

* Rationale: Provides comprehensive information in an easily digestible format, encouraging engagement/conversion.

* Features: High-resolution images/media, detailed descriptions, user reviews, related items, prominent CTA (e.g., "Add to Cart").

  • Profile/Settings:

* Rationale: Intuitive access to personal information, preferences, and app settings.

* Features: Editable profile fields, notification settings, privacy controls, support access, logout.

  • Navigation Elements:

* Rationale: Consistent and easily discoverable navigation (e.g., Bottom Tab Bar, Hamburger Menu, Top Navigation) designed for one-hand interaction.

* Features: Clearly labeled icons, active state indicators, accessible tap targets.

3.3. Design System & Style Guide

A robust design system has been established to ensure consistency, scalability, and efficiency in future development and design iterations.

  • Color Palette:

* Primary Colors: [e.g., #007AFF (Blue), #FF3B30 (Red)] – Main brand colors for prominent elements.

* Secondary Colors: [e.g., #FF9500 (Orange), #34C759 (Green)] – Used for accents, statuses, or specific features.

* Neutral Colors: [e.g., #FFFFFF (White), #F2F2F7 (Light Gray), #000000 (Black)] – For backgrounds, text, and borders, ensuring readability and contrast.

* Actionable Insight: Provides hex codes, RGB values, and usage guidelines for developers and future designers.

  • Typography:

* Font Family: [e.g., San Francisco Pro (iOS) / Roboto (Android)]

* Heading Styles: H1 (e.g., 34pt Bold), H2 (e.g., 28pt Semibold), etc. – Defined for consistent hierarchy.

* Body Text: (e.g., 17pt Regular) – For paragraphs and general content.

* Caption/Small Text: (e.g., 13pt Medium) – For secondary information.

* Actionable Insight: Includes font weights, sizes, line heights, and letter spacing for all text elements.

  • Iconography:

* Icon Set: A curated library of custom or standard icons (e.g., Material Design, SF Symbols) used consistently throughout the app.

* Style: [e.g., Outline, Filled, Duotone] – Ensuring visual harmony.

* Actionable Insight: Provides SVG/PNG assets and usage guidelines (e.g., size, padding).

  • Components Library:

* Buttons: Primary, Secondary, Tertiary, Icon Buttons – Defined states (normal, hover, pressed, disabled).

* Input Fields: Text inputs, dropdowns, checkboxes, radio buttons – Defined states and validation feedback.

* Cards & Modals: Standardized layouts for content display and interactive pop-ups.

* Navigation Elements: Tab bars, navigation bars, side drawers.

* Actionable Insight: A collection of reusable UI elements with documented specifications, accelerating development and maintaining consistency.

3.4. Interactive Prototype

  • Link to Prototype: [Provide actual link to Figma, Adobe XD, Sketch, InVision prototype]

* Actionable Insight: This prototype allows for a hands-on experience of the app's navigation and key interactions, simulating the final product. It's crucial for stakeholder reviews and early user testing.


4. User Experience (UX) Considerations & Rationale

  • Clarity & Simplicity: Every screen and interaction was designed to be straightforward, reducing cognitive load for the user. Unnecessary elements were removed.
  • Consistency: Consistent placement of elements, navigation patterns, and visual styles across the entire app reduces learning curves and builds familiarity.
  • Feedback & Responsiveness: Implemented visual feedback for user actions (e.g., button presses, loading states, success/error messages) to assure users their input is registered.
  • Efficiency: Streamlined common tasks and minimized the number of steps required to complete core actions.
  • Error Prevention & Recovery: Designed input validation and clear error messages to prevent mistakes and guide users if errors occur.

5. Accessibility (A11y) & Inclusivity

Accessibility was a core consideration throughout the design process, aiming to make the app usable by the widest possible audience.

  • Color Contrast: Ensured sufficient contrast ratios between text and background colors (WCAG 2.1 AA standards) for readability.
  • Font Sizes & Readability: Utilized appropriate font sizes and clear typography for optimal readability.
  • Touch Target Sizes: Designed interactive elements (buttons, links) with adequate touch target sizes (minimum 44x44 dp) to accommodate various hand sizes and motor skills.
  • Clear Labeling: Used descriptive labels for interactive elements and form fields.
  • Semantic Structure: (For developers) Designed with a clear hierarchy that supports screen reader interpretation.

6. Future Enhancements & Recommendations

Based on our design process and industry best practices, we recommend considering the following for future iterations:

  • User Testing Phase 2: Conduct in-depth usability testing with a broader range of target users to gather empirical data and refine interactions.
  • Animation & Micro-interactions: Introduce subtle animations and micro-interactions to enhance user feedback, delight, and perceived performance.
  • Personalization Engine: Further develop personalized content recommendations, notifications, and user interfaces based on advanced user behavior analysis.
  • Offline Mode Capabilities: Explore options for core functionalities to be available offline, improving user experience in areas with poor connectivity.
  • Internationalization (i18n): Plan for multi-language support and cultural adaptations if targeting a global audience.
  • Dark Mode Implementation: Design a dedicated dark mode theme to cater to user preferences and reduce eye strain in low-light environments.

7. Next Steps & Collaboration

We are confident that the delivered UI design provides a robust and engaging foundation for your mobile application.

  • Review & Feedback: Please review this documentation and the interactive prototype thoroughly. We welcome your feedback and are available for a detailed walkthrough session to address any questions or discuss potential revisions.
  • Hand-off to Development: Upon final approval, we will prepare and deliver all necessary assets (e.g., SVG/PNG icons, font files, detailed specifications, component libraries) and documentation to your development team for seamless implementation.
  • Ongoing Support: We are available to provide support during the development phase to ensure the design vision is accurately translated into the live application.

Thank you for entrusting us with your Mobile App UI design. We look forward to seeing your vision come to life!

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

"+slugTitle(pn)+"

Built with PantheraHive BOS

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

"+slugTitle(pn)+"

Built with PantheraHive BOS

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

"+title+"

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

$1

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

$1

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

$1

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

"); h+="

"+hc+"

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