CRM Email Campaign
Run ID: 69cd107a3e7fb09ff16a79292026-04-01CRM
PantheraHive BOS
BOS Dashboard

Create and launch targeted email campaign

CRM Email Campaign - Step 1: Campaign Strategy Development

This document outlines the comprehensive marketing strategy for your upcoming CRM Email Campaign. It includes a detailed target audience analysis, recommended communication channels, a robust messaging framework, and key performance indicators (KPIs) to ensure the campaign's success.


1. Campaign Objective & Goal Setting

Primary Objective: To drive [Insert Specific Business Objective, e.g., lead nurturing, product adoption, customer retention, sales conversion for a specific product/service] by engaging our CRM contacts with relevant and valuable content.

SMART Goals:

  • Specific: [e.g., Increase demo requests for Product X]
  • Measurable: [e.g., by 15%]
  • Achievable: [e.g., based on historical data and current resources]
  • Relevant: [e.g., to our Q3 revenue targets]
  • Time-bound: [e.g., within the next 60 days of campaign launch]

Example SMART Goals:

  • Lead Nurturing: Increase marketing-qualified leads (MQLs) from our existing database by 20% over the next 3 months.
  • Product Promotion: Achieve a 5% conversion rate from email clicks to product purchases for [Product Name] within the campaign period.
  • Customer Retention: Reduce churn among active users by 10% through targeted educational content and feature updates over the next quarter.
  • Re-engagement: Reactivate 15% of inactive subscribers who haven't engaged in the past 6 months.

2. Target Audience Analysis

Understanding your audience is paramount. We will leverage CRM data to create targeted segments and personalize communication.

  • Demographics:

* Age Range: [e.g., 25-55]

* Geographic Location: [e.g., North America, EMEA, Global; specific regions/countries]

* Industry (B2B): [e.g., SaaS, Healthcare, Financial Services, Retail]

* Company Size (B2B): [e.g., SMBs, Mid-Market, Enterprise]

* Job Role/Seniority (B2B): [e.g., Marketing Managers, IT Directors, CEOs, HR Professionals]

  • Psychographics & Behavior:

* Pain Points/Challenges: What problems are they trying to solve? What frustrations do they experience? (e.g., inefficient workflows, lack of data insights, high costs).

* Motivations/Goals: What are their aspirations? What outcomes do they seek? (e.g., increased efficiency, cost savings, better customer experience, career advancement).

* Buying Stage: Are they in the awareness, consideration, or decision stage? (This will heavily influence messaging).

* Past Interactions: What content have they previously engaged with? What products/services have they shown interest in?

* Current Product Usage (Existing Customers): Which features do they use most? Which are underutilized?

  • Audience Segmentation Strategy:

* New Leads: Individuals who have recently opted-in or downloaded content but haven't converted.

* Existing Customers: Segmented by product/service purchased, usage level, or last interaction date.

* Inactive Users/Churn Risks: Customers/subscribers who show declining engagement or haven't interacted recently.

* Specific Product Interest: Contacts who have viewed specific product pages or downloaded related materials.

* Demo Requestors: Leads who have requested a demo but not yet converted to a sale.


3. Channel Recommendations

While the primary focus is email, we recommend an integrated approach where other channels support and amplify the email campaign.

  • Primary Channel: CRM-Integrated Email Marketing

* Email Types:

* Welcome Series: For new subscribers/leads, introducing your brand and key value propositions.

* Nurture Sequences: Delivering valuable content (blog posts, whitepapers, webinars) based on audience segments and their journey stage.

* Promotional Campaigns: Highlighting specific products, services, offers, or events.

* Re-engagement Campaigns: Targeting inactive users with compelling offers or updated content.

* Customer Lifecycle Emails: Onboarding, usage tips, feature updates, satisfaction surveys, renewal reminders.

* Transactional Emails: Order confirmations, shipping updates, password resets (optimized for branding and cross-selling opportunities).

* Platform Integration: Leveraging CRM's native email capabilities or integrating with a robust Email Service Provider (ESP) for advanced automation, segmentation, and analytics.

  • Supporting Channels (Integration Points):

* Website/Landing Pages: All email CTAs will direct to optimized landing pages for conversions (e.g., sign-up forms, product pages, demo request forms).

* Social Media: Promoting key content from emails (e.g., blog posts, webinars) on social channels. Potentially using custom audiences from CRM for retargeting.

* In-App Messaging (for SaaS/App-based products): Complementing email with targeted in-app messages for feature adoption or announcements.

* Sales Team Integration: Alerting sales teams when leads reach specific engagement thresholds or take high-intent actions via email.


4. Messaging Framework

The messaging framework ensures consistency, relevance, and impact across all campaign communications.

  • Core Value Proposition:

* Clearly articulate the unique benefit your product/service offers.

* Address the primary pain points of your target audience.

Example:* "We help [Target Audience] achieve [Desired Outcome] by [Unique Solution], leading to [Key Benefit]."

  • Key Themes & Content Pillars:

* What overarching messages will resonate with your audience?

Examples:* "Efficiency & Productivity," "Cost Savings," "Enhanced Customer Experience," "Data-Driven Decisions," "Innovation & Growth."

* Content will be mapped to these pillars (e.g., case studies on efficiency, webinars on data insights).

  • Tone of Voice:

* Professional yet approachable: Establish authority while being relatable.

* Empathetic: Acknowledge their challenges and offer solutions.

* Action-oriented: Encourage engagement and guide them towards the next step.

* Brand Consistent: Align with your overall brand voice guidelines.

  • Call to Action (CTA) Strategy:

* Clear & Concise: Every email should have a single, primary CTA.

* Benefit-Oriented: Tell them what they will gain (e.g., "Get Your Free Demo," "Download the Guide to Boost Productivity").

* Contextual: CTAs should align with the email's content and the audience's stage in the buyer journey.

* Visual Prominence: Use buttons or clear links that stand out.

  • Content Types & Personalization:

* Personalization:

* Dynamic Content: Use CRM data (name, company, industry, past purchases, website activity) to tailor email content.

* Behavioral Triggers: Send emails based on specific actions (e.g., abandoned cart, viewed a specific product, downloaded a whitepaper).

* Content Examples:

* Educational: Blog posts, whitepapers, eBooks, webinars, tutorials.

* Social Proof: Case studies, testimonials, customer reviews.

* Product-Focused: Feature spotlights, product updates, demo videos, free trial offers.

* Engagement: Polls, surveys, interactive content.


5. Key Performance Indicators (KPIs) & Measurement

We will track the following KPIs to assess campaign performance and inform future optimizations.

  • Email-Specific KPIs:

* Open Rate: Percentage of recipients who open the email. (Indicates subject line effectiveness and list health).

* Click-Through Rate (CTR): Percentage of recipients who click on a link within the email. (Indicates content relevance and CTA effectiveness).

* Conversion Rate: Percentage of recipients who complete the desired action (e.g., sign-up, purchase, demo request) after clicking. (Directly measures campaign goal achievement).

* Bounce Rate: Percentage of emails that could not be delivered. (Indicates list hygiene).

* Unsubscribe Rate: Percentage of recipients who opt out. (Indicates content relevance and audience fit).

* List Growth Rate: Net increase in email subscribers over time.

* Email ROI: Revenue generated directly from email campaigns vs. campaign cost.

  • Overall Campaign KPIs:

* Lead Generation/MQLs: Number of new leads generated or existing leads qualified by the campaign.

* Sales Qualified Leads (SQLs): Number of MQLs that convert to SQLs.

* Pipeline Contribution: Value of opportunities influenced by the campaign.

* Customer Retention Rate: For retention-focused campaigns.

* Customer Lifetime Value (CLTV): Long-term impact on customer value.

  • Reporting & Optimization:

* Frequency: Performance reports will be generated [e.g., weekly, bi-weekly, monthly].

* Tools: We will utilize [CRM Analytics Platform, Email Service Provider Analytics, Google Analytics] for comprehensive tracking.

* A/B Testing: Continuous A/B testing will be conducted on subject lines, CTAs, email content, and send times to optimize performance.


Next Steps:

Upon approval of this campaign strategy, we will proceed with:

  1. Content Creation: Developing compelling copy and visuals for email sequences and landing pages.
  2. Email Design & Development: Creating responsive and branded email templates.
  3. CRM Segmentation & Automation Setup: Configuring audience segments and setting up automated email workflows within the CRM.
  4. Testing: Thorough testing of emails, links, and automation sequences.
  5. Campaign Launch & Monitoring: Deploying the campaign and actively monitoring performance against defined KPIs.
sharper4k Output

Step 2 of 3: Image Generation for CRM Email Campaign

This document details the plan and output for the generate_image step within your "CRM Email Campaign" workflow. Our objective is to create high-quality, targeted visual assets that will significantly enhance the effectiveness of your email campaign, driving engagement and conversions.


1. Step Overview: Image Generation with sharper4k

Purpose: To design and generate compelling, on-brand visual assets for your CRM email campaign using the sharper4k engine. These images will be tailored to your campaign's objectives, target audience, and specific messaging, ensuring visual appeal and maximum impact.

Tool Utilized: sharper4k (AI-driven image generation engine)

Deliverable Focus: A set of optimized, high-resolution images ready for integration into your email templates.


2. Campaign Context & Objectives (as Understood)

To ensure the generated images perfectly align with your goals, we operate under the understanding that this CRM email campaign aims to:

  • Drive Engagement: Capture recipient attention and encourage interaction.
  • Communicate Value: Clearly convey offers, product benefits, or key messages.
  • Incitement Action: Guide recipients towards a specific Call-to-Action (CTA), such as a purchase, sign-up, or content download.
  • Reinforce Brand Identity: Maintain a consistent and professional brand image across all communications.

3. Image Requirements & Data Gathering

To kickstart the image generation process, we require the following critical information from you:

  • Campaign Goal(s): (e.g., New Product Launch, Seasonal Sale, Re-engagement, Educational Content, Event Promotion, Customer Loyalty Program).
  • Target Audience Profile: (e.g., Demographics, Psychographics, Interests, Pain Points). This helps in tailoring visual style and emotional appeal.
  • Key Message(s) / Offer(s): Specific text or value proposition to be highlighted (e.g., "20% Off All Summer Collection," "Discover Our New Eco-Friendly Line," "Exclusive Webinar Invitation").
  • Call-to-Action (CTA): What do you want recipients to do? (e.g., "Shop Now," "Learn More," "Register Here," "Get Your Free Ebook").
  • Brand Guidelines:

* Logo Files: High-resolution vector files (SVG, AI, EPS) if applicable for inclusion.

* Color Palette: Primary and secondary brand colors (HEX codes).

* Typography: Preferred fonts or font styles for any text overlays.

* Overall Brand Aesthetic: (e.g., minimalist, vibrant, luxurious, playful, corporate, rustic).

* Imagery Style Preferences: (e.g., photography, illustrations, abstract; bright and airy, dark and moody, realistic, conceptual).

  • Specific Product/Service Details (if applicable): Images, descriptions, or unique selling points to feature.
  • Existing Email Template Structure: If you have a specific template, understanding its layout will help us design images that fit seamlessly (e.g., header banner, multiple product blocks, single hero image).
  • Any "Do Not Use" Elements: Specific colors, imagery styles, or concepts to avoid.

4. Proposed Image Concepts & Themes

Based on typical CRM campaign needs, we propose generating images across the following categories. We will customize the themes and content once we receive your specific campaign details.

  1. Hero/Banner Images:

* Purpose: The primary visual at the top of the email, grabbing immediate attention.

* Themes:

* Product/Service Showcase: High-quality imagery of your featured product/service in an aspirational setting.

* Lifestyle Scene: Depicting the target audience enjoying the benefits or experience related to your offering.

* Conceptual/Abstract: Visually representing the core message or feeling of the campaign (e.g., innovation, relief, excitement).

* Promotional Overlay: Featuring discount percentages, limited-time offers, or key announcements prominently.

  1. Product/Feature Spotlights:

* Purpose: To highlight specific products, features, or benefits further down the email.

* Themes:

* Clean Product Shots: Isolated images of products against a neutral background.

* In-Context Usage: Showing products being used in real-world scenarios.

* Infographic Elements: Simple visuals explaining features or benefits.

  1. Call-to-Action (CTA) Buttons/Banners:

* Purpose: Visually distinct elements that encourage clicking.

* Themes:

* Branded buttons with clear text (e.g., "Shop Now," "Learn More").

* Small banner strips with a compelling visual and CTA.

  1. Supporting Imagery:

* Purpose: Break up text, add visual interest, or reinforce secondary messages.

* Themes:

* Lifestyle elements, abstract patterns, icons, or subtle background textures.

* Trust-building elements (e.g., customer testimonials with imagery, awards).


5. Technical Specifications & Deliverables

All generated images will be optimized for email performance and visual quality:

  • File Format: Primarily JPG for photographic images (optimal compression), PNG for images requiring transparency (e.g., logos, icons).
  • Resolution: High enough for crisp display on various screens, typically 72 DPI.
  • Dimensions:

* Hero/Banner Images: Recommended width of 600-800 pixels (to fit standard email clients), height will vary based on design (e.g., 300-450px).

* Product Spotlights: Typically square or rectangular, 300-400 pixels per side.

* CTA Buttons: Designed to be clear and clickable, typically 200-300 pixels wide.

  • File Size Optimization: Images will be compressed to ensure fast loading times without compromising visual quality, adhering to email best practices (aiming for <100-200 KB per image).
  • Accessibility: We will provide recommendations for descriptive alt text for each image to ensure accessibility for visually impaired users and improve SEO.

6. Image Generation Strategy with sharper4k

Our sharper4k engine will be leveraged as follows:

  1. Prompt Engineering: Based on your provided requirements (campaign goals, audience, brand guidelines, key messages), we will craft detailed prompts for sharper4k.
  2. Iterative Generation: We will generate multiple variations for each image type to explore different creative directions and ensure alignment with your vision.
  3. Refinement & Selection: The generated images will be reviewed for quality, brand consistency, and effectiveness. We will select the strongest candidates.
  4. Post-Processing & Optimization: Selected images will undergo minor adjustments (e.g., cropping, color correction, text overlay if specified) and rigorous optimization for email integration.

7. Key Considerations for Email Imagery

  • Brand Consistency: Every image will adhere strictly to your brand's visual identity.
  • Mobile Responsiveness: Designs will consider how images scale and appear on smaller mobile screens.
  • Clear Call-to-Actions: CTAs will be prominent and visually distinct.
  • Visual Hierarchy: Images will guide the reader's eye through the email content.
  • A/B Testing Potential: We can generate variations of key images (e.g., different hero shots, CTA button designs) to facilitate A/B testing for optimal performance.

8. Next Steps & Client Action Required

To proceed with the image generation phase effectively, please provide the following:

  1. Complete the "Image Requirements & Data Gathering" section (Section 3) with as much detail as possible.
  2. Confirm your preferred "Proposed Image Concepts & Themes" (Section 4) or suggest any additional visual ideas you have.
  3. Indicate any specific text overlays that need to be incorporated directly into the images (e.g., discount codes, slogans).
  4. Provide any existing visual assets (product photos, lifestyle shots, illustrations) that you would like us to use as inspiration or integrate directly.

Once we receive this information, we will begin the image generation process and aim to provide you with initial visual concepts within [X] business days for your review and feedback.

crm Output

This document outlines a comprehensive marketing strategy for your CRM Email Campaign, designed to create and launch targeted email campaigns effectively. This strategy encompasses target audience analysis, channel recommendations, a robust messaging framework, and key performance indicators (KPIs) to measure success.


CRM Email Campaign Strategy: Create and Launch Targeted Campaigns

1. Executive Summary

This strategy document details a data-driven approach to execute a highly effective CRM email campaign. By segmenting your audience, crafting personalized messages, and leveraging the right channels, we aim to maximize engagement, drive conversions, and strengthen customer relationships. Our focus is on creating actionable campaigns that deliver measurable results and contribute directly to your business objectives.

2. Campaign Goal(s)

The primary goal of this CRM Email Campaign is to drive [Specific Business Goal, e.g., customer acquisition, product adoption, revenue growth, customer retention] by leveraging personalized communication through email.

Specific, measurable objectives include:

  • Increase lead conversion rate by X% within the next quarter.
  • Improve customer engagement (e.g., feature usage, repeat purchases) by Y% for existing customers.
  • Generate Z% uplift in sales revenue for [specific product/service] through targeted promotions.
  • Reduce customer churn rate by W% for at-risk segments.

3. Target Audience Analysis

Effective email campaigns begin with a deep understanding of your audience. We will segment your CRM data to identify distinct groups with unique needs, behaviors, and preferences.

Approach:

  1. Data Segmentation: Utilize existing CRM data (demographics, purchase history, website activity, engagement levels, lead source) to create granular segments.
  2. Persona Development: For key segments, develop detailed buyer personas to inform messaging and content.

Key Audience Segments & Characteristics:

  • Segment 1: New Leads / Prospects

* Characteristics: Recently acquired through various channels (website forms, events, content downloads). Limited interaction history, high intent for information.

* Pain Points/Needs: Understanding your offerings, solving initial problems, trust-building.

* Goal: Nurturing, education, moving them down the funnel.

  • Segment 2: Active Customers

* Characteristics: Existing customers who have recently purchased or engaged with your product/service. High potential for upsell, cross-sell, or loyalty.

* Pain Points/Needs: Product maximization, new features, value reinforcement, exclusive offers.

* Goal: Retention, upsell/cross-sell, advocacy, increasing Customer Lifetime Value (CLTV).

  • Segment 3: Dormant / At-Risk Customers

* Characteristics: Customers with declining engagement, no recent purchases, or identified churn risk indicators.

* Pain Points/Needs: Re-engagement, problem resolution, special incentives to return.

* Goal: Re-activation, churn prevention.

  • Segment 4: High-Value / VIP Customers

* Characteristics: Customers with significant purchase history, high CLTV, or influential status.

* Pain Points/Needs: Exclusive access, personalized support, recognition, early access to new features.

* Goal: Loyalty, advocacy, premium experience.

4. Channel Recommendations

While email is the primary channel for this campaign, an integrated approach can significantly amplify its effectiveness.

Primary Channel: Email Marketing

  • Platform: [Specify your CRM's email marketing module or integrated ESP, e.g., Salesforce Marketing Cloud, HubSpot, Mailchimp, Braze].
  • Features to Leverage:

* Segmentation Tools: For precise targeting.

* Personalization Tokens: Dynamic content insertion (name, company, product interests).

* A/B Testing: For subject lines, content, CTAs, and send times.

* Automation Workflows: Drip campaigns, welcome series, abandoned cart reminders, re-engagement flows.

* Analytics & Reporting: To track performance and optimize.

Supporting Channels (for integrated campaigns):

  • Website / Landing Pages:

* Purpose: Act as the conversion hub for email CTAs.

* Recommendation: Create dedicated, optimized landing pages that align with the email's message and offer, ensuring a seamless user experience. Use tracking pixels for retargeting.

  • Social Media:

* Purpose: Amplify key messages, retarget email non-openers/non-converters, build brand awareness.

* Recommendation: Use custom audiences on platforms like Facebook, Instagram, LinkedIn to target segments identified in your CRM. Share campaign-related content.

  • SMS (Selective Use):

* Purpose: For urgent notifications, time-sensitive offers, or critical updates where email might be missed.

* Recommendation: Use sparingly and only for opt-in contacts. Integrate with CRM for consistent messaging.

  • In-App Notifications (if applicable):

* Purpose: For product-related updates, feature announcements, or personalized prompts within your application.

* Recommendation: Coordinate with email campaigns to provide a consistent user journey across platforms.

5. Messaging Framework

The messaging framework ensures consistency, relevance, and impact across all campaign communications. Each message will be tailored to the specific segment and campaign goal.

Core Principles:

  • Personalization: Address recipients by name, reference past interactions, and recommend relevant content/products.
  • Value-Driven: Clearly articulate the benefit or solution for the recipient.
  • Clear Call-to-Action (CTA): Guide the user to the next desired step with a single, prominent CTA per email.
  • Brand Voice & Tone: Maintain a consistent brand voice (e.g., informative, friendly, authoritative, urgent) appropriate for the message and audience.

Key Elements of the Messaging Framework:

  • Campaign Objective: (e.g., Lead Nurturing, Product Launch, Customer Retention, Promotion)
  • Subject Line Strategy:

* Personalization: Include recipient's name or company.

* Urgency/Scarcity: "Limited Time Offer," "Don't Miss Out."

* Curiosity: "A New Way to [Achieve Goal]," "Did You Know...?"

* Benefit-Oriented: "Unlock [Benefit]," "Improve Your [Area]."

* Emojis: Use sparingly and strategically to stand out.

* A/B Test: Continuously test subject lines to optimize open rates.

  • Email Body Structure:

* Compelling Headline: Reiterate the main benefit or offer.

* Concise Introduction: Hook the reader and state the email's purpose.

* Problem/Solution/Benefit: Clearly articulate the problem the recipient faces and how your offering provides a solution and specific benefits.

* Social Proof (Optional): Testimonials, case studies, reviews.

* Visuals: Use high-quality images, GIFs, or videos to enhance engagement.

* Clear & Prominent CTA: Button-based CTAs work best.

* Professional Closing: Signature, contact information, social links.

  • Content Pillars & Examples:

* Educational Content: Blog posts, whitepapers, webinars, how-to guides (e.g., for New Leads).

* Product/Service Updates: New features, improvements, release notes (e.g., for Active Customers).

* Exclusive Offers/Promotions: Discounts, early access, bundled deals (e.g., for Dormant or VIP Customers).

* Success Stories/Case Studies: Demonstrating value through client successes (e.g., for Prospects, Active Customers).

* Re-engagement Content: Surveys, feedback requests, special incentives (e.g., for At-Risk Customers).

* Community Building: Invites to forums, events, user groups (e.g., for Active/VIP Customers).

  • Call-to-Action (CTA) Examples:

* "Learn More"

* "Get Started Free"

* "Shop Now"

* "Download Your Guide"

* "Book a Demo"

* "Upgrade Your Plan"

* "Claim Your Discount"

6. Key Performance Indicators (KPIs)

Measuring the effectiveness of your email campaign is crucial for continuous optimization. We will track both email-specific metrics and overall business impact.

Email-Specific KPIs:

  • Open Rate: Percentage of recipients who open your email. (Indicates subject line effectiveness and sender reputation).
  • Click-Through Rate (CTR): Percentage of recipients who click on a link within the email. (Indicates content relevance and CTA effectiveness).
  • Conversion Rate: Percentage of recipients who complete the desired action after clicking (e.g., purchase, sign-up, download). (Direct measure of campaign success).
  • Bounce Rate: Percentage of emails that couldn't be delivered. (Indicates list hygiene).

Hard Bounce:* Permanent delivery failure (invalid email).

Soft Bounce:* Temporary delivery failure (full inbox, server issues).

  • Unsubscribe Rate: Percentage of recipients who opt out of your emails. (Indicates content relevance and frequency issues).
  • Spam Complaint Rate: Percentage of recipients who mark your email as spam. (Critical for sender reputation).
  • List Growth Rate: Net increase in subscribers over a period.
  • Email ROI: Revenue generated directly from email campaigns divided by campaign cost.

Business Impact KPIs:

  • Lead Generation/Quality: Number of Marketing Qualified Leads (MQLs) or Sales Qualified Leads (SQLs) generated.
  • Sales Revenue: Direct revenue attributed to the email campaign.
  • Customer Lifetime Value (CLTV): Impact on the long-term value of customers engaged through email.
  • Customer Retention Rate: For retention-focused campaigns, the percentage of customers retained.
  • Average Order Value (AOV): For promotional campaigns, the average value of purchases made.
  • Website Engagement: Time on site, pages per session, bounce rate for users clicking through from emails.

7. Next Steps & Action Plan

  1. Audience Segmentation Refinement: Finalize specific segments based on detailed CRM data analysis.
  2. Content Creation: Develop email templates, copy, and supporting landing page content for each campaign phase/segment.
  3. Campaign Flow Design: Map out automation workflows (e.g., welcome series, nurture sequences, re-engagement flows).
  4. A/B Testing Plan: Define elements to test (subject lines, CTAs, visuals, send times).
  5. Technical Setup: Configure campaigns within the chosen ESP/CRM, including tracking and analytics.
  6. Pre-Launch Review: Ensure all links, personalization, and tracking are working correctly.
  7. Launch & Monitor: Execute the campaign and closely monitor initial performance.
  8. Analyze & Optimize: Regularly review KPIs, identify areas for improvement, and iterate on campaign elements.

This comprehensive strategy provides a robust framework for launching highly effective CRM email campaigns. By adhering to these principles and continuously optimizing based on performance data, we are confident in achieving your defined business objectives.

crm_email_campaign.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
"); var hasSrcMain=Object.keys(extracted).some(function(k){return k.indexOf("src/main")>=0;}); if(!hasSrcMain) zip.file(folder+"src/main."+ext,"import React from 'react' import ReactDOM from 'react-dom/client' import App from './App' import './index.css' ReactDOM.createRoot(document.getElementById('root')!).render( ) "); var hasSrcApp=Object.keys(extracted).some(function(k){return k==="src/App."+ext||k==="App."+ext;}); if(!hasSrcApp) zip.file(folder+"src/App."+ext,"import React from 'react' import './App.css' function App(){ return(

"+slugTitle(pn)+"

Built with PantheraHive BOS

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

"+slugTitle(pn)+"

Built with PantheraHive BOS

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

"+title+"

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

$1

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

$1

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

$1

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

"); h+="

"+hc+"

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