Mobile App UI Designer
Run ID: 69cc1b4504066a6c4a1695ec2026-03-31Design
PantheraHive BOS
BOS Dashboard

Mobile App UI Designer: Core UI Components & Example Screen (Flutter)

This deliverable provides a foundational set of reusable UI components and an example screen implementation using Flutter. The aim is to demonstrate how a Mobile App UI Designer's vision can be translated into clean, well-structured, and production-ready code, focusing on reusability, maintainability, and adherence to modern UI/UX principles.

The code emphasizes:


1. Project Setup & Main Application Structure (main.dart)

This file sets up the main Flutter application, defines the overall theme, and specifies the initial screen.

text • 1,503 chars
**Explanation:**
*   **`main()` function:** The entry point of the Flutter application, running the `MyApp` widget.
*   **`MyApp` widget:** A `StatelessWidget` that configures the entire application.
*   **`MaterialApp`:** The root widget for Material Design applications, providing essential functionalities like navigation, theming, and internationalization.
*   **`ThemeData`:** This is where the global design system is defined.
    *   `primarySwatch`, `primaryColor`, `colorScheme`: Define the app's color palette.
    *   `scaffoldBackgroundColor`: Sets the default background color for `Scaffold` widgets.
    *   `appBarTheme`: Customizes the appearance of `AppBar` widgets throughout the app.
    *   `textTheme`: Defines various text styles, allowing for consistent typography (e.g., `headlineMedium`, `bodyLarge`, `labelLarge`).
    *   `buttonTheme`: Customizes the default button appearance.
    *   `inputDecorationTheme`: Sets global styles for `TextField` borders, labels, and hints.
    *   `cardTheme`: Defines the default appearance for `Card` widgets.
*   **`home: const HomeScreen()`:** Sets `HomeScreen` as the starting point of the application.

---

### 2. Reusable UI Components

These components are designed to be generic and reusable across different parts of the application, ensuring consistency and speeding up development.

#### 2.1. Custom Button (`custom_button.dart`)

A versatile button widget that can be easily styled for primary, secondary, or outline actions.

Sandboxed live preview

This document outlines a comprehensive and actionable 8-week study plan designed to equip you with the essential skills and knowledge required to excel as a Mobile App UI Designer. This plan emphasizes a hands-on, project-based learning approach, integrating theoretical knowledge with practical application.


Mobile App UI Designer: Detailed 8-Week Study Plan

1. Introduction & Core Philosophy

Welcome to your intensive 8-week journey to becoming a proficient Mobile App UI Designer. This plan is meticulously crafted to guide you through the fundamental principles, essential tools, and best practices in user interface design for mobile applications. By the end of this program, you will not only understand the theory but also possess a foundational portfolio showcasing your practical abilities.

Core Philosophy:

  • Learn by Doing: Each week includes practical activities and mini-projects to reinforce theoretical concepts.
  • User-Centered Approach: Design decisions will always be rooted in understanding user needs and behaviors.
  • Iterative Design: Embrace feedback and continuous improvement as core tenets of the design process.
  • Portfolio-Driven: Every major deliverable is a potential addition to your professional portfolio.
  • Tool Proficiency: Gain hands-on experience with industry-standard design tools.

2. Weekly Study Plan

This section details the weekly breakdown of learning objectives, key concepts, recommended activities, and resources.


Week 1: Foundations of UI/UX Design

  • Theme: Understanding the core differences between UI and UX, and the principles of user-centered design.
  • Learning Objectives:

* Differentiate between User Interface (UI) and User Experience (UX) design.

* Understand the importance of a user-centered design (UCD) approach.

* Familiarize yourself with the Design Thinking process.

* Identify and articulate basic usability heuristics.

  • Key Concepts:

* UI vs. UX: Definitions, scope, and interrelation.

* User-Centered Design (UCD) principles.

* Design Thinking Stages: Empathize, Define, Ideate, Prototype, Test.

* Nielsen's 10 Usability Heuristics for User Interface Design.

* Introduction to mobile app ecosystems (iOS Human Interface Guidelines, Android Material Design).

  • Recommended Activities:

* Read articles comparing UI and UX.

* Analyze 3-5 popular mobile apps, identifying elements that contribute to good/bad UI and UX.

* Choose a simple everyday problem and brainstorm how a mobile app could solve it using the Design Thinking framework (no design yet, just conceptualization).

  • Recommended Resources:

* Courses: Google UX Design Professional Certificate (Introduction Modules).

* Articles: Nielsen Norman Group (NN/g) articles on UI/UX fundamentals, Design Thinking.

* Books: "The Design of Everyday Things" by Don Norman (Chapters 1-3).

  • Deliverable/Outcome: A short report (1-2 pages) analyzing UI/UX strengths and weaknesses of chosen mobile apps, and a conceptual outline of a problem-solving app idea.

Week 2: Design Principles & Visual Hierarchy

  • Theme: Mastering fundamental visual design principles for creating aesthetically pleasing and functional interfaces.
  • Learning Objectives:

* Apply core design principles (CRAP: Contrast, Repetition, Alignment, Proximity).

* Understand and utilize color theory effectively in UI design.

* Select and pair typography appropriately for mobile contexts.

* Implement grid systems and establish visual hierarchy.

  • Key Concepts:

* CRAP principles (Contrast, Repetition, Alignment, Proximity).

* Gestalt Principles of Perception (Proximity, Similarity, Closure, Continuity, Figure/Ground).

* Color Theory: Hue, Saturation, Value, color palettes, accessibility considerations.

* Typography: Font families, weights, sizes, line height, readability on mobile.

* Grid Systems, Layouts, and Spacing (whitespace).

* Visual Hierarchy: Guiding the user's eye.

  • Recommended Activities:

* Create 3-5 mood boards for different mobile app styles (e.g., minimalist, vibrant, corporate).

* Practice typography pairing exercises.

* Redesign a simple existing mobile screen (e.g., a login page) applying CRAP principles and a new color palette.

  • Recommended Resources:

* Books: "The Non-Designer's Design Book" by Robin Williams.

* Tools: Coolors.co (color palette generator), Font Pair.

* Guidelines: Review color and typography sections in Material Design and iOS HIG.

  • Deliverable/Outcome: Mood boards, redesigned mobile screen mock-up (static image).

Week 3: User Research & Information Architecture

  • Theme: Gathering user insights and structuring app content logically.
  • Learning Objectives:

* Conduct basic user research methods (e.g., interviews, surveys).

* Create detailed user personas and empathy maps.

* Develop user stories and user flows.

* Design clear and intuitive information architecture (IA) for a mobile app.

  • Key Concepts:

* User Research Methods: Qualitative (interviews, focus groups) vs. Quantitative (surveys, analytics).

* User Personas: Archetypal users with goals, needs, and behaviors.

* Empathy Maps: Understanding user thoughts, feelings, sayings, and doings.

* User Stories: Short, simple descriptions of a feature from an end-user perspective.

* User Flows: Mapping the path a user takes to complete a task.

* Information Architecture (IA): Organization, labeling, navigation, and search systems.

* Card Sorting (introduction).

* Sitemaps.

  • Recommended Activities:

* For your app idea from Week 1, conduct 2-3 informal user interviews.

* Create 1-2 user personas and an empathy map based on your research.

* Develop 3-5 user stories and a basic user flow for a core feature of your app idea.

* Create a sitemap for your app.

  • Recommended Resources:

* Books: "About Face: The Essentials of Interaction Design" by Alan Cooper (Chapters on Research, Personas).

* Articles: NN/g articles on User Personas, User Flows, Information Architecture.

* Tools: Miro or FigJam for collaborative whiteboarding.

  • Deliverable/Outcome: User personas, empathy map, user stories, user flow diagram, and sitemap for your chosen app idea.

Week 4: Wireframing & Prototyping Tools

  • Theme: Translating ideas into tangible, interactive designs using industry-standard tools.
  • Learning Objectives:

* Master the basics of a chosen UI design tool (Figma recommended).

* Create low-fidelity wireframes to establish layout and functionality.

* Develop interactive prototypes to simulate user experience.

* Understand the difference between low-fidelity and high-fidelity designs.

  • Key Concepts:

* Introduction to Figma (or Sketch/Adobe XD): Interface, frames, layers, components, plugins.

* Wireframing: Low-fidelity, mid-fidelity, high-fidelity.

* Prototyping: Linking screens, interactive elements, transitions.

* Design Collaboration features.

* Feedback and iteration loops.

  • Recommended Activities:

* Complete a basic tutorial for your chosen design tool (e.g., Figma for beginners).

* Wireframe 5-7 key screens of your app idea (low-fidelity initially).

* Turn your wireframes into a basic interactive prototype, demonstrating the core user flow.

  • Recommended Resources:

* Tools: Figma (free tier available), Sketch (Mac only), Adobe XD.

* Courses: Official Figma tutorials, YouTube tutorials (e.g., "Figma for UI Design").

* Articles: "Wireframing vs. Prototyping" by CareerFoundry.

  • Deliverable/Outcome: A clickable low-fidelity prototype of your app idea in Figma (or chosen tool).

Week 5: Interaction Design & Animation

  • Theme: Designing engaging and intuitive interactions, and incorporating meaningful animations.
  • Learning Objectives:

* Understand principles of interaction design (affordances, feedback, signifiers).

* Design common mobile UI patterns (navigation, forms, lists).

* Incorporate micro-interactions to enhance user experience.

* Apply basic animation principles to create subtle and effective transitions.

  • Key Concepts:

* Interaction Design Principles: Affordances, Signifiers, Feedback, Mapping.

* Common Mobile UI Patterns: Navigation (tabs, drawers), forms, search, lists, cards, modals.

* Micro-interactions: Triggers, rules, feedback, loops.

* Animation Principles in UI: Timing, easing, consistency, purpose.

* Gestures and touch interactions.

  • Recommended Activities:

* Identify and analyze micro-interactions in your favorite mobile apps.

* Design a specific micro-interaction for your app idea (e.g., a button click, a favorite animation).

* Refine 2-3 screens of your prototype, focusing on interaction design and adding subtle animations/transitions.

  • Recommended Resources:

* Books: "Don't Make Me Think, Revisited" by Steve Krug (Chapters on Navigation, Forms).

* Articles/Blogs: UX Collective, Smashing Magazine articles on micro-interactions and UI animation.

* Examples: LottieFiles, Mobbin.design (for mobile UI patterns).

  • Deliverable/Outcome: Enhanced interactive prototype with improved interaction design and at least one custom micro-interaction/animation.

Week 6: Design Systems & Components

  • Theme: Building scalable and consistent UI with design systems and reusable components.
  • Learning Objectives:

* Understand the benefits and structure of a design system.

* Create reusable UI components (e.g., buttons, input fields, cards).

* Develop a basic style guide for a mobile app.

* Apply atomic design principles to organize UI elements.

  • Key Concepts:

* What is a Design System? (Components, patterns, guidelines, documentation).

* Atomic Design Methodology (Atoms, Molecules, Organisms, Templates, Pages).

* Component Libraries in Figma (Master Components, Variants, Instances).

* Style Guides: Color palettes, typography scales, iconography, spacing rules.

* Consistency and scalability in design.

  • Recommended Activities:

* Review existing popular design systems (e.g., Material Design, Apple HIG).

* For your app idea, create a small component library in Figma including:

* Color styles

* Text styles

* At least 3 button variants

* An input field component

* A card component

* Start applying these components to your prototype screens.

  • Recommended Resources:

* Books: "Atomic Design" by Brad Frost.

* Guidelines: Material Design Guidelines, Apple Human Interface Guidelines.

* Articles: "What is a Design System?" by InVision.

* Tools: Figma's component features.

  • Deliverable/Outcome: A basic Figma design system for your app, including documented color/text styles and a small library of reusable components.

Week 7: Accessibility & Usability Testing

  • Theme: Designing for inclusivity and evaluating the user experience through testing.
  • Learning Objectives:

*

dart

// lib/screens/home_screen.dart

import 'package:flutter/material.dart';

import 'package:mobile_app_ui_designer/widgets/custom_button.dart';

import 'package:mobile_app_ui_designer/widgets/custom_text

gemini Output

This document outlines the comprehensive services and deliverables provided by a professional Mobile App UI Designer, detailing the scope, process, and expected outcomes to ensure a successful user interface design for your mobile application.


Mobile App UI Designer: Comprehensive Service Overview

Our Mobile App UI Designer service focuses on creating visually stunning, intuitive, and highly functional user interfaces that drive user engagement and achieve your business objectives. We blend aesthetic design with robust user experience principles to deliver a mobile application that stands out in the market.


1. Project Overview & Objective

The primary objective of our Mobile App UI Designer service is to transform your application's vision into a polished, user-friendly, and engaging visual experience. We are dedicated to designing interfaces that are not only beautiful but also intuitive, accessible, and aligned with your brand identity, ensuring a seamless journey for your users.


2. Key Deliverables

Our comprehensive UI design process culminates in a suite of essential deliverables designed to guide development and ensure a high-quality final product:

  • High-Fidelity UI Mockups: Detailed visual designs for all key screens and states of your mobile application, showcasing the final look and feel, including typography, color palettes, imagery, and iconography.
  • Interactive Prototypes: Clickable and scrollable simulations of the app's interface, allowing for realistic user testing and stakeholder feedback before development begins.
  • Comprehensive Design System/Style Guide: A centralized library of reusable UI components (buttons, input fields, navigation elements), typography scales, color palettes, and spacing rules. This ensures design consistency, accelerates development, and simplifies future updates.
  • Iconography & Illustration Sets: Custom-designed icons and illustrations that enhance usability, reinforce branding, and add visual appeal to your application.
  • UI Specification Documentation: Detailed notes and annotations for developers, explaining interactions, animations, responsive behaviors, and specific design requirements for each component and screen.
  • Asset Handoff: Organized export of all necessary graphic assets (e.g., images, SVG icons) in formats optimized for mobile development platforms (iOS, Android).
  • Accessibility Guidelines: Recommendations and implementation details to ensure the UI is usable by individuals with diverse abilities, adhering to WCAG standards where applicable.

3. Our Mobile App UI Design Process

Our structured approach ensures a thorough and collaborative design journey, from initial concept to final design specifications:

  1. Discovery & Research:

* Understanding Business Goals: Deep dive into your app's purpose, target audience, and key performance indicators.

* User Research Synthesis: Leveraging existing user research (personas, user stories) to inform design decisions.

* Competitor Analysis: Evaluating industry benchmarks and identifying opportunities for differentiation.

* Brand Identity Integration: Ensuring the UI aligns seamlessly with your existing brand guidelines and aesthetic.

  1. Information Architecture (IA) & User Flows (Collaboration with UX):

* Content Structuring: Organizing app content logically for easy navigation.

* User Journey Mapping: Defining the steps users will take to achieve specific goals within the app.

  1. Wireframing (Low to High-Fidelity):

* Structural Layouts: Creating skeletal frameworks of app screens, focusing on content placement, functionality, and interaction areas without visual styling.

* Iterative Refinement: Collaborating with stakeholders to refine layouts based on feedback.

  1. UI Design & Visual Language Development:

* Visual Exploration: Developing mood boards, color palettes, and typography selections.

* Component Design: Crafting individual UI elements (buttons, forms, cards, navigation) that are consistent and scalable.

* High-Fidelity Mockups: Applying the visual language to the wireframes, creating pixel-perfect designs for all critical screens.

  1. Prototyping & User Testing (Optional but Recommended):

* Interactive Prototypes: Building functional prototypes from high-fidelity mockups to simulate the user experience.

* Usability Testing: Facilitating sessions with target users to gather feedback on intuitiveness, ease of use, and overall experience.

* Iteration: Refining designs based on testing insights to optimize the user interface.

  1. Design System & Handoff:

* Design System Creation: Documenting all UI components, styles, and guidelines for developer implementation.

* Developer Handoff: Providing all necessary assets, specifications, and documentation in an organized manner, often using tools like Zeplin or Figma's developer mode, to ensure a smooth transition to development.

* Post-Handoff Support: Addressing developer queries and providing clarifications during the implementation phase.


4. Core Responsibilities of the Mobile App UI Designer

Our Mobile App UI Designer will be responsible for:

  • Visual Design Excellence: Creating aesthetically pleasing and modern interfaces that resonate with the target audience.
  • Interaction Design: Defining how users interact with the app, including animations, transitions, and micro-interactions.
  • Brand Consistency: Ensuring the app's visual identity aligns with the overall brand guidelines and enhances brand perception.
  • Usability & Accessibility: Designing interfaces that are easy to use, intuitive, and accessible to a broad range of users.
  • Prototyping & Iteration: Developing interactive prototypes and iterating on designs based on feedback and usability testing.
  • Collaboration: Working closely with UX designers, product managers, and developers to ensure a cohesive product vision and seamless implementation.
  • Staying Current: Keeping abreast of the latest mobile UI trends, design tools, and platform-specific guidelines (iOS Human Interface Guidelines, Android Material Design).

5. Tools & Technologies

Our designers are proficient in industry-leading tools to deliver high-quality designs efficiently:

  • Design & Prototyping: Figma (preferred), Sketch, Adobe XD
  • Asset Management & Handoff: Figma (Developer Mode), Zeplin
  • Collaboration: Miro, Slack, Asana, Jira
  • Graphic Design: Adobe Photoshop, Adobe Illustrator (for custom assets)

6. Engagement Model & Next Steps

We offer flexible engagement models tailored to your project's scope and duration, from project-based contracts to dedicated design support.

To initiate your Mobile App UI Design project:

  1. Initial Consultation: Schedule a free consultation to discuss your project vision, requirements, and objectives.
  2. Scope Definition: We will work with you to define the project scope, deliverables, and timeline.
  3. Proposal & Agreement: Receive a detailed proposal outlining the project plan, cost, and terms.
  4. Project Kick-off: Upon agreement, we will officially kick off the project and begin the design process.

We look forward to partnering with you to create an exceptional mobile application user interface.

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