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

Mobile App UI Designer: Code Generation Deliverable

This deliverable provides comprehensive, detailed, and production-ready code for a common mobile application UI component, specifically a Login/Sign Up Screen. This output is generated as part of the "Mobile App UI Designer" workflow, focusing on translating design concepts into functional code.


Understanding the Role: Mobile App UI Designer

A Mobile App UI Designer is responsible for crafting the visual and interactive elements of a mobile application. Their work ensures that the app is not only aesthetically pleasing but also intuitive, user-friendly, and accessible. Key responsibilities include:

For this code generation step, we are bridging the gap between design and development by providing a concrete example of how a designer's vision can be translated into functional, front-end code.


Code Generation: Sample Login/Sign Up Screen (React Native)

This section presents a detailed, production-ready code sample for a flexible Login/Sign Up screen using React Native. React Native is chosen for its cross-platform capabilities, allowing a single codebase to target both iOS and Android, which is a common requirement for modern mobile app development.

Purpose of this Code Sample

This code sample demonstrates a foundational UI component for almost any mobile application: an authentication screen. It showcases:

Technologies Used

Prerequisites

To run this code, you'll need:

  1. Node.js and npm/yarn: Installed on your machine.
  2. Expo CLI (Recommended): npm install -g expo-cli or yarn global add expo-cli.
  3. A React Native project: You can create one using expo init MyAwesomeApp or npx react-native init MyAwesomeApp.
  4. A mobile emulator/simulator or a physical device with the Expo Go app installed.

Code Implementation

Below is the code for a AuthScreen.js component, which can handle both login and sign-up states.

text • 458 chars
    Choose the "blank" template.
2.  **Create `AuthScreen.js`:**
    Inside your project directory, create a new file named `AuthScreen.js` and paste the provided code into it.
3.  **Add a logo (optional):**
    Create an `assets` folder in your project root and place an `app_logo.png` image inside it.
4.  **Update `App.js`:**
    Replace the content of your `App.js` file with the provided `App.js` code snippet.
5.  **Start the development server:**
    
Sandboxed live preview

Mobile App UI Designer: Comprehensive Study Plan

This document outlines a comprehensive, 12-week study plan designed to equip an aspiring Mobile App UI Designer with the fundamental knowledge, practical skills, and professional portfolio necessary to excel in the field. This plan integrates theoretical learning with hands-on application, culminating in a job-ready skillset.


1. Learning Objectives

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

  • Understand Core UI/UX Principles: Articulate and apply fundamental user interface (UI) and user experience (UX) design principles, including user-centered design, design thinking, accessibility, and visual hierarchy.
  • Master Mobile Design Guidelines: Demonstrate a deep understanding and practical application of platform-specific design guidelines (e.g., Apple Human Interface Guidelines, Google Material Design).
  • Proficiently Use Design Tools: Achieve expert-level proficiency in industry-standard UI design and prototyping tools (e.g., Figma).
  • Conduct User Research & Analysis: Understand basic user research methodologies, synthesize findings, and translate them into actionable design decisions.
  • Design Information Architecture & Flows: Create effective information architecture, user flows, sitemaps, and wireframes for mobile applications.
  • Develop High-Fidelity Prototypes: Design visually appealing and highly interactive mobile UI screens, complete with animations and micro-interactions.
  • Conduct Usability Testing: Plan, execute, and analyze basic usability tests to gather feedback and iterate on designs.
  • Build a Professional Portfolio: Develop a compelling online portfolio showcasing 2-3 detailed case studies of mobile app UI design projects.
  • Communicate & Collaborate: Effectively articulate design decisions, receive constructive feedback, and collaborate within a design team context.

2. Weekly Study Schedule (12 Weeks)

This schedule assumes approximately 15-20 hours of dedicated study and practice per week.

Phase 1: Foundations & Principles (Weeks 1-4)

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

* Topics: What is UI/UX, Design Thinking process (Empathize, Define, Ideate, Prototype, Test), User-Centered Design principles, role of a UI Designer.

* Activities: Read foundational articles, watch introductory courses, analyze existing app interfaces.

  • Week 2: Visual Design Fundamentals & Accessibility

* Topics: Color theory, typography, iconography, layout, visual hierarchy, branding basics, Gestalt principles, WCAG accessibility guidelines for mobile.

* Activities: Practice creating mood boards, typography pairing exercises, analyze accessible vs. inaccessible app designs.

  • Week 3: Mobile Platform Guidelines - iOS (Apple Human Interface Guidelines)

* Topics: Understanding iOS UI patterns, navigation (tab bars, navigation bars), common components (buttons, switches, alerts), gestures, screen sizes.

* Activities: Deep dive into Apple HIG, dissect popular iOS apps, sketch basic iOS screens.

  • Week 4: Mobile Platform Guidelines - Android (Google Material Design)

* Topics: Understanding Material Design principles, components (floating action buttons, bottom sheets), navigation drawer, theming, responsive design.

* Activities: Deep dive into Material Design guidelines, dissect popular Android apps, sketch basic Android screens.

Phase 2: Tools & Core Design Skills (Weeks 5-8)

  • Week 5: Figma Mastery - Basics & Layout

* Topics: Interface overview, frames, shapes, text, images, auto layout, components, styles (colors, fonts).

* Activities: Complete Figma tutorials, recreate simple UI elements, design a basic single-screen app layout using Auto Layout.

  • Week 6: Figma Mastery - Advanced Prototyping & Collaboration

* Topics: Prototyping (flows, interactions, smart animate), variants, design systems principles, collaboration features, plugins.

* Activities: Build a multi-screen interactive prototype, create a small component library, practice sharing and commenting.

  • Week 7: Information Architecture & User Flows

* Topics: User research basics (personas, user stories), sitemaps, user flows, task analysis, card sorting (introduction).

* Activities: Create a persona for a target user, map out a user flow for a common app task, design a basic app sitemap.

  • Week 8: Wireframing & Low-Fidelity Prototyping

* Topics: Purpose of wireframes, sketching techniques, digital wireframing in Figma, iterative design process.

* Activities: Design low-fidelity wireframes for a simple mobile app idea (e.g., a to-do list app), create a clickable wireframe prototype.

Phase 3: High-Fidelity Design & Portfolio (Weeks 9-12)

  • Week 9: UI Design - Visual Language & Components

* Topics: Translating wireframes to high-fidelity, creating a visual style guide (color palette, typography scale, iconography set), designing custom components.

* Activities: Apply visual design principles to wireframes, create a brand style guide for your app project, design a set of core UI components.

  • Week 10: Interaction Design & Micro-interactions

* Topics: Principles of interaction design, animation psychology, designing transitions, states (empty, error, loading), micro-interactions in Figma.

* Activities: Enhance your high-fidelity prototype with engaging transitions and micro-interactions, explore different animation styles.

  • Week 11: Usability Testing & Iteration

* Topics: Planning a usability test, recruiting participants, conducting tests, analyzing results, iterating on designs based on feedback.

* Activities: Plan and conduct a small usability test on your app prototype, document findings, implement design improvements.

  • Week 12: Portfolio Development & Presentation Skills

* Topics: What makes a strong portfolio case study, structuring your projects (problem, process, solution, results), writing compelling narratives, presenting your work.

* Activities: Select 1-2 strong projects, write detailed case studies, design and build your online portfolio (e.g., using Notion, Webflow, or a simple website builder). Prepare to articulate your design process.


3. Recommended Resources

Online Courses & Certifications:

  • Google UX Design Professional Certificate (Coursera): Covers foundational UX principles applicable to UI, strong for beginners.
  • Interaction Design Foundation (IxDF): Comprehensive library of UX/UI courses, good for in-depth learning.
  • Udemy/Skillshare: Specific courses on Figma, Mobile UI Design, Animation, etc. (e.g., "Complete Figma UI/UX Design Course").
  • Designership (YouTube): Excellent free tutorials and insights for Figma and UI design.

Books:

  • "Don't Make Me Think, Revisited" by Steve Krug (UX/Usability)
  • "The Design of Everyday Things" by Don Norman (Design Principles)
  • "About Face: The Essentials of Interaction Design" by Alan Cooper et al. (Interaction Design)
  • "Refactoring UI" by Adam Wathan & Steve Schoger (Practical UI Tips)

Tools:

  • Figma: Primary UI design and prototyping tool (free tier available).
  • Miro/Whimsical: For brainstorming, user flows, sitemaps.
  • Maze/Usability Hub: For remote usability testing.
  • Unsplash/Pexels: For free stock photos.
  • The Noun Project/Font Awesome: For iconography.

Guidelines & Inspiration:

  • 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/](https://m2.material.io/) (Material Design 2) & [m3.material.io/](https://m3.material.io/) (Material Design 3)
  • Dribbble / Behance: For design inspiration and trends.
  • Mobbin: Curated library of mobile app UI patterns.
  • Nielsen Norman Group (NN/g): Research-based articles on usability and UX.
  • Smashing Magazine: Articles on web and mobile design.

4. Milestones

Achieving these milestones will mark significant progress and demonstrate mastery of key skills:

  • End of Week 4: Completed a foundational course on UI/UX principles and demonstrated understanding of both iOS and Android design guidelines through basic sketches or analyses.
  • End of Week 6: Achieved proficiency in Figma, capable of creating complex layouts, components, and basic interactive prototypes.
  • End of Week 8: Successfully designed a complete information architecture, user flow, and a set of low-fidelity wireframes for a simple mobile app.
  • End of Week 10: Developed a high-fidelity, interactive prototype for a mobile app project, incorporating visual design principles and micro-interactions.
  • End of Week 11: Conducted a small usability test on a prototype, analyzed feedback, and iterated on the design.
  • End of Week 12: Launched an online portfolio showcasing at least two detailed mobile app UI design case studies (including problem, process, solution, and outcomes).

5. Assessment Strategies

Continuous assessment is crucial for effective learning and skill development:

  • Project-Based Learning: Each phase culminates in a practical design project (e.g., wireframing an app, designing a high-fidelity prototype). These projects are the primary means of demonstrating skill acquisition.
  • Self-Critique & Reflection: Regularly review your own designs against best practices, guidelines, and learning objectives. Document your design decisions and areas for improvement.
  • Peer Review & Feedback: Participate in design communities (e.g., Discord servers, online forums) to share your work and receive constructive criticism from fellow learners and experienced designers.
  • Mentor Feedback (Optional but Recommended): If possible, seek a mentor who can provide personalized feedback on your projects and career guidance.
  • Usability Testing: The process of planning, conducting, and analyzing usability tests on your own designs serves as a powerful assessment tool for identifying design flaws and validating solutions.
  • Portfolio Reviews: Once your portfolio is built, seek feedback from experienced UI/UX professionals on the clarity of your case studies, the quality of your designs, and your ability to articulate your process.
  • Quizzes & Exercises (from online courses): Utilize built-in assessments within recommended online courses to test theoretical knowledge.

This detailed study plan provides a robust roadmap for anyone aspiring to become a skilled Mobile App UI Designer. Consistent effort and practical application of these strategies will lead to a strong foundation and a compelling portfolio.

  1. Run on a device/emulator:

* Expo Go App: Scan the QR code displayed in your terminal or browser with the Expo Go app on your phone.

* iOS Simulator: Press i in the terminal.

* Android Emulator: Press a in the terminal.

Key UI/UX Principles Demonstrated

  • Clarity and Simplicity: The layout is clean, with a clear hierarchy of information.
  • Consistency: Input fields, buttons, and text styles are consistent throughout the screen.
  • Feedback: alert() is used for basic feedback, which would be replaced by more sophisticated error messages or loading indicators in a real app.
  • Accessibility: KeyboardAvoidingView improves usability by preventing the keyboard from obscuring inputs. placeholderTextColor ensures placeholders are visible.
  • Responsiveness: Using Dimensions and percentage-based widths (width * 0.06, 90%) ensures the UI scales gracefully across different device sizes.
  • Call to Action: Clear primary buttons (Log In, Sign Up) and secondary actions (Forgot Password?, Sign Up/Log In toggle).
  • Visual Hierarchy: The title is prominent, followed by the subtitle, inputs, and actions.
  • Whitespace: Ample spacing between elements improves readability and reduces cognitive load.

Scalability and Best Practices

  • Modular Design: The AuthScreen is a self-contained component, making it easy to reuse or integrate into larger applications.
  • Styling with StyleSheet: Centralizes styles, improves performance, and makes styles easier to maintain.
  • State Management: Basic useState hooks are used. For more complex apps, consider state management libraries like Redux, Zustand, or React Context API.
  • Error Handling: In a production app, robust error handling with user-friendly messages for invalid inputs, network errors, etc., would be crucial.
  • Form Validation: Client-side validation for email format, password strength, etc., should be implemented. Libraries like Formik and Yup can assist with this.
  • Theming: For larger applications, a design system with a theming solution (e.g., React Native Paper, UI Kitten, or custom context-based theming) would be beneficial to manage colors, fonts, and spacing globally.
  • Asset Management: Ensure all assets (like app_logo.png) are properly managed and optimized.

Next Steps for a UI Designer

After reviewing this code, a UI designer could:

  1. Refine Visuals: Provide specific hex codes for colors, font families, and precise spacing values to developers to perfectly match the design system.
  2. Define Interactions: Specify animation details (e.g., button press animations, input focus states, loading spinners).
  3. Error States: Design specific UI for
gemini Output

Mobile App UI Designer: Comprehensive Role Definition & Deliverables

This document provides a comprehensive and detailed professional output defining the role of a Mobile App UI Designer. It outlines core responsibilities, essential skills, tools, typical workflows, and key deliverables, offering a clear understanding of this critical function in mobile application development.


1. Introduction: The Essence of a Mobile App UI Designer

A Mobile App UI (User Interface) Designer is a specialized creative professional focused on crafting the visual and interactive elements of mobile applications. Their primary goal is to ensure that an app is not only aesthetically pleasing but also intuitive, easy to use, and aligned with user expectations and brand identity. This role is pivotal in translating user needs and business goals into a tangible, engaging, and functional mobile experience.


2. Role Overview

The Mobile App UI Designer is responsible for the look, feel, and interactivity of a mobile application. They work to create visually appealing interfaces that provide a seamless and enjoyable user experience (UX). This involves designing screen layouts, visual elements, interactive components, and ensuring consistency across various mobile platforms (iOS, Android) and device types.


3. Key Responsibilities

The core responsibilities of a Mobile App UI Designer include, but are not limited to:

  • Visual Design & Branding Adherence:

* Developing and maintaining consistent visual styles, color palettes, typography, and iconography aligned with brand guidelines.

* Creating engaging and modern visual designs that resonate with the target audience.

  • User Interface Design:

* Designing intuitive and user-friendly interfaces for mobile applications across different screen sizes and resolutions.

* Creating detailed wireframes, mockups, and high-fidelity prototypes to visualize and test design concepts.

* Ensuring logical flow and navigation within the app.

  • Interaction Design:

* Defining and designing interactive elements such as buttons, menus, forms, and transitions.

* Specifying micro-interactions and animations to enhance user engagement and provide feedback.

  • Platform-Specific Design:

* Understanding and applying platform-specific design guidelines (e.g., Apple Human Interface Guidelines for iOS, Material Design for Android) to create native-feeling experiences.

* Designing for both iOS and Android platforms, considering their unique conventions and visual languages.

  • Collaboration & Communication:

* Working closely with UX designers, product managers, developers, and other stakeholders to translate requirements into design solutions.

* Presenting and articulating design concepts, rationale, and prototypes to internal teams and clients.

* Incorporating feedback from user testing and stakeholder reviews into design iterations.

  • Prototyping & Testing:

* Creating interactive prototypes to demonstrate functionality and user flows.

* Participating in user testing sessions to gather insights and validate design decisions.

  • Design System Management:

* Contributing to and utilizing existing design systems to ensure consistency, scalability, and efficiency in design execution.

* Documenting UI components and guidelines for development teams.

  • Staying Current:

* Keeping abreast of the latest mobile UI/UX trends, technologies, and best practices.

* Continuously seeking ways to improve the user experience and visual design of mobile applications.


4. Essential Skills & Competencies

A successful Mobile App UI Designer possesses a blend of creative, technical, and interpersonal skills:

4.1. Technical & Design Skills

  • Visual Design Principles: Strong understanding of layout, typography, color theory, iconography, and visual hierarchy.
  • UI Design Software Proficiency: Expert level in industry-standard tools (e.g., Figma, Sketch, Adobe XD, Photoshop, Illustrator).
  • Prototyping: Ability to create interactive prototypes using tools like Figma, InVision, or ProtoPie.
  • Platform Guidelines: Deep knowledge of iOS Human Interface Guidelines and Android Material Design principles.
  • Responsive Design: Understanding of how designs adapt across different mobile devices and orientations.
  • Accessibility: Knowledge of WCAG guidelines and best practices for creating inclusive designs.
  • Understanding of Development: Basic understanding of front-end mobile development (e.g., Swift/Kotlin, React Native, Flutter) to facilitate effective collaboration with developers.

4.2. Soft Skills

  • Creativity & Innovation: Ability to generate fresh ideas and innovative design solutions.
  • Problem-Solving: Aptitude for identifying user pain points and translating them into elegant design solutions.
  • Attention to Detail: Meticulous approach to crafting pixel-perfect designs and ensuring consistency.
  • Communication: Excellent verbal and written communication skills to articulate design decisions and collaborate effectively.
  • Collaboration & Teamwork: Ability to work effectively within cross-functional teams.
  • Empathy: Deep understanding of user needs, behaviors, and motivations.
  • Adaptability: Flexibility to adapt to changing project requirements and feedback.
  • Time Management: Ability to manage multiple tasks and meet deadlines.

5. Tools & Technologies

The following tools are commonly used by Mobile App UI Designers:

  • Design & Prototyping:

* Figma (most prevalent for collaborative design)

* Sketch (macOS-specific)

* Adobe XD

* InVision (for prototyping and collaboration)

* ProtoPie (for advanced micro-interactions)

  • Graphic Design & Illustration:

* Adobe Photoshop

* Adobe Illustrator

  • Collaboration & Project Management:

* Jira, Asana, Trello

* Slack, Microsoft Teams

  • User Research & Testing:

* UserTesting.com, Maze, Lookback

  • Version Control:

* Abstract (for Sketch), Figma's native version history


6. Typical Project Workflow

A Mobile App UI Designer typically follows a structured workflow:

  1. Discovery & Research (Collaboration with UX):

* Understanding project goals, target audience, and business requirements.

* Analyzing user research, competitor analysis, and existing data.

* Reviewing user stories and functional specifications.

  1. Information Architecture & Wireframing (Collaboration with UX):

* Defining the app's structure and content hierarchy.

* Creating low-fidelity wireframes to outline screen layouts and basic functionality.

  1. UI Design & Visual Language:

* Developing the visual style guide (color palette, typography, iconography, component library).

* Designing high-fidelity mockups for key screens, applying brand guidelines and platform conventions.

* Iterating on visual elements based on feedback.

  1. Interaction Design & Prototyping:

* Defining user flows and screen transitions.

* Designing micro-interactions and animations.

* Creating interactive prototypes to simulate the app experience.

  1. Review & Feedback:

* Presenting designs to stakeholders for review and gathering feedback.

* Incorporating feedback and iterating on designs.

* Participating in user testing sessions to validate design decisions.

  1. Handoff to Development:

* Preparing and organizing design files for developers (e.g., using tools like Zeplin, Figma's Inspect mode).

* Providing clear specifications for spacing, dimensions, assets, and interactions.

* Collaborating with developers during implementation to ensure design fidelity.

  1. Post-Launch & Iteration:

* Monitoring app performance and user feedback.

* Identifying areas for improvement and contributing to future design iterations.


7. Key Deliverables

The primary outputs of a Mobile App UI Designer include:

  • Mood Boards: Visual collages to define the aesthetic direction.
  • Style Guides / Design Systems: Comprehensive documentation of visual elements (colors, typography, iconography, components).
  • High-Fidelity Mockups: Pixel-perfect visual designs of all app screens.
  • Interactive Prototypes: Clickable and navigable simulations of the app's user flow.
  • UI Component Libraries: Reusable UI elements for consistency and efficiency.
  • Design Specifications: Detailed documentation for developers, including spacing, measurements, states, and assets.
  • Micro-interaction Specifications: Descriptions or animations detailing subtle user feedback.
  • Asset Libraries: Exported images, icons, and other graphic assets for development.
  • Design Presentations: Decks used to communicate design rationale and solutions to stakeholders.

8. Impact & Value Proposition

A skilled Mobile App UI Designer brings immense value to a project by:

  • Enhancing User Engagement: Creating visually appealing and intuitive interfaces that delight users and encourage repeat use.
  • Improving Usability: Ensuring the app is easy to learn, efficient to use, and minimizes user frustration.
  • Strengthening Brand Identity: Translating brand values into a consistent and memorable visual experience within the app.
  • Driving Conversion & Retention: A well-designed UI can lead to higher user acquisition, better conversion rates, and increased user retention.
  • Reducing Development Costs: Clear, detailed designs and a well-managed design system reduce ambiguity, errors, and rework during development.
  • Competitive Differentiation: A superior UI can distinguish an app in a crowded market, providing a significant competitive advantage.

9. Conclusion

The Mobile App UI Designer is a crucial role in the creation of successful mobile applications. They are the architects of the visual experience, blending aesthetics with functionality to deliver products that are not only beautiful but also intuitive and effective. Their expertise ensures that every tap, swipe, and interaction within a mobile app contributes to a positive and memorable user journey, ultimately driving user satisfaction and business success.

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