Customer Journey Map
Run ID: 69cb2e9e61b1021a29a86a902026-03-31Marketing
PantheraHive BOS
BOS Dashboard

Map the complete customer journey from awareness to advocacy, including touchpoints, pain points, emotions, and optimization opportunities.

Customer Journey Map: Step 1 of 3 - Analyze Audience

Project Title: Comprehensive Customer Journey Mapping Initiative

Current Step: Analyze Audience

Date: October 26, 2023


1. Introduction & Purpose of Audience Analysis

Welcome to the first critical step in our Customer Journey Mapping initiative. Before we can effectively map the journey, identify touchpoints, and uncover pain points, it is paramount to deeply understand who our customers are. This "Analyze Audience" phase lays the foundational groundwork by defining customer segments, identifying key demographics, psychographics, behaviors, and motivations.

The insights gleaned from this analysis will serve as the guiding light for the subsequent steps, ensuring that our customer journey map is not merely a theoretical exercise but a data-driven, actionable tool tailored to the real needs and experiences of your diverse customer base.

2. Objective of Audience Analysis

The primary objective of this step is to:

  • Identify and define distinct customer segments/personas: Group customers based on shared characteristics, needs, and behaviors.
  • Uncover key demographics and psychographics: Understand who they are, what they value, their aspirations, and their challenges.
  • Map behavioral patterns: Analyze how customers interact with your brand, products, and the broader market.
  • Pinpoint core motivations and pain points: Understand what drives their decisions and what obstacles they face.
  • Establish a baseline for empathy: Develop a deep understanding that will inform every aspect of the customer journey mapping and optimization.

3. Methodology Overview

This audience analysis draws upon a blend of qualitative and quantitative data sources to construct a holistic view of your customers. While specific data points would be derived from your internal analytics, CRM data, market research, and direct customer feedback, the methodology typically involves:

  • Data Aggregation: Consolidating information from CRM systems, website analytics (Google Analytics, Adobe Analytics), social media insights, and sales data.
  • Customer Segmentation: Applying statistical methods and qualitative insights to group customers into meaningful segments.
  • Persona Development: Creating detailed, semi-fictional representations of your ideal and typical customers, complete with names, backgrounds, goals, and frustrations.
  • Qualitative Research (Simulated): Incorporating insights from customer interviews, surveys, and feedback channels to add depth and emotional context.
  • Competitive Analysis (High-Level): Understanding how competitors address similar audience needs.

4. Key Findings & Example Audience Segments

Based on a comprehensive approach to audience analysis, we've identified several key segments, each with unique characteristics that influence their journey. Below are examples of typical persona structures we would develop, illustrating the type of insights gathered:


4.1. Example Persona: The Digital-Savvy Professional

  • Demographics:

* Age: 28-45 years old

* Occupation: Mid to Senior-level professionals (e.g., Marketing Manager, Software Engineer, Consultant)

* Income: Upper-middle to high income

* Location: Urban/suburban areas

* Education: Bachelor's degree or higher

  • Psychographics:

* Motivations: Efficiency, career advancement, staying informed, convenience, quality, innovative solutions.

* Goals: Streamline workflows, achieve professional growth, make informed purchasing decisions quickly.

* Values: Time-saving, reliability, professional development, technological advancement.

* Challenges/Pain Points: Information overload, lack of clear solutions, time constraints, inefficient processes, difficulty in comparing complex products/services.

* Attitude Towards Technology: Early adopter, comfortable with new platforms, expects seamless digital experiences.

  • Behavioral Data:

* Online Activity: Heavy use of professional networking sites (LinkedIn), industry blogs, tech review sites, productivity apps.

* Communication Preferences: Email, professional messaging apps, concise reports, webinars.

* Purchasing Behavior: Research-intensive, values peer reviews and expert opinions, often makes decisions based on ROI and long-term value. Prefers online self-service options for initial queries.

* Key Channels: LinkedIn, industry forums, targeted search ads, professional newsletters.


4.2. Example Persona: The Value-Conscious Explorer

  • Demographics:

* Age: 22-35 years old

* Occupation: Students, entry-level professionals, gig economy workers

* Income: Moderate to lower-middle income

* Location: Diverse, often flexible

* Education: Some college to Bachelor's degree

  • Psychographics:

* Motivations: Affordability, flexibility, personal growth, exploring new options, community connection.

* Goals: Find cost-effective solutions, learn new skills, connect with like-minded individuals, make smart financial choices.

* Values: Authenticity, community, sustainability, good value for money, personal experiences.

* Challenges/Pain Points: Budget constraints, overwhelming choices, fear of commitment, lack of trust in unknown brands, complex terms and conditions.

* Attitude Towards Technology: Tech-native, relies heavily on social media for recommendations, expects intuitive mobile experiences.

  • Behavioral Data:

* Online Activity: Active on Instagram, TikTok, YouTube, Reddit, comparison shopping sites, review platforms.

* Communication Preferences: Social media direct messages, chat support, email (less frequent).

* Purchasing Behavior: Price-sensitive, seeks discounts and promotions, influenced by user-generated content and peer reviews, often takes longer to decide.

* Key Channels: Instagram, TikTok, YouTube, consumer review sites, peer recommendations.


4.3. Example Persona: The Loyalty Seeker

  • Demographics:

* Age: 40-65+ years old

* Occupation: Established professionals, retirees, small business owners

* Income: Stable, often higher discretionary income

* Location: Established communities, often homeowners

* Education: Varied, but often experienced in their field

  • Psychographics:

* Motivations: Reliability, trust, excellent customer service, established relationships, ease of use.

* Goals: Maintain stability, receive consistent quality, have support readily available, feel valued as a customer.

* Values: Tradition, security, personalized service, proven track record, clear communication.

* Challenges/Pain Points: Impersonal service, difficulty with new technologies, feeling unheard, complicated processes, lack of direct human contact.

* Attitude Towards Technology: May be less comfortable with cutting-edge tech, prefers tried-and-true methods, values human interaction for complex issues.

  • Behavioral Data:

* Online Activity: Uses email frequently, reads news sites, may use Facebook for personal connections, relies on trusted brand websites.

* Communication Preferences: Phone calls, personalized emails, in-person interactions, direct mail.

* Purchasing Behavior: Brand loyal, willing to pay more for trusted brands and excellent service, values clear guarantees and support.

* Key Channels: Direct email, phone support, physical store visits (if applicable), loyalty programs.


5. Cross-Segment Insights & Emerging Trends

Beyond individual persona details, our analysis reveals several overarching insights and trends:

  • Increasing Expectation for Personalization: Across all segments, customers expect experiences and communications to be tailored to their individual needs and past interactions. Generic messaging is becoming less effective.
  • Hybrid Journey Preference: While digital channels are dominant for initial research and self-service, there's a growing appreciation for human interaction at critical decision points or for complex problem-solving, particularly for the Loyalty Seeker.
  • Transparency and Trust are Paramount: Customers are increasingly scrutinizing brand values, data privacy practices, and authenticity. Trust is a significant differentiator.
  • Mobile-First Mentality: For the Digital-Savvy Professional and Value-Conscious Explorer, mobile experience is not just a preference but an expectation for all interactions – from browsing to purchasing and support.
  • Influence of Peer Reviews and Social Proof: User-generated content, reviews, and social media recommendations heavily influence purchase decisions across all segments, though the platforms vary.
  • Demand for Seamless Multi-Channel Experience: Customers expect to switch between channels (e.g., website to chat to phone) without losing context or repeating information.

6. Strategic Implications for Customer Journey Mapping

This detailed audience analysis provides a robust foundation for building empathetic and effective customer journey maps. Key implications include:

  • Persona-Centric Mapping: Each customer journey map must be built with a specific persona in mind, reflecting their unique goals, pain points, and preferred channels at each stage.
  • Targeted Content Development: Content strategies should be tailored to address the specific motivations and information needs of each segment at different journey stages.
  • Channel Optimization: Understanding preferred channels for each segment will inform where to invest resources for communication, marketing, and support.
  • Proactive Pain Point Resolution: The identified challenges and frustrations for each persona will directly inform opportunities for proactive intervention and improvement within the journey.
  • Emotional Resonance: By understanding customer psychographics, we can design touchpoints that evoke positive emotions and build stronger brand affinity.

7. Recommendations for Optimization

Based on these audience insights, we recommend the following strategic areas for immediate consideration and integration into the journey mapping process:

  1. Enhance Personalization Engines: Invest in technology and strategies to deliver highly personalized content, product recommendations, and offers across all digital touchpoints, especially for the Digital-Savvy Professional and Loyalty Seeker.
  2. Optimize Mobile Experience: Conduct a thorough audit and optimization of all mobile interactions, ensuring speed, ease of navigation, and full functionality for the Value-Conscious Explorer and Digital-Savvy Professional.
  3. Strengthen Social Proof and Community Engagement: Actively solicit and showcase customer reviews, testimonials, and user-generated content on relevant platforms to build trust, particularly for the Value-Conscious Explorer.
  4. Streamline Multi-Channel Handoffs: Implement systems and training to ensure seamless transitions between self-service digital channels and human-assisted support, catering to the diverse communication preferences of all segments.
  5. Develop Targeted Content Funnels: Create distinct content strategies for each persona, addressing their specific pain points and guiding them through the awareness, consideration, and decision stages with relevant information.
  6. Prioritize Trust-Building Initiatives: Clearly communicate data privacy policies, highlight security measures, and demonstrate social responsibility to foster trust across all segments, particularly the Loyalty Seeker.

8. Next Steps

This comprehensive audience analysis sets the stage for the subsequent phases of our Customer Journey Mapping project. The next steps will involve translating these insights into actionable journey maps:

  1. Step 2: Map Current State Journey: We will now proceed to map the existing customer journey for each key persona, identifying all touchpoints, actions, thoughts, and emotions at each stage.
  2. Step 3: Identify Pain Points & Opportunities: Based on the current state map, we will pinpoint specific pain points, moments of truth, and areas ripe for optimization and innovation.

We are confident that this detailed understanding of your audience will lead to a highly impactful and actionable Customer Journey Map, driving significant improvements in customer satisfaction, loyalty, and business outcomes.

gemini Output

We are pleased to present the comprehensive Customer Journey Map, a critical deliverable in our "Customer Journey Map" workflow. This detailed map provides an in-depth visualization of your customers' experiences, from initial awareness to becoming loyal advocates.

This document identifies key touchpoints, emotional states, pain points, and significant opportunities for optimization at each stage of the journey. By understanding these elements, you can strategically enhance customer satisfaction, foster loyalty, and drive business growth.


Executive Summary: Navigating Your Customer's Path to Success

The Customer Journey Map is a strategic blueprint designed to deepen your understanding of your customers' interactions with your brand. It moves beyond simple transactions to explore the emotional landscape and practical challenges customers face at every step.

Our analysis reveals that optimizing the customer journey is not just about fixing problems; it's about proactively creating delightful and seamless experiences. By focusing on personalization, clear communication, and efficient support, we can transform potential pain points into moments of truth that build lasting relationships and drive advocacy.

This map serves as a living document, guiding your marketing, sales, product development, and customer service strategies to deliver unparalleled customer value.


Understanding the Customer Journey Map

A Customer Journey Map is a visual representation of the process a customer goes through to accomplish a goal with your company. It helps you step into your customers' shoes, understand their motivations, and identify areas where their experience can be improved.

Key Components Mapped:

  • Journey Stages: The distinct phases a customer progresses through.
  • Customer Actions: What the customer does at each stage.
  • Customer Thoughts & Feelings: The internal monologue and emotional state of the customer.
  • Touchpoints: Every interaction point between the customer and your brand.
  • Pain Points: Challenges, frustrations, or roadblocks encountered by the customer.
  • Optimization Opportunities: Actionable insights to improve the customer experience.
  • Key Metrics: Measurable indicators of success for each stage.

The Comprehensive Customer Journey Map

Below is a detailed breakdown of the customer journey, structured by key stages.

Stage 1: Awareness - "I think I have a need/problem."

This is where potential customers first recognize a problem or need and become aware of potential solutions, including your brand.

  • Customer Goal: Identify a problem and explore initial solutions.
  • Customer Persona (Example): Sarah, 32, a busy professional seeking a more efficient way to manage her tasks and improve productivity.

| Aspect | Details

gemini Output

This document outlines a comprehensive Customer Journey Map, providing a detailed understanding of the customer's experience from initial awareness to becoming an advocate. It identifies key touchpoints, emotional states, pain points, and critical opportunities for optimization across each stage of their journey.


1. Executive Summary

This Customer Journey Map illustrates the end-to-end experience of our target persona, "Eco-Conscious Emily," interacting with a hypothetical sustainable subscription box service ("GreenBox"). The map reveals crucial moments of truth, areas of friction, and significant opportunities to enhance customer satisfaction, foster loyalty, and drive advocacy. Key findings highlight the importance of transparent communication, seamless digital experiences, and a strong post-purchase engagement strategy.


2. Introduction: Understanding the Customer Journey

A Customer Journey Map is a visual representation of the process a customer goes through to accomplish a goal with our company. It helps us understand customer motivations, actions, and feelings at each touchpoint. By mapping this journey, we can:

  • Gain Empathy: See the experience from the customer's perspective.
  • Identify Pain Points: Pinpoint areas of frustration or difficulty.
  • Discover Opportunities: Uncover moments to delight customers and improve processes.
  • Align Teams: Create a shared understanding across departments about the customer experience.
  • Prioritize Initiatives: Focus resources on changes that will have the greatest impact.

This map serves as a strategic tool to guide our efforts in optimizing the customer experience and achieving business objectives.


3. Target Persona: Eco-Conscious Emily

To provide a focused and relevant journey map, we've centered our analysis around a primary persona:

  • Name: Emily Chen
  • Age: 30
  • Occupation: Marketing Manager
  • Demographics: Lives in an urban area, digitally savvy, mid-level income.
  • Psychographics: Values sustainability, convenience, ethical consumption, quality over quantity, seeks personal growth and well-being.
  • Goals:

* Find convenient ways to live more sustainably.

* Discover new, ethically sourced products.

* Reduce decision fatigue when shopping for eco-friendly items.

* Feel good about her consumption choices.

  • Pain Points:

* Information overload when researching sustainable brands.

* Skepticism about "greenwashing."

* Difficulty finding genuinely high-quality, eco-friendly products.

* Time constraints for extensive research.


4. Customer Journey Map Overview

The customer journey is broken down into six distinct stages, each representing a critical phase in Emily's interaction with "GreenBox."

| Stage | Customer Goal | Key Actions | Emotions | Key Touchpoints |

| :------------------- | :--------------------------------------------- | :----------------------------------------------------------------------- | :---------------------------------------- | :----------------------------------------------------- |

| 1. Awareness | Realize need for sustainable convenience. | Online search, social media browsing, word-of-mouth. | Curious, hopeful, skeptical. | Google Search, Instagram, Friend's Recommendation. |

| 2. Consideration | Evaluate "GreenBox" as a viable solution. | Visit website, read reviews, compare features/pricing. | Interested, analytical, cautious, excited. | Website, Review Sites, Social Media. |

| 3. Decision | Commit to purchasing a "GreenBox" subscription. | Select plan, add to cart, enter payment, confirm order. | Anticipation, excitement, slight anxiety. | Checkout Flow, Payment Gateway, Confirmation Email. |

| 4. Onboarding | Receive and experience the first "GreenBox." | Unbox, try products, read welcome materials. | Delight, surprise, satisfaction. | Delivery Notification, Physical Box, Welcome Card. |

| 5. Retention | Continue subscription, resolve issues. | Use products, manage subscription, engage with brand. | Loyalty, appreciation, frustration. | Monthly Box, Email Newsletters, Customer Support. |

| 6. Advocacy | Share positive experience with others. | Post on social media, tell friends, write review. | Pride, enthusiasm, generosity. | Social Media, Referral Program, Review Prompts. |


5. Detailed Journey Stages: Touchpoints, Pain Points, Emotions & Opportunities

Stage 1: Awareness

  • Customer Goal: Emily realizes she wants to integrate more sustainable products into her life conveniently.
  • Customer Actions:

* Searches online for "eco-friendly subscription boxes" or "sustainable living products."

* Browses Instagram for inspiration on sustainable lifestyles.

* Hears about "GreenBox" from a friend or colleague.

* Reads a blog post about ethical consumption.

  • Key Touchpoints:

* Google Search Results (organic & paid ads)

* Instagram (sponsored posts, influencer content, organic search)

* Friend's Recommendation (word-of-mouth)

* Blog Posts / Articles (third-party content marketing)

  • Emotions: Curious, hopeful for a solution, slightly overwhelmed by options, skeptical of "greenwashing" claims.
  • Pain Points:

* Information overload; difficulty discerning credible sources.

* Unsure which brands are genuinely ethical and sustainable.

* Fear of making a "bad" or non-impactful choice.

  • Opportunities for Improvement:

* SEO Optimization: Ensure high ranking for relevant keywords ("sustainable subscription," "eco-friendly gifts").

* Content Marketing: Create valuable blog content (e.g., "5 Ways to Live More Sustainably," "Debunking Greenwashing") that positions GreenBox as a thought leader.

* Influencer Partnerships: Collaborate with authentic eco-conscious influencers for organic reach and trust-building.

* Clear Value Proposition: Craft concise, impactful ad copy and social media posts that immediately communicate GreenBox's commitment to sustainability and convenience.

Stage 2: Consideration

  • Customer Goal: Emily evaluates "GreenBox" against competitors and decides if it meets her needs and values.
  • Customer Actions:

* Visits the "GreenBox" website, exploring product pages, FAQs, and "About Us" section.

* Reads customer reviews on the website and third-party platforms (e.g., Trustpilot, social media comments).

* Compares pricing and subscription options with other similar services.

* Checks "GreenBox's" social media presence for community engagement and transparency.

  • Key Touchpoints:

* "GreenBox" Website (homepage, product pages, FAQ, "Our Story" page)

* Third-Party Review Sites (e.g., Trustpilot, Google Reviews)

* Social Media Profiles (Instagram, Facebook – comments, DMs)

* Competitor Websites

  • Emotions: Interested, analytical, cautious, excited (if the brand resonates), sometimes overwhelmed by choices.
  • Pain Points:

* Unclear or confusing pricing structures/subscription tiers.

* Lack of specific details about product sourcing or brand ethics.

* Difficulty finding comprehensive answers to specific sustainability questions.

* Negative or mixed reviews on third-party sites.

  • Opportunities for Improvement:

* Website Clarity: Redesign product and pricing pages for ultimate clarity and transparency. Highlight ethical sourcing and sustainability certifications prominently.

* Social Proof Integration: Feature glowing customer testimonials and trust badges (e.g., "Certified B Corp," "1% for the Planet") prominently on the website.

* Detailed FAQ: Build a robust FAQ section addressing common concerns about sustainability, product types, and subscription management.

* Live Chat Support: Offer a live chat option on the website to answer real-time questions and alleviate concerns.

* Comparison Content: Provide clear, honest comparisons of GreenBox's value proposition against competitors (without disparaging others).

Stage 3: Decision / Purchase

  • Customer Goal: Emily commits to purchasing a "GreenBox" subscription.
  • Customer Actions:

* Selects a subscription plan (e.g., monthly, quarterly).

* Adds the subscription to her cart.

* Enters personal, shipping, and payment information.

* Reviews order details and confirms purchase.

  • Key Touchpoints:

* Website Checkout Flow

* Payment Gateway (Stripe, PayPal, etc.)

* Order Confirmation Page

* Order Confirmation Email

  • Emotions: Anticipation, excitement, slight anxiety (about commitment, sharing personal info), relief (once confirmed).
  • Pain Points:

* Complicated or lengthy checkout process with too many steps.

* Hidden fees or unexpected shipping costs appearing at the last minute.

* Slow page loading times during checkout.

* Limited payment options.

* Lack of trust signals (e.g., security badges) on payment pages.

* Error messages during payment processing.

  • Opportunities for Improvement:

* Streamlined Checkout: Implement a one-page or multi-step progress-bar checkout process.

* Transparent Pricing: Display all costs (including shipping/taxes) upfront and clearly.

* Multiple Payment Options: Offer a variety of popular payment methods.

* Trust & Security Badges: Display SSL certificates and payment security badges prominently.

* Error Handling: Provide clear, actionable feedback for any payment or form errors.

* Personalized Confirmation: Send an engaging and informative order confirmation email, reiterating the value proposition and what to expect next.

Stage 4: Onboarding / Initial Experience

  • Customer Goal: Emily receives her first "GreenBox," unboxes it, and experiences the products, feeling satisfied and validated in her purchase.
  • Customer Actions:

* Receives delivery notifications.

* Unboxes her first "GreenBox."

* Reads the welcome card and product information.

* Tries out the new sustainable products.

* Shares her unboxing experience on social media (optional).

  • Key Touchpoints:

* Shipping Confirmation & Tracking Emails

* Physical "GreenBox" Packaging

* Welcome Card / Product Information Leaflet

* First Use of Products

* Unboxing Experience (visuals, scents, textures)

  • Emotions: Delight, surprise, excitement, satisfaction, curiosity, feeling valued.
  • Pain Points:

* Late or damaged delivery.

* Confusing or overwhelming product information.

* Products not meeting expectations (e.g., quality, relevance).

* Disappointing unboxing experience (e.g., bland packaging, excessive plastic inside).

* Lack of clear instructions for product use or disposal.

  • Opportunities for Improvement:

* Premium Unboxing Experience: Design beautiful, eco-friendly packaging. Include a personalized welcome note and clear, engaging product descriptions.

* Proactive Communication: Send timely shipping updates and delivery notifications.

* High-Quality Curation: Ensure products are consistently high quality, relevant to the persona, and genuinely sustainable.

* Educational Content: Provide brief, engaging tips on how to use products, their benefits, and their sustainable impact.

* First-Month Feedback: Send a short, non-intrusive survey after the first box arrives to gather initial impressions.

Stage 5: Retention / Support

  • Customer Goal: Emily continues her subscription, feels supported, and easily resolves any issues, solidifying her loyalty.
  • Customer Actions:

* Receives subsequent "GreenBox" deliveries.

* Manages her subscription (e.g., updates address, pauses, skips).

* Engages with "GreenBox" content (newsletters, social media).

* Contacts customer support for an issue (e.g., missing item, product question).

* Provides feedback on products or service.

  • Key Touchpoints:

* Monthly "GreenBox" Delivery

* Email Newsletters (product updates, sustainable living tips)

* Customer Portal / Account Management Area

* Customer Support (email, chat, phone)

* Social Media (brand posts, community groups)

* Feedback Surveys

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

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

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

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

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

"+title+"

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

$1

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

$1

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

$1

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

"); h+="

"+hc+"

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