Email Marketing Sequence
Run ID: 69cbcae761b1021a29a8c5b92026-03-31Marketing
PantheraHive BOS
BOS Dashboard

Build a complete email marketing sequence with welcome series, nurture campaigns, re-engagement flows, and conversion-optimized copy.

Step 1 of 3: Audience Analysis for Email Marketing Sequence

Workflow: Email Marketing Sequence

Step: analyze_audience

Description: Comprehensive analysis of the target audience to inform the structure, content, and strategy of the email marketing sequence.


Executive Summary

This audience analysis provides the foundational understanding necessary to build a highly effective email marketing sequence. By dissecting potential customer segments, understanding their journey, identifying their pain points, and recognizing their content preferences, we can design email flows that resonate deeply, drive engagement, and ultimately lead to conversions. This report outlines key audience segments, their behavioral patterns, and strategic recommendations for tailoring email content and timing. The insights gathered will directly inform the subsequent steps of content creation and sequence development, ensuring a data-driven and customer-centric approach.


1. Target Audience Segmentation & Profiles

A successful email marketing sequence begins with a clear understanding of who we are speaking to. We propose segmenting the audience to allow for highly personalized and relevant communication.

1.1. Primary Customer Persona: [Client to Define - Example Provided]

  • Name: Innovator Ivan (B2B) / Savvy Shopper Sarah (B2C)
  • Demographics:

* Age: 30-55 (B2B decision-makers / B2C primary shoppers)

* Gender: All genders

* Location: Urban/Suburban areas; target specific regions if product/service is localized.

* Income/Company Size: Mid-to-high income individuals (B2C) / SMB to Enterprise (B2B)

* Education: Bachelor's degree or higher (B2B) / Varied (B2C)

* Occupation: Managers, Directors, C-suite (B2B) / Professionals, Parents, Enthusiasts (B2C)

  • Psychographics:

* Values: Efficiency, innovation, reliability, value for money, community.

* Interests: Industry trends, professional development, problem-solving, personal growth, specific hobbies (B2C).

* Lifestyle: Busy, tech-savvy, proactive in seeking solutions, values convenience.

* Attitudes: Open to new solutions, critical of inefficient processes, seeks quality and measurable results.

  • Behavioral Insights:

* Online Habits: Frequent use of professional networks (LinkedIn), industry forums, tech blogs, review sites (B2B) / Social media, e-commerce sites, review sites, lifestyle blogs (B2C).

* Purchase Triggers: Specific pain points, competitive offerings, limited-time promotions, social proof, expert recommendations.

* Information Consumption: Prefers data-backed insights, case studies, practical guides, video tutorials, product demos.

  • Pain Points & Needs:

* B2B Examples: Wasting time/resources on manual tasks, lack of data insights, difficulty scaling operations, cybersecurity concerns, budget constraints.

* B2C Examples: Finding reliable products, saving money, simplifying daily routines, achieving personal goals, staying updated with trends.

  • Goals & Aspirations:

* B2B Examples: Increase ROI, streamline operations, gain competitive advantage, improve team productivity, reduce operational costs.

* B2C Examples: Improve quality of life, save time/money, achieve specific health/fitness goals, enhance personal skills, find unique products.

1.2. Secondary Customer Persona: [Client to Define - Example Provided]

  • This segment might represent a different use case, a slightly younger/older demographic, or a more budget-conscious audience.
  • Key Differentiators: Highlight specific differences in demographics, pain points, or content preferences compared to the primary persona.
  • Example (B2B): "Budget-Conscious Buyer Ben" – Focus on cost savings, ease of implementation, strong ROI justification.
  • Example (B2C): "Newbie Nancy" – Requires more educational content, step-by-step guides, reassurance, and basic feature explanations.

2. Audience Journey & Engagement Insights

Understanding where the audience is in their journey is critical for delivering the right message at the right time.

2.1. Stages of the Buyer's Journey

  • Awareness:

* State: Experiencing a problem or need, starting initial research.

* Content Needs: Educational, problem-identification, industry trends, thought leadership.

* Email Role: Welcome series (introducing value), blog digests, free resource delivery.

  • Consideration:

* State: Actively researching solutions, comparing options.

* Content Needs: Solutions-oriented, comparisons, case studies, feature benefits, webinars.

* Email Role: Nurture sequences, product/service deep dives, testimonials, FAQs.

  • Decision:

* State: Ready to purchase, evaluating final options, looking for reassurance.

* Content Needs: Demos, free trials, pricing information, guarantees, social proof, special offers.

* Email Role: Conversion sequences, limited-time offers, personalized consultations, abandoned cart reminders.

  • Retention/Advocacy:

* State: Post-purchase, using the product/service, potentially looking for upgrades or additional value.

* Content Needs: How-to guides, advanced tips, new features, community engagement, exclusive offers, referral programs.

* Email Role: Onboarding series, customer success tips, cross-sell/upsell, loyalty programs, review requests.

2.2. Engagement Triggers & Barriers

  • Triggers:

* Download of a lead magnet (e.g., ebook, whitepaper, checklist).

* Website visit to specific product/service pages.

* Abandoned shopping cart (B2C) / Demo request (B2B).

* Event registration (webinar, workshop).

* Interaction with previous emails (opens, clicks).

* Subscription to a newsletter.

  • Barriers:

* Irrelevant content that doesn't address their immediate needs.

* Overly promotional emails without providing value.

* Poor mobile optimization of email content.

* Lack of personalization.

* Excessive email frequency.

* Unclear calls-to-action (CTAs).


3. Data Insights & Market Trends

Leveraging industry benchmarks and understanding current email marketing trends is crucial for optimizing our strategy.

3.1. General Email Marketing Benchmarks (Across Industries)

  • Average Open Rate: 20-25%
  • Average Click-Through Rate (CTR): 2.5-3.5%
  • Average Conversion Rate: 1-3% (from email click to desired action)
  • Average Unsubscribe Rate: 0.1-0.2%
  • Mobile Usage: ~60% of emails are opened on mobile devices.

Insight:* Email designs must be mobile-first and responsive.

3.2. Key Trends in Email Marketing

  • Hyper-Personalization: Moving beyond just name-based personalization to content, offers, and timing based on individual behavior, preferences, and purchase history.

Insight:* Segmentation and dynamic content are non-negotiable.

  • Automation & Journey Mapping: Sophisticated automation platforms allow for complex, multi-path email journeys based on user actions.

Insight:* We must design interconnected flows rather than isolated campaigns.

  • Interactive Email Content: Incorporating GIFs, videos, surveys, and even simple games directly within emails to boost engagement.

Insight:* Experiment with rich media to stand out.

  • Privacy & Trust: With increasing data privacy regulations (e.g., GDPR, CCPA), transparency and clear value proposition are essential to maintain trust and subscriber lists.

Insight:* Clearly communicate value, respect preferences, and ensure compliance.

  • Omnichannel Integration: Email marketing is increasingly integrated with other channels (social, SMS, website, ads) for a cohesive customer experience.

Insight:* Consider how email sequences can complement other marketing efforts.

3.3. Observed Customer Behavior (Based on Client's Existing Data - Placeholder for Specific Data)

  • High-Performing Subject Lines: (e.g., "How-to" guides, benefit-driven, urgent offers)
  • Preferred Content Formats: (e.g., long-form articles, short videos, infographics)
  • Peak Engagement Times: (e.g., Tuesday-Thursday, 10 AM - 2 PM local time)
  • Common Drop-off Points in Existing Flows: (e.g., after initial welcome, before a specific offer)
  • Popular Lead Magnets: (e.g., specific whitepapers, templates, free tools)

Note: For a more precise analysis, we would require access to the client's existing email marketing platform data (e.g., open rates, CTRs, conversion rates by segment, website analytics, CRM data).


4. Strategic Recommendations for Email Sequencing

Based on the audience analysis and market trends, we recommend the following strategic approaches for building the email marketing sequence.

4.1. Content Themes & Topics

  • Welcome Series: Focus on introducing the brand's unique value proposition, setting expectations, and providing initial helpful resources.

Example:* "Your Journey Starts Here: Unlock [Benefit X]," "Meet the Team Behind [Brand Name]."

  • Nurture Campaigns: Address specific pain points identified for each persona. Provide educational content, solutions-oriented articles, case studies, and testimonials.

Example:* "Solving [Pain Point Y]: A New Approach," "[Client Success Story]: How [Company] Achieved [Result]."

  • Re-engagement Flows: Offer clear value propositions, highlight new features, provide exclusive offers, or solicit feedback.

Example:* "We Miss You! Here's What You've Been Missing," "A Special Offer Just for You."

  • Conversion-Optimized Copy: Emphasize benefits over features, create urgency (where appropriate), leverage social proof, and clearly articulate the next step.

Example:* "Limited-Time Offer: Get [Product/Service] Today," "Join 10,000+ Satisfied Customers."

4.2. Tone & Voice

  • Professional yet Approachable: Build trust and authority without being overly formal.
  • Empathetic & Solution-Oriented: Acknowledge pain points and offer genuine solutions.
  • Clear & Concise: Respect the audience's time with direct and easy-to-understand language.
  • Consistent: Maintain a consistent brand voice across all communications.

4.3. Call-to-Action (CTA) Strategies

  • Clear & Singular: Each email should have one primary CTA.
  • Action-Oriented Language: Use verbs like "Download," "Learn More," "Get Started," "Shop Now."
  • Benefit-Driven: Frame the CTA around what the user will gain (e.g., "Improve Your Workflow," "Save 20% Today").
  • Visually Prominent: Use buttons, bolding, and strategic placement to make CTAs stand out.
  • Contextual: CTAs should logically follow the content of the email.

4.4. Segmentation Approach

Implement a robust segmentation strategy based on:

  • Demographics: (e.g., industry, company size, role for B2B; age, interests for B2C)
  • Behavioral Data:

* Website activity (pages visited, content downloaded).

* Email engagement (opens, clicks, last interaction).

* Purchase history (first-time buyer, repeat customer, product categories).

* Lifecycle stage (new lead, active user, churn risk).

  • Stated Preferences: (e.g., content preferences, frequency preferences gathered via preference centers).

4.5. Frequency & Timing

  • Welcome Series: Higher frequency initially (e.g., 3-5 emails over 7-10 days) to build immediate rapport.
  • Nurture Campaigns: Moderate frequency (e.g., 1-2 emails per week) to provide consistent value without overwhelming.
  • Re-engagement: Strategic timing after a period of inactivity (e.g., 30-90 days).
  • Conversion: Event-triggered (e.g., abandoned cart, demo request follow-up) or time-bound for promotions.
  • Personalized Send Times: Leverage AI-driven tools to send emails when individual subscribers are most likely to open.

5. Next Steps

To move forward effectively with the email marketing sequence development:

  1. Client Data Integration: Provide access to existing email platform data (e.g., Mailchimp, HubSpot, Salesforce Marketing Cloud, Klaviyo) and website analytics (e.g., Google Analytics). This will allow us to validate and refine the assumed audience insights with real-world data.
  2. Persona Validation Workshop: Conduct a brief workshop to validate and refine the proposed customer personas with the client's internal sales, marketing, and customer service teams.
  3. Content Audit (Optional but Recommended): Review existing marketing content (blog posts, landing pages, whitepapers) that can be repurposed or linked within the email sequences.
  4. Platform Assessment: Confirm the current email service provider (ESP) and its capabilities for automation, segmentation, and personalization.
  5. Define Key Performance Indicators (KPIs): Establish specific, measurable goals for each email sequence (e.g., welcome series open rate, nurture campaign CTR, conversion flow purchase rate).

This comprehensive audience analysis lays a strong foundation. With the client's input and data, we can proceed to craft highly effective and targeted email marketing sequences.

gemini Output

This document outlines a comprehensive email marketing sequence designed to engage subscribers at every stage of their journey, from initial welcome to re-engagement. Each email is crafted with professional, conversion-optimized copy, clear calls to action, and strategic timing to maximize impact and drive desired outcomes.


Email Marketing Sequence: Comprehensive Content Deliverable

Introduction

This deliverable provides the complete content for your email marketing sequence, structured into three core flows: Welcome Series, Nurture Campaigns, and Re-engagement Flows. Each email includes a subject line, preview text, body copy, and a clear call to action (CTA). The content is designed to be professional, engaging, and conversion-optimized, ready for integration into your email marketing platform.


1. Welcome Series

Objective: To warmly greet new subscribers, introduce them to your brand, establish value, and encourage initial engagement.


Email 1: Welcome to the Family!

  • Subject Line: Welcome to [Your Brand Name]! Here's What's Next.
  • Preview Text: We're thrilled to have you join our community! Get ready for exclusive insights and offers.
  • Body Text:

Hi [Subscriber Name],

A huge, warm welcome from the team at [Your Brand Name]! We're absolutely delighted you've decided to join our community.

At [Your Brand Name], our mission is simple: [State your core mission or value proposition in one sentence, e.g., "to empower you with innovative solutions for a healthier, happier life."]

As a valued member of our list, you can look forward to:

* Exclusive Insights: Stay ahead with our expert tips and industry trends.

* Special Offers: Be the first to know about discounts and promotions.

* New Product/Service Updates: Discover our latest innovations designed just for you.

To get started, we invite you to explore our website and see everything we have to offer. We're confident you'll find something you love!

Thank you again for joining us. We're excited to have you on board!

Best regards,

The Team at [Your Brand Name]

  • Call to Action (CTA):

* Button Text: Explore Our Website

* Link: [Link to your main website or a curated "Start Here" page]

  • Timing: Immediately after signup.

Email 2: Your Journey Starts Here: Discover [Key Benefit]

  • Subject Line: Unlock [Key Benefit] with [Your Brand Name]!
  • Preview Text: See how [Your Brand Name] can transform your experience.
  • Body Text:

Hi [Subscriber Name],

In our first email, we shared a warm welcome. Now, let's talk about how [Your Brand Name] can truly make a difference for you.

Are you looking for [mention a common pain point or desire your audience has]? At [Your Brand Name], we specialize in providing [mention your unique solution or approach].

For example, our [mention a flagship product/service or key feature] helps our customers [explain a specific, tangible benefit, e.g., "save up to 30% on energy costs" or "streamline their workflow by 50%"].

We believe in [state a core brand value, e.g., "quality, innovation, and exceptional customer service"], and we're committed to helping you achieve [desired outcome].

Ready to see the difference for yourself?

Sincerely,

The Team at [Your Brand Name]

  • Call to Action (CTA):

* Button Text: Discover [Your Product/Service Name]

* Link: [Link to a specific product/service page, solutions page, or a "How It Works" page]

  • Timing: 1-2 days after Email 1.

Email 3: Don't Just Take Our Word For It: Hear From Our Customers!

  • Subject Line: See Why [Number] Customers Love [Your Brand Name]!
  • Preview Text: Real stories, real results. Hear what our community has to say.
  • Body Text:

Hi [Subscriber Name],

We can tell you all about the benefits of [Your Brand Name], but we think it's even more powerful to hear directly from those who experience it every day.

Our community is at the heart of everything we do, and their success stories inspire us.

Here’s what some of our happy customers are saying:

*"[Short, powerful testimonial 1 - Name, Title/Location]"`

*"[Short, powerful testimonial 2 - Name, Title/Location]"`

These are just a few examples of how [Your Brand Name] is helping people like you [reiterate a key benefit or solve a problem].

Join our growing family and experience the [Your Brand Name] difference.

Warmly,

The Team at [Your Brand Name]

  • Call to Action (CTA):

* Button Text: Read More Reviews

* Link: [Link to your testimonials page, reviews section, or a case studies page]

  • Timing: 2-3 days after Email 2.

Email 4 (Optional): A Special Gift Just For You!

  • Subject Line: A Little Something Extra: Your [Discount/Freebie] from [Your Brand Name]!
  • Preview Text: As a new subscriber, enjoy this exclusive offer!
  • Body Text:

Hi [Subscriber Name],

We truly appreciate you joining our community and taking the time to get to know us. As a special thank you, we'd love to offer you [specific offer, e.g., "10% off your first purchase," "a free guide to X," or "exclusive access to our premium content for a week"].

We hope this little gift helps you [explain how the offer benefits them, e.g., "start your journey with us," "discover the value of our premium features," or "make that first step easier"].

This offer is valid for [duration, e.g., "the next 7 days"], so don't miss out!

We're excited to see you take advantage of this special opportunity.

Sincerely,

The Team at [Your Brand Name]

  • Call to Action (CTA):

* Button Text: Claim Your Offer Now

* Link: [Link to a specific product page with discount applied, landing page for freebie, or a special offer page]

  • Timing: 2-3 days after Email 3.

2. Nurture Campaigns

Objective: To build deeper relationships, educate subscribers about your products/services, address pain points, and guide them towards a purchase or desired action. This example focuses on a general product/service.


Email 1: Solving Your [Pain Point]: Our Expert Insights

  • Subject Line: Struggling with [Pain Point]? Here's How to Overcome It.
  • Preview Text: Get actionable advice from our experts on [related topic].
  • Body Text:

Hi [Subscriber Name],

In today's fast-paced world, [acknowledge the pain point, e.g., "managing your time effectively can feel like an uphill battle," or "finding reliable solutions for X is challenging"]. We hear you.

At [Your Brand Name], we're not just about products; we're about solutions. That's why we've put together [mention a valuable piece of content: blog post, guide, webinar] to help you navigate [the specific challenge].

Featured Resource:

Title: [Title of your blog post/guide/webinar]

Summary: [2-3 sentence summary of what they will learn and its benefit]

This resource is packed with [mention a specific type of valuable content, e.g., "actionable tips," "expert strategies," or "in-depth analysis"] that you can implement today.

We believe that an informed customer is an empowered customer.

Happy reading/watching,

The Team at [Your Brand Name]

  • Call to Action (CTA):

* Button Text: Read the Full Article / Download the Guide / Watch the Webinar

* Link: [Link to your blog post, guide download page, or webinar registration/recording]

  • Timing: 5-7 days after Welcome Series completion (or last open/click).

Email 2: The [Your Product/Service Name] Difference: How We Stand Out

  • Subject Line: Beyond the Basics: What Makes [Your Product/Service Name] Unique?
  • Preview Text: Discover the innovative features that set us apart.
  • Body Text:

Hi [Subscriber Name],

You've explored our insights, and now we want to show you how our flagship [product/service] can directly apply those principles to your life or business.

[Your Product/Service Name] isn't just another [product category]; it's [describe its core differentiating factor, e.g., "a comprehensive platform designed for seamless integration," or "a handcrafted solution built for durability and performance"].

Here are a few key features that make all the difference:

* [Feature 1]: [Benefit 1, e.g., "Streamline your workflow with intuitive drag-and-drop functionality."]

* [Feature 2]: [Benefit 2, e.g., "Gain real-time insights with our advanced analytics dashboard."]

* [Feature 3]: [Benefit 3, e.g., "Enjoy unparalleled support from our dedicated customer success team."]

We've built [Your Product/Service Name] with you in mind, focusing on [mention a core value like ease of use, efficiency, or reliability].

Ready to experience the difference?

Best regards,

The Team at [Your Brand Name]

  • Call to Action (CTA):

* Button Text: Explore [Your Product/Service Name]

* Link: [Link to the specific product/service page]

  • Timing: 3-4 days after Email 1.

Email 3: Real Stories: How [Customer Type] Achieved [Desired Outcome] with Us

  • Subject Line: Case Study: [Customer Name/Type] Boosted [Metric] by [Percentage]% with [Your Brand Name]
  • Preview Text: Learn from real-world success stories.
  • Body Text:

Hi [Subscriber Name],

It's one thing to talk about features, and another to see real-world impact. We love celebrating our customers' successes, and today, we'd like to share a compelling story.

Meet [Customer Name or Customer Type, e.g., "Sarah, a small business owner," or "a leading e-commerce brand"]. Like many, they faced [mention their initial challenge].

By implementing [Your Product/Service Name], [Customer Name/Type] was able to achieve:

* [Specific Result 1, e.g., "A 40% reduction in operational costs."]

* [Specific Result 2, e.g., "An 80% improvement in customer satisfaction scores."]

* [Specific Result 3, e.g., "Expanded market reach by entering two new regions."]

Their journey is a testament to the power of [Your Brand Name] to deliver tangible results.

Could your story be next?

Sincerely,

The Team at [Your Brand Name]

  • Call to Action (CTA):

* Button Text: Read the Full Case Study

* Link: [Link to the specific case study page or a collection of success stories]

  • Timing: 3-4 days after Email 2.

Email 4: Your Questions Answered: Overcoming [Common Objection]

  • Subject Line: Got Questions About [Your Product/Service]? We've Got Answers!
  • Preview Text: Addressing common concerns and clarifying how we can help.
  • Body Text:

Hi [Subscriber Name],

As you consider [Your Product/Service Name], you might have some questions or even a few hesitations. That's perfectly normal! We believe in transparency and want to address any concerns you might have.

Here are some common questions we hear, and our answers:

Q: "[Common Objection 1, e.g., 'Is it too expensive?']"

A: [Address the objection, e.g., "We offer flexible pricing tiers to fit various budgets, and our ROI analysis shows significant long-term savings. You can view our plans here: [Link to Pricing Page]"]

**Q: "[Common Objection

gemini Output

This document outlines the complete, optimized, and finalized email marketing sequence strategy. It details the structure, content, and strategic considerations for your Welcome Series, Nurture Campaigns, and Re-Engagement Flows, all underpinned by conversion-optimized copy and robust optimization principles. This comprehensive plan ensures your email communications are effective, engaging, and aligned with your business objectives.


I. Core Email Marketing Sequences

A. Welcome Series

Purpose: To onboard new subscribers, introduce your brand, set expectations, and encourage initial engagement.

Target Audience: New email subscribers (e.g., from website signup, lead magnet download, first purchase).

Key Goals: Build rapport, deliver immediate value, establish brand authority, drive initial conversion or deeper engagement.

Number of Emails: Typically 3-5 emails, spread over 1-2 weeks.

Content Strategy & Flow:

  • Email 1 (Immediate): Welcome & Value Proposition.

* Subject Line Ideas: "Welcome to [Your Brand]!", "Your [Lead Magnet] is Here!", "Thanks for Joining Us!"

* Content: Thank the subscriber, deliver any promised lead magnet, reiterate what they can expect from your emails, briefly introduce your core value/mission.

* CTA: Visit website, browse popular products/services, follow on social media.

  • Email 2 (Day 2-3): Brand Story & Unique Selling Proposition (USP).

* Subject Line Ideas: "Our Story: Why We Do What We Do", "What Makes [Your Brand] Different?"

* Content: Share your brand's origin story, values, and what makes your offering unique. Humanize your brand.

* CTA: Read our blog, explore our "About Us" page, discover our mission.

  • Email 3 (Day 4-5): Social Proof & Key Benefits.

* Subject Line Ideas: "See What Our Customers Are Saying!", "The [Problem] Solved by [Your Brand]"

* Content: Showcase testimonials, case studies, or user-generated content. Highlight specific problems your product/service solves and its key benefits.

* CTA: Read customer reviews, explore our solutions, see success stories.

  • Email 4 (Day 6-7): Call to Action / Special Offer (Optional).

* Subject Line Ideas: "A Special Gift Just For You!", "Your First Step with [Your Brand]"

* Content: A gentle nudge towards a first purchase, trial, or deeper engagement. This could be a first-time discount, a free consultation, or an invitation to a webinar.

* CTA: Shop now, claim your discount, schedule a demo, start your free trial.

Optimization Tips: Personalize with the subscriber's name

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