CRM Email Campaign
Run ID: 69cbe23161b1021a29a8d2442026-03-31CRM
PantheraHive BOS
BOS Dashboard

Create and launch targeted email campaign

CRM Email Campaign: Comprehensive Marketing Strategy Development

This document outlines a comprehensive marketing strategy for your upcoming CRM Email Campaign. This strategy is designed to ensure maximum impact, drive engagement, and achieve your specific business objectives by leveraging targeted segmentation and personalized messaging through your CRM platform.


1. Target Audience Analysis & Segmentation

A deep understanding of your audience is paramount for effective email campaigns. We will segment your CRM database to create highly targeted lists, ensuring your messages resonate with specific groups.

  • Primary Audience Segments:

* Prospects (Leads): Individuals who have shown interest but haven't converted.

* Demographics: Varies by lead source (e.g., website visitors, webinar attendees, content downloaders).

* Psychographics: Seeking solutions to specific business challenges, evaluating options, learning more about your offerings.

* Behavioral: Downloaded whitepapers, attended webinars, visited product pages, opened previous nurture emails.

* Pain Points: (Example) Inefficiency in current processes, lack of specific features, budget constraints, scaling issues.

* Goals: (Example) Improve productivity, reduce costs, find a reliable partner, achieve specific business outcomes.

* Existing Customers: Individuals who have made a purchase or subscribed to a service.

* Demographics: Existing user base, industry, role, company size.

* Psychographics: Seeking to maximize value from their investment, interested in new features, upgrades, or complementary services.

* Behavioral: Product usage patterns, support ticket history, previous purchase history, engagement with onboarding emails.

* Pain Points: (Example) Underutilization of features, desire for advanced capabilities, integration challenges.

* Goals: (Example) Achieve higher ROI, expand usage, discover new features, resolve issues efficiently.

* Inactive/Churned Users: Customers who have stopped engaging or cancelled their service.

* Demographics: Previous customer profile.

* Psychographics: May have found alternative solutions, experienced dissatisfaction, or no longer have the need.

* Behavioral: No recent logins, un-opened emails, cancelled subscriptions.

* Pain Points: (Example) Dissatisfaction with service, cost, perceived lack of value.

* Goals: (Example) Re-evaluate options, find a better deal, solve a persistent problem.

  • Segmentation Strategy within CRM:

* Lifecycle Stage: Lead, MQL, SQL, Customer, Churned.

* Product/Service Interest: Based on web behavior, content downloads, or previous purchases.

* Engagement Level: Highly engaged, moderately engaged, disengaged.

* Demographic/Firmographic Data: Industry, company size, job role (for B2B), geographic location.

* Purchase History: Specific products purchased, last purchase date, total spend.


2. Channel Recommendations (Within CRM Email Context)

While the primary channel is email, we will leverage the CRM's capabilities to optimize email delivery and integrate with other touchpoints where appropriate, ensuring a cohesive customer journey.

  • Primary Channel: CRM-Integrated Email Campaigns

* Automated Nurture Sequences: For prospects, guiding them through the sales funnel with targeted content based on their engagement and lead score.

Example:* Welcome series for new sign-ups, educational series for content downloaders, demo follow-up series.

* Promotional & Offer Campaigns: For specific product launches, discounts, or seasonal promotions, segmented by interest and past behavior.

Example:* New feature announcement to existing users, upgrade offer to customers on basic plans.

* Re-engagement Campaigns: Designed to reactivate inactive leads or customers, offering value or addressing potential pain points.

Example:* "We miss you" campaigns, surveys to understand reasons for inactivity, special offers to entice return.

* Customer Success & Onboarding Emails: For new customers, providing resources, tips, and support to ensure successful adoption and retention.

Example:* Welcome email with getting started guide, feature spotlight series, tips & tricks.

* Transactional Emails (Enhanced): Beyond standard system notifications, these can be optimized for cross-sell/upsell opportunities or value reinforcement.

Example:* Order confirmation with related product recommendations, subscription renewal reminder with benefits highlight.

  • Integrated Touchpoints (Leveraging CRM Data):

* Personalized Website Content: CRM data can dynamically adjust website content for known visitors based on their segment (e.g., showing relevant case studies, product features).

* Sales Team Alerts: Trigger sales outreach based on high email engagement (e.g., multiple clicks on pricing page, content download followed by product page visit).

* In-App Messaging/Notifications: For product-led growth, email campaigns can drive users to in-app messages for feature adoption or updates.


3. Messaging Framework

Our messaging will be tailored to each segment, focusing on value, relevance, and a clear call to action, maintaining a consistent brand voice.

  • Overall Campaign Goal: (Example: Increase MQL to SQL conversion rate by 15% in Q3, Drive 10% upsell rate for Product X to existing customers).
  • Unique Value Proposition (UVP): Clearly articulate what makes your offering superior or uniquely beneficial to the specific segment.

Example:* "Streamline your workflow with our AI-powered automation, saving you 10+ hours weekly."

  • Key Messaging Pillars/Themes:

* Problem/Solution: Identify the target audience's pain point and position your offering as the ideal solution.

* Benefit-Oriented: Focus on the outcomes and advantages for the user, not just features.

* Trust & Authority: Leverage case studies, testimonials, and industry recognition.

* Urgency/Scarcity (when appropriate): For limited-time offers or promotions.

* Education/Empowerment: Provide valuable insights, tips, or industry trends that position you as a thought leader.

  • Tone & Voice: Professional, knowledgeable, helpful, customer-centric, and confident. Avoid overly salesy or aggressive language.
  • Call to Action (CTA) Strategy:

* Clear & Singular: Each email should have one primary CTA.

* Benefit-Driven: Explain what the user will gain by clicking (e.g., "Get Your Free Demo," "Download the Full Report," "Start Your 14-Day Trial").

* Placement: Prominent and easy to find (buttons preferred).

  • Personalization Strategy:

* Basic: Using recipient's first name, company name.

* Advanced: Dynamically inserting product recommendations based on past behavior, showing relevant case studies for their industry, tailoring content based on their lifecycle stage.

* Behavioral Triggers: Emails sent based on specific actions (e.g., abandoned cart, feature usage, content downloads).


4. Key Performance Indicators (KPIs)

We will track a comprehensive set of KPIs to measure campaign effectiveness, identify areas for optimization, and demonstrate ROI.

  • Email-Specific Performance Metrics:

* Open Rate (OR): Percentage of recipients who opened the email. (Indicates subject line effectiveness & list health)

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

* Conversion Rate: Percentage of recipients who completed the desired action (e.g., demo request, purchase, download) after clicking. (Direct measure of campaign success)

* Unsubscribe Rate: Percentage of recipients who opted out. (Indicates message relevance & list fatigue)

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

* Spam Complaint Rate: Percentage of recipients who marked the email as spam. (Critical for sender reputation)

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

  • Campaign-Specific Business Metrics (Aligned with Campaign Goal):

* Lead Generation:

* Number of new MQLs (Marketing Qualified Leads) generated.

* Cost per MQL.

* Lead-to-Opportunity Conversion Rate.

* Sales & Revenue:

* Attributed Revenue from email campaigns.

* Average Order Value (AOV) for email-driven purchases.

* Return on Investment (ROI) for the campaign.

* Customer Lifetime Value (CLTV) increase for segments targeted.

* Engagement & Retention:

* Website traffic generated from emails.

* Time spent on website/product pages from email clicks.

* Feature adoption rate (for customer success campaigns).

* Churn reduction rate (for re-engagement/retention campaigns).

* Customer Satisfaction (CSAT) or Net Promoter Score (NPS) if survey links are included.


This comprehensive strategy forms the foundation for launching highly effective and data-driven CRM email campaigns. The next steps will involve translating this strategy into concrete campaign flows, content creation, and technical setup within your CRM platform.

sharper4k Output

Step 2 of 3: Image Generation for CRM Email Campaign

This document details the comprehensive process for generating and optimizing visual assets for your upcoming CRM Email Campaign. Our goal is to create compelling, high-quality images that resonate with your target audience, reinforce your brand, and drive engagement, ultimately contributing to the success of your campaign.


1. Introduction & Step Overview

In this crucial step, we focus on the visual storytelling component of your CRM Email Campaign. We will leverage advanced image generation techniques, combined with strategic creative direction, to produce a suite of images tailored specifically for your email content. This includes hero banners, product/service showcases, lifestyle imagery, and supporting graphics, all optimized for email deliverability and user experience across various devices.

2. Image Strategy & Requirements Gathering

To ensure the generated images perfectly align with your campaign objectives, we will first establish a clear visual strategy. This involves understanding key elements of your campaign:

  • Campaign Goal(s): What is the primary objective of this email campaign? (e.g., product launch, promotional offer, lead nurturing, re-engagement, brand awareness).
  • Target Audience: Who are we speaking to? (Demographics, psychographics, preferences, pain points).
  • Key Message & Content Theme: What is the core message of the email? What specific products, services, or values are being highlighted?
  • Brand Guidelines: We will integrate your brand's visual identity, including color palette, typography (if embedded in images), logo usage, and overall brand tone (e.g., premium, playful, authoritative).
  • Desired Aesthetic & Mood: Do you envision a modern, minimalist, vibrant, professional, or more traditional look and feel?
  • Specific Visual Elements: Are there any particular products, scenarios, or concepts that must be depicted?
  • Existing Assets/Preferences: Do you have any existing imagery, photography, or specific visual preferences that should be incorporated or referenced?

Action Required: Please provide us with the above details or confirm an upcoming session to discuss these requirements in depth.

3. Image Generation & Selection Process

Our approach combines cutting-edge AI image generation with expert human curation to deliver optimal results:

  • AI-Powered Generation:

* Utilizing advanced AI models (e.g., DALL-E, Midjourney, Stable Diffusion), we will generate a diverse set of initial concepts based on the detailed requirements gathered.

* This allows for rapid prototyping of various visual styles, compositions, and thematic interpretations, providing a wide range of options quickly.

  • Curated Stock Photography & Custom Asset Integration:

* For specific realism, authenticity, or where AI generation may not meet precise requirements (e.g., depicting specific product models with exact accuracy), we will also explore and curate high-quality stock photography.

* Client-provided assets (e.g., product photography, lifestyle shots) will be seamlessly integrated and optimized within the overall visual scheme.

  • Iterative Design & Feedback Loop:

* We will present a selection of initial image concepts for your review.

* Based on your feedback, we will refine, iterate, and generate further variations until the visuals perfectly capture the desired message and aesthetic.

4. Image Optimization for Email Campaigns

Email images require specific optimization to ensure they display correctly, load quickly, and contribute positively to the user experience. Our optimization process includes:

  • File Size Optimization: Images will be compressed to the smallest possible file size without compromising visual quality, ensuring fast loading times and reducing the risk of emails being flagged as too large.
  • Appropriate File Formats:

* JPEG: Ideal for photographs and complex images with many colors.

* PNG: Used for images requiring transparency (e.g., logos, overlays) or sharp, graphic-based elements.

  • Optimal Resolution & Dimensions: Images will be sized appropriately for common email client display widths, ensuring crispness without unnecessary pixel density.
  • Alt Text Implementation:

* Descriptive "alt text" will be provided for all images. This is crucial for accessibility (screen readers) and ensures that even if images don't load, users still understand the visual content and context.

* Alt text also provides a fallback for users who have images disabled by default.

  • Mobile Responsiveness Consideration: Images will be designed and optimized to scale gracefully across various screen sizes, ensuring a seamless experience for users viewing emails on desktops, tablets, and mobile phones.
  • Branding Consistency: All images will adhere to your brand's visual guidelines, ensuring a cohesive and professional appearance throughout the campaign.
  • Strategic Placement & Visual Hierarchy: We will consider how images guide the reader's eye through the email content, supporting the narrative and highlighting key calls to action.

5. Proposed Image Concepts & Deliverables

Based on the requirements, we will deliver a comprehensive set of images. While specific quantities will vary by campaign complexity, a typical deliverable includes:

  • Hero Banner Image(s): The primary, eye-catching image at the top of the email, setting the tone and conveying the main message. (e.g., 2-3 distinct options for A/B testing).
  • Product/Service Showcase Images: High-quality visuals of featured products or services, highlighting key benefits or features.
  • Lifestyle/Contextual Images: Images that demonstrate the product/service in use or evoke a desired feeling, helping the audience visualize themselves.
  • Supporting Graphics: Icons, dividers, or small illustrative elements that enhance readability and visual appeal.
  • Call-to-Action (CTA) Button Graphics (Optional): Visually appealing graphical buttons that stand out and encourage clicks.

Deliverables for Your Review:

  • A curated gallery of proposed images, categorized by their intended use (e.g., Hero, Product, Lifestyle).
  • For each image:

* Proposed filename

* Recommended dimensions

* Optimized file size

* Suggested alt text

* Brief rationale for its inclusion and design choices.

6. Next Steps

Upon your review and final approval of the generated images, we will proceed to the next phase of the workflow:

  • Step 3: Email Template Integration & Campaign Launch: The approved, optimized images will be seamlessly integrated into your CRM email templates. We will then conduct final testing across various email clients and devices before scheduling and launching your targeted email campaign.

We look forward to collaborating with you to create visually stunning and highly effective email campaigns.

crm Output

CRM Email Campaign: Comprehensive Marketing Strategy & Launch Plan

This document outlines a comprehensive marketing strategy for your CRM Email Campaign, focusing on target audience analysis, channel recommendations, messaging framework, Key Performance Indicators (KPIs), and a detailed launch plan. This strategy is designed to create and launch a highly targeted and effective email campaign that drives engagement and achieves your business objectives.


1. Campaign Overview & Objectives

Campaign Name: [To be determined, e.g., "Q3 Product Feature Spotlight," "New Customer Onboarding Series," "Exclusive Partner Offer"]

Primary Goal: To leverage CRM data to deliver highly personalized and relevant email communications that drive specific business outcomes.

Overall Campaign Objective: To increase customer engagement, drive conversions (e.g., sales, sign-ups, feature adoption), and strengthen customer relationships through targeted email marketing.

SMART Objectives:

  • Increase Click-Through Rate (CTR): Achieve an average CTR of X% across all campaign emails within the first 30 days post-launch.
  • Boost Conversion Rate: Drive a Y% conversion rate (e.g., purchase, demo request, content download) from email clicks to desired action.
  • Improve Customer Retention/Engagement: Reduce churn by Z% for targeted segments or increase feature adoption by W% within 60 days.
  • Generate Revenue: Contribute $A in direct revenue attributable to the email campaign within the campaign period.

2. Target Audience Analysis & Segmentation

Effective targeting is at the core of a successful CRM email campaign. We will segment your existing CRM database to deliver tailored messages.

2.1. Primary Target Segments

Based on initial data and common business goals, we recommend focusing on the following segments. Specific segments will be refined based on your CRM data analysis.

  • Segment 1: New Leads / Prospects (MQLs/SQLs)

* Characteristics: Individuals who have recently interacted with your brand (e.g., downloaded content, attended a webinar, requested information) but have not yet converted into a customer.

* Pain Points: Information overload, need for clear value proposition, trust-building.

* Motivations: Solving a specific problem, finding a reliable solution, understanding benefits.

* Campaign Focus: Nurturing, education, value demonstration, overcoming objections.

  • Segment 2: Existing Customers (Inactive/Churn Risk)

* Characteristics: Customers who have made a purchase or used a service but show declining engagement or have been inactive for a defined period.

* Pain Points: Forgetting product benefits, lack of new feature awareness, feeling undervalued.

* Motivations: Re-engaging with a valuable solution, discovering new features, feeling appreciated.

* Campaign Focus: Re-engagement, showcasing new value, special offers, feedback solicitation.

  • Segment 3: High-Value Customers / Advocates

* Characteristics: Loyal customers who frequently engage, make repeat purchases, or have high Lifetime Value (LTV).

* Pain Points: Desire for exclusive access, feeling recognized, staying ahead with new features.

* Motivations: Exclusive benefits, early access, community involvement, recognition.

* Campaign Focus: Loyalty programs, exclusive content, early access, referral programs, testimonials.

2.2. CRM Segmentation Strategy

We will utilize your CRM's segmentation capabilities to precisely target these groups.

  • Data Points for Segmentation:

* Demographics: Industry, company size, job title, location.

* Behavioral Data: Website visits, email opens/clicks, purchase history, product usage, content downloads, last activity date.

* Transactional Data: Purchase frequency, average order value, product categories purchased.

* Lead Score: For prospects, identifying those most ready for sales engagement.

  • Actionable Steps:

1. Data Audit: Ensure all necessary data points are clean, accurate, and available in the CRM.

2. Segment Creation: Define and create specific lists or segments within the CRM based on the identified criteria.

3. Dynamic Segmentation: Configure dynamic segments where possible, so lists automatically update as contact behavior changes.


3. Messaging Framework & Content Strategy

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

3.1. Core Value Proposition

Clearly articulate the primary benefit or solution your product/service offers. This should resonate with the specific pain points of each target segment.

  • Example: "Unlock [Specific Benefit] with [Your Product/Service] – designed for [Target Audience] to [Achieve Desired Outcome]."

3.2. Key Message Themes per Segment

  • New Leads / Prospects:

* Theme: Education, Problem/Solution, Trust Building.

* Messages: "How [Your Product] solves [Pain Point]," "Benefits of [Feature X]," "Case Study: [Customer] Achieved [Result]," "Why [Your Company] is the Right Choice."

  • Existing Customers (Inactive/Churn Risk):

* Theme: Re-engagement, New Value, Exclusive Offers.

* Messages: "We Miss You! See What's New," "Unlock [New Feature] to Achieve More," "Exclusive Discount for Valued Customers," "Feedback Request: Help Us Improve."

  • High-Value Customers / Advocates:

* Theme: Appreciation, Exclusivity, Community.

* Messages: "Thank You for Your Loyalty," "Exclusive Early Access to [New Feature]," "Refer a Friend, Get Rewarded," "Join Our VIP Community."

3.3. Tone & Voice

Maintain a consistent brand voice across all emails.

  • Recommended: Professional, helpful, empathetic, solution-oriented, engaging, and concise. Adjust slightly based on the segment (e.g., more enthusiastic for advocates, more informative for prospects).

3.4. Call-to-Action (CTA) Strategy

CTAs must be clear, concise, and compelling, guiding the recipient to the next desired action.

  • Best Practices:

* Singular Focus: Aim for one primary CTA per email.

* Action-Oriented Language: "Learn More," "Get Started," "Download Now," "Shop Now," "Request a Demo."

* Prominent Placement: Above the fold, distinct button.

* Benefit-Driven: Emphasize what the user gains.

  • Examples per Segment:

* New Leads: "Request a Free Demo," "Download the Full Guide," "Start Your Free Trial."

* Inactive Customers: "Explore New Features," "Claim Your Discount," "Update Your Preferences."

* High-Value Customers: "Access Exclusive Content," "Refer a Colleague," "Join the Beta Program."

3.5. Content Types & Personalization

  • Content Types:

* Educational: Blog posts, whitepapers, webinars, how-to guides.

* Promotional: Special offers, discounts, product launches, feature announcements.

* Social Proof: Testimonials, case studies, reviews.

* Interactive: Polls, surveys, quizzes.

* Personalized Updates: Account summaries, usage reports, recommended products.

  • Personalization Strategy:

* Basic: First name, company name.

* Intermediate: Dynamic content blocks based on segment (e.g., different product recommendations, industry-specific examples).

* Advanced: Behavioral triggers (e.g., abandoned cart reminders, post-purchase follow-ups, usage-based tips).

* Recommendation: Leverage CRM data points (e.g., past purchases, viewed products, downloaded content) to make content highly relevant.


4. Channel Recommendations & Campaign Structure

While email is the primary channel, consider how it integrates with other touchpoints for a cohesive customer journey.

4.1. Email Campaign Structure

We recommend structuring the campaign as a series of automated workflows or targeted one-off sends, depending on the objective.

  • A. Nurture Sequences (for New Leads):

* Email 1 (Welcome & Value Prop): Immediately after sign-up/lead capture. Introduce your brand, core value.

* Email 2 (Problem/Solution): 2-3 days later. Detail a key pain point and how your solution addresses it.

* Email 3 (Social Proof/Trust): 3-4 days later. Share a testimonial, case study, or industry recognition.

* Email 4 (Feature Deep Dive/CTA): 3-4 days later. Highlight a key feature, strong CTA (e.g., demo, trial).

  • B. Re-engagement Series (for Inactive Customers):

* Email 1 (Gentle Nudge): After X days of inactivity. "We miss you! Here's what's new."

* Email 2 (Value Reminder/New Feature): 5-7 days later. Showcase a new feature or overlooked benefit.

* Email 3 (Exclusive Offer/Feedback): 5-7 days later. Special discount or survey to understand inactivity reasons.

  • C. Promotional / Announcement Emails (One-off or Series):

* Product Launch: Announce new products/features to relevant segments.

* Seasonal Campaigns: Holiday sales, end-of-quarter promotions.

* Event Invitations: Webinars, workshops, industry events.

  • D. Loyalty & Advocacy Emails (Ongoing):

* Anniversary Emails: "Happy [Customer Anniversary]!" with a special offer.

* Referral Program: Invite loyal customers to refer others.

* Exclusive Content/Beta Access: Offer early access or premium content.

4.2. Supporting Channels & Integration

  • Website / Landing Pages: Every email CTA should lead to a dedicated, optimized landing page for conversion. Ensure consistent branding and messaging.
  • Social Media: Amplify key campaign messages (e.g., new product announcements) on social channels. Use social ads for retargeting email non-openers or to drive email list sign-ups.
  • CRM Integration: Ensure seamless data flow between your email platform and CRM. This allows for real-time segmentation, personalization, and tracking of customer journey progression within the CRM.
  • Sales Team Alignment: For lead nurturing, ensure sales teams are aware of the email content and can follow up effectively with engaged leads.

5. Campaign Execution & Technical Setup

5.1. CRM Configuration & Data Management

  • Segment Validation: Double-check all segment definitions and ensure they are populated correctly with the latest CRM data.
  • Data Hygiene: Perform a final data clean-up to remove duplicates, invalid email addresses, and unengaged contacts (if applicable) to maintain list health.
  • Integration Check: Verify that your email service provider (ESP) is fully integrated with your CRM for seamless data exchange.

5.2. Email Template Design

  • Responsive Design: All templates must be mobile-responsive to ensure optimal viewing on any device.
  • Branding Consistency: Incorporate your brand's logo, colors, fonts, and imagery for a cohesive look and feel.
  • Clear Hierarchy: Use clear headings, bullet points, and short paragraphs for easy readability.
  • Accessibility: Consider alt text for images, sufficient color contrast, and clear link text.

5.3. A/B Testing Strategy

Implement A/B tests to continuously optimize campaign performance.

  • Key Elements to Test:

* Subject Lines: Length, emojis, personalization, urgency vs. benefit.

* CTAs: Wording, color, placement.

* Email Content: Short vs. long copy, image vs. no image, different value propositions.

* Send Times/Days: Identify optimal delivery times for each segment.

* Sender Name: Brand name vs. personal name.

5.4. Personalization & Dynamic Content Setup

  • Merge Tags: Implement merge tags (e.g., {{first_name}}, {{company_name}}) for basic personalization.
  • Dynamic Content Blocks: Configure dynamic content blocks that display different text or images based on recipient segment or CRM data (e.g., showing specific product recommendations based on past purchases).
  • Conditional Logic: Set up conditional logic within email templates to ensure relevant content is displayed only to the appropriate segments.

5.5. Automation Workflows (if applicable)

For nurture and re-engagement series, configure automated workflows based on triggers (e.g., lead score reached, inactivity detected, specific action taken).

  • Trigger: Defines when the automation starts (e.g., "contact added to 'New Leads' segment," "customer hasn't logged in for 30 days").
  • Actions: Send email, update CRM field, add to new segment.
  • Delays: Set appropriate time delays between emails in a sequence.

5.6. Compliance & Deliverability

  • CAN-SPAM/GDPR/CASL Compliance: Ensure all emails include a clear unsubscribe link, your physical address, and transparent sender information.
  • Opt-in Management: Maintain clear records of consent for all subscribers.
  • Sender Reputation: Monitor sender reputation and email authentication (SPF, DKIM, DMARC) to maximize deliverability.

6. Launch Plan & Timeline

This section outlines the key phases and activities leading up to the campaign launch.

6.1. Pre-Launch Checklist

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