Disaster Recovery Plan
Run ID: 69ccde203e7fb09ff16a5d792026-04-01Infrastructure
PantheraHive BOS
BOS Dashboard

Generate a comprehensive disaster recovery plan with RTO/RPO targets, backup strategies, failover procedures, communication plans, and testing schedules.

This output addresses the "Disaster Recovery Plan" step as described in the workflow, prioritizing the core task over the conflicting marketing strategy request in the user input.


Disaster Recovery Plan

1. Executive Summary

This document outlines the Disaster Recovery Plan (DRP) for [Your Organization Name], designed to ensure the swift and effective recovery of critical IT systems and business operations in the event of a disruptive incident. The plan encompasses strategies for data backup, system failover, clear communication protocols, and regular testing to minimize downtime, data loss, and financial impact, thereby maintaining business continuity and protecting organizational reputation.

2. Purpose and Scope

Purpose:

The primary purpose of this DRP is to provide a structured approach for responding to and recovering from disruptive events that threaten the availability, integrity, or confidentiality of [Your Organization Name]'s critical information systems and services. It aims to restore essential business functions within predefined Recovery Time Objectives (RTOs) and minimize data loss within Recovery Point Objectives (RPOs).

Scope:

This DRP covers all critical IT infrastructure, applications, data, and associated business processes hosted within [Primary Data Center Location] and supported by [DR Site Location/Cloud Provider]. This includes, but is not limited to:

  • Mission-critical applications (e.g., ERP, CRM, Financial Systems, E-commerce Platforms).
  • Core network infrastructure (servers, storage, firewalls, routers).
  • Databases and associated data.
  • Communication systems (email, VoIP).
  • Cloud-based services essential for operations.
  • Personnel and facilities required for recovery operations.

It does not cover general physical safety protocols (e.g., fire drills, medical emergencies) unless directly impacting IT infrastructure.

3. Key Personnel and Roles

A dedicated Disaster Recovery Team (DRT) is established with clearly defined roles and responsibilities.

| Role | Primary Contact | Alternate Contact | Responsibilities

gemini Output

This document outlines a comprehensive Disaster Recovery Plan (DRP) designed to ensure the rapid and effective restoration of critical business functions and IT systems following a disruptive event. This plan details recovery objectives, strategies, procedures, and responsibilities to minimize downtime and data loss, maintaining business continuity.


Disaster Recovery Plan

Document Name: Disaster Recovery Plan

Version: 1.0

Date: October 26, 2023

Prepared For: [Customer Name/Organization Name]

Prepared By: PantheraHive Solutions


1. Introduction

1.1 Purpose

The primary purpose of this Disaster Recovery Plan (DRP) is to provide a structured, actionable framework for restoring critical IT infrastructure, applications, and data in the event of a major disruption. This plan aims to minimize the impact of disasters, reduce recovery time, prevent significant data loss, and ensure the continuity of essential business operations.

1.2 Scope

This DRP covers all critical IT systems, applications, data, and associated infrastructure necessary for the operation of [Customer Name/Organization Name]'s core business functions. This includes, but is not limited to:

  • Production servers (physical and virtual)
  • Network infrastructure (routers, switches, firewalls)
  • Storage systems (SAN, NAS, cloud storage)
  • Key business applications (e.g., ERP, CRM, Financial Systems, Email, Collaboration Tools)
  • Databases
  • Critical data files and user data
  • Associated connectivity and communication channels

This plan does not cover full business continuity planning (BCP) for non-IT-related business processes but focuses specifically on the technical recovery of IT assets.

1.3 Objectives

  • To establish clear Recovery Time Objectives (RTOs) and Recovery Point Objectives (RPOs) for critical systems and data.
  • To define roles, responsibilities, and authority for disaster response and recovery.
  • To outline detailed procedures for data backup, restoration, system recovery, and failover.
  • To ensure effective communication during and after a disaster.
  • To implement a regular testing and maintenance schedule for the DRP.
  • To comply with relevant regulatory requirements and industry best practices.

1.4 Guiding Principles

  • Safety First: Prioritize the safety of personnel above all else.
  • Minimize Disruption: Restore critical services as quickly as possible.
  • Data Integrity: Ensure the integrity and availability of business-critical data.
  • Cost-Effectiveness: Implement recovery strategies that balance risk and cost.
  • Simplicity and Clarity: Ensure the plan is easy to understand and execute under pressure.
  • Regular Review: The plan must be regularly tested, reviewed, and updated.

2. Key Definitions and Acronyms

  • BIA: Business Impact Analysis – A process that identifies critical business functions and the impact that a disruption to these functions might have.
  • BCP: Business Continuity Plan – A holistic plan addressing how an organization will continue to operate during and after a disruptive event.
  • DR: Disaster Recovery – The process, policies, and procedures related to preparing for recovery or continuation of technology infrastructure critical to an organization after a natural or human-induced disaster.
  • DRP: Disaster Recovery Plan – This document.
  • RPO: Recovery Point Objective – The maximum tolerable amount of data that can be lost from an IT service due to a major incident.
  • RTO: Recovery Time Objective – The maximum tolerable duration of time that a computer, system, application, or network can be down after a disaster.
  • Failover: The process of switching to a redundant or standby system upon the failure or abnormal termination of the previously active system.
  • Failback: The process of restoring operations to the original primary system after the disaster has been mitigated and the primary system is restored.
  • DRaaS: Disaster Recovery as a Service – Cloud-based DR solutions.

3. Roles and Responsibilities

Effective disaster recovery requires a clear command structure and defined responsibilities.

3.1 Crisis Management Team (CMT)

The CMT is responsible for overall strategic decision-making, resource allocation, external communications, and approving the declaration of a disaster.

  • Members: [CEO/Executive Sponsor], [Head of IT], [Head of Operations], [Head of Communications], [Legal Counsel], [Head of HR]
  • Responsibilities:

* Declare a disaster and activate the DRP.

* Authorize necessary expenditures for recovery.

* Approve external communications.

* Provide overall strategic direction and oversight.

* Ensure resource availability.

3.2 Disaster Recovery Coordinator (DRC)

The DRC is the primary point of contact for all DR activities and is responsible for managing the execution of the DRP.

  • Role: [CTO/IT Director/Senior IT Manager]
  • Responsibilities:

* Lead and coordinate all DR teams.

* Liaise with the Crisis Management Team.

* Monitor recovery progress against RTOs.

* Approve the transition to failover and failback procedures.

* Maintain and update the DRP.

3.3 IT Recovery Team

Responsible for the technical execution of system and data recovery.

  • Members: [Network Administrator], [System Administrator], [Database Administrator], [Application Support Specialist], [Cloud Engineer]
  • Responsibilities:

* Execute backup restoration and data recovery procedures.

* Configure and activate recovery site infrastructure.

* Restore and verify core IT services and applications.

* Perform failover and failback operations.

* Troubleshoot technical issues during recovery.

3.4 Communications Team

Responsible for managing all internal and external communications during a disaster.

  • Members: [Head of Communications/Marketing], [HR Representative], [Designated Spokesperson]
  • Responsibilities:

* Disseminate internal updates to employees.

* Manage external communications with customers, vendors, and media.

* Prepare and issue official statements.

* Maintain emergency contact lists.

3.5 Business Unit Liaisons

Representatives from critical business departments to validate recovery and ensure business functionality.

  • Members: [Head of Finance], [Head of Sales], [Head of Customer Service]
  • Responsibilities:

* Assess the impact of the disaster on their respective departments.

* Prioritize business function recovery needs.

* Verify the functionality of restored applications and data.

* Provide feedback on recovery effectiveness.


4. Business Impact Analysis (BIA) Summary & Recovery Objectives

A BIA identifies critical business processes, the systems that support them, and the financial and operational impact of their unavailability.

4.1 Critical Systems and Applications Identification

The following systems and applications have been identified as critical to [Customer Name/Organization Name]'s operations:

| System/Application | Business Function Supported | Criticality Level |

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

| ERP System (e.g., SAP, Oracle) | Order Processing, Inventory, Finance | Critical |

| CRM System (e.g., Salesforce) | Sales, Customer Service | Critical |

| Email & Collaboration (e.g., O365, Google Workspace) | Internal/External Communication | Critical |

| Core Database Servers | Data Storage for ERP, CRM, etc. | Critical |

| Web Servers (Customer-facing) | Online Presence, E-commerce | High |

| File Servers | Document Storage, Collaboration | High |

| Active Directory/Authentication | User Authentication, Network Access | Critical |

| Network Infrastructure | Connectivity for all systems | Critical |

| DNS Servers | Name Resolution | Critical |

4.2 Recovery Time Objectives (RTOs)

The maximum acceptable downtime for critical systems:

| System/Application | RTO (Time) | Justification |

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

| ERP System | 4 hours | Direct impact on revenue, operations |

| CRM System | 4 hours | Customer relations, sales pipeline |

| Email & Collaboration | 2 hours | Immediate communication needs |

| Core Database Servers | 2 hours | Supports multiple critical applications |

| Web Servers | 6 hours | Customer accessibility, brand reputation |

| File Servers | 8 hours | Internal productivity |

| Active Directory/Authentication | 1 hour | Prevents all user access |

| Network Infrastructure | 1 hour | Foundation for all IT services |

| DNS Servers | 1 hour | Prevents all external/internal name resolution |

4.3 Recovery Point Objectives (RPOs)

The maximum acceptable data loss for critical systems:

| System/Application | RPO (Data Loss) | Justification |

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

| ERP System | 1 hour | High transaction volume, financial impact |

| CRM System | 1 hour | Critical customer data updates |

| Email & Collaboration | 0-1 hour | Real-time communication, minimal data loss |

| Core Database Servers | 1 hour | Supports multiple critical applications |

| Web Servers | 4 hours | Content updates, less frequent changes |

| File Servers | 4 hours | User document changes |

| Active Directory/Authentication | 24 hours | Less frequent changes, can tolerate some loss |


5. Disaster Scenarios and Triggers

A "disaster" is defined as any event that causes a significant disruption to critical IT services, exceeding predefined acceptable downtime thresholds, and requiring activation of this DRP.

5.1 Common Disaster Scenarios

  • Natural Disasters: Fire, flood, earthquake, severe weather, regional power outages.
  • Cyber Attacks: Ransomware, denial-of-service (DoS), data breaches, malware infections.
  • Hardware Failure: Catastrophic failure of primary data center equipment (servers, storage, network).
  • Human Error: Accidental deletion of critical data, misconfiguration leading to widespread outage.
  • Infrastructure Failure: Major power grid failure, telecommunications outage.
  • Software Failure: Critical application or operating system corruption.

5.2 Disaster Declaration and Activation Criteria

The DRP will be activated when:

  • A critical system or multiple systems are unavailable, and their RTOs are at risk of being exceeded by conventional incident response.
  • Significant data loss has occurred or is imminent, threatening RPOs.
  • Physical access to the primary data center or office is compromised or unavailable.
  • A major cyber-attack has rendered critical systems inoperable and data inaccessible.
  • The Crisis Management Team (CMT) formally declares a disaster.

The DRC, in consultation with the CMT, is responsible for declaring a disaster and initiating the DRP.


6. Backup and Data Protection Strategies

Robust backup and data protection are foundational to meeting RPOs.

6.1 Data Classification

All data is classified based on its criticality, sensitivity, and regulatory requirements (e.g., Public, Internal, Confidential, Restricted). This classification dictates backup frequency, retention, and encryption levels.

6.2 Backup Types and Frequencies

  • Full Backups: Complete copy of all selected data.

* Frequency: Weekly (e.g., every Sunday night)

* Retention: 4 weeks on-site, 3 months off-site/cloud

  • Differential Backups: Copy of all data changed since the last full backup.

* Frequency: Daily (e.g., Monday-Saturday nights)

* Retention: 1 week on-site

  • Incremental Backups: Copy of all data changed since the last full or incremental backup.

* Frequency: Hourly/Every 4 hours for critical databases/applications.

* Retention: 24 hours on-site

  • Database Transaction Logs: Continuously shipped or replicated for near-zero RPO for critical databases.

6.3 Backup Storage Locations

  • On-site Storage: Backups stored locally on a dedicated backup appliance (e.g., NAS) for quick recovery of recent data.

* Location: Secure, fire-rated cabinet in primary data center, separate from production servers.

  • Off-site Storage: Backups replicated to a physically separate location to protect against site-wide disasters.

* Method: Encrypted replication to a secondary data center or cloud storage.

* Location: [Secondary Data Center Address/Cloud Provider Region]

  • Cloud Storage: Long-term archival and off-site storage for compliance and extended retention.

* Provider: [e.g., AWS S3, Azure Blob Storage, Google Cloud Storage]

* Features: Versioning, immutability, geographic redundancy.

6.4 Data Encryption and Integrity Checks

  • All data at rest (on backup media) and in transit (during replication) is encrypted using AES-256 encryption.
  • Regular integrity checks (e.g., checksum verification, test restores) are performed monthly on a subset of backups to ensure recoverability.

6.5 Specific System Backup Strategies

  • Virtual Machines: VM-level snapshots and image-based backups using [e.g., Veeam, Zerto, native hypervisor tools].
  • Databases:

*

gemini Output

This document outlines a comprehensive Disaster Recovery Plan (DRP) designed to ensure the swift recovery of critical systems and data following a disruptive event. This plan establishes clear objectives, procedures, and responsibilities to minimize downtime, data loss, and operational impact, thereby maintaining business continuity.


Disaster Recovery Plan

Document Version: 1.0

Date: October 26, 2023

Prepared For: [Customer Name/Organization]


1. Introduction

1.1 Purpose

The purpose of this Disaster Recovery Plan (DRP) is to provide a structured and actionable framework for responding to and recovering from disruptive events that could impact critical IT infrastructure, applications, and data. This plan aims to minimize the impact of disasters by defining clear procedures for incident response, system recovery, data restoration, and communication, ensuring the continuity of essential business operations.

1.2 Scope

This DRP covers all critical IT systems, applications, data, and associated infrastructure identified in the Business Impact Analysis (BIA) as essential for maintaining core business functions. This includes, but is not limited to:

  • Primary data centers and cloud environments.
  • Key business applications (e.g., ERP, CRM, financial systems).
  • Databases and data storage critical for operations.
  • Network infrastructure (LAN, WAN, VPN access).
  • End-user computing environments required for recovery operations.

1.3 Assumptions

This plan is based on the following assumptions:

  • A Business Impact Analysis (BIA) has been conducted to identify critical systems, their dependencies, and recovery objectives.
  • Regular backups of critical data and system configurations are performed and validated.
  • Required hardware, software licenses, and personnel are available at the recovery site or can be procured within recovery timelines.
  • Key personnel are trained and familiar with their roles and responsibilities outlined in this plan.
  • Communication channels (e.g., satellite phones, alternative network links) will be available even during widespread outages.

2. Key Definitions and Acronyms

  • BIA: Business Impact Analysis
  • DR: Disaster Recovery
  • DRP: Disaster Recovery Plan
  • RPO: Recovery Point Objective – The maximum tolerable period in which data might be lost from an IT service due to a major incident.
  • RTO: Recovery Time Objective – The maximum tolerable duration of time that a computer system, network, or application can be down after a disaster or outage.
  • SLA: Service Level Agreement
  • VM: Virtual Machine
  • UAT: User Acceptance Testing

3. Roles and Responsibilities

A clearly defined command structure and assigned roles are crucial for effective disaster recovery.

3.1 Disaster Recovery Coordinator (DRC)

  • Role: Overall responsibility for DRP activation, execution, and coordination.
  • Responsibilities:

* Declare a disaster and initiate the DRP.

* Lead and manage the DR team during an incident.

* Authorize recovery expenditures and resource allocation.

* Act as primary liaison with executive management and external stakeholders.

* Oversee communication efforts.

3.2 Incident Response Team (IRT)

  • Role: Initial assessment, containment, and notification.
  • Responsibilities:

* Detect and analyze incidents.

* Contain the impact of the incident.

* Notify the DRC and relevant teams.

* Document initial incident details.

3.3 Recovery Teams (Infrastructure, Applications, Data, Network)

  • Role: Execute specific recovery procedures for their respective domains.
  • Responsibilities:

* Infrastructure Team: Restore compute (servers, VMs), storage, and virtualization platforms.

* Applications Team: Deploy, configure, and validate critical business applications.

* Data Team: Restore databases, file systems, and ensure data integrity.

* Network Team: Restore network connectivity (LAN/WAN), DNS, firewalls, and remote access.

3.4 Communication Team

  • Role: Manage all internal and external communications during a disaster.
  • Responsibilities:

* Draft and disseminate status updates to employees, management, and customers.

* Coordinate with legal and public relations as needed.

* Maintain communication logs.

3.5 Executive Management

  • Role: Provide strategic oversight and support.
  • Responsibilities:

* Approve the DRP and allocate necessary resources.

* Support decisions made by the DRC during an incident.

* Review post-incident reports and lessons learned.

4. Business Impact Analysis (BIA) Summary & Recovery Objectives

A BIA identifies critical business functions, their dependencies on IT systems, and the impact of disruptions. The following RTO/RPO targets are derived from the BIA and represent the maximum acceptable downtime and data loss for critical systems.

4.1 Critical Systems and Services (Example)

| System/Service | Description | Business Impact if Unavailable | Recovery Tier |

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

| ERP System | Order processing, inventory, financial management | High | Tier 1 |

| CRM Database | Customer data, sales pipeline | High | Tier 1 |

| Email Service | Internal/External communication | Medium | Tier 2 |

| File Servers | Shared documents, operational data | Medium | Tier 2 |

| Website/E-commerce | Public presence, online sales | High (external) | Tier 1 |

4.2 Recovery Time Objective (RTO) Targets

The maximum acceptable downtime for critical systems:

  • Tier 1 Critical Systems (e.g., ERP, CRM, Core Databases): 4 hours
  • Tier 2 Essential Systems (e.g., Email, File Servers): 8-12 hours
  • Tier 3 Supporting Systems (e.g., Intranet, Development Environments): 24-48 hours

4.3 Recovery Point Objective (RPO) Targets

The maximum acceptable data loss for critical systems:

  • Tier 1 Critical Data (e.g., Transactional Databases, Financial Records): 15 minutes - 1 hour (achieved via continuous replication or very frequent backups)
  • Tier 2 Essential Data (e.g., User Files, Email Mailboxes): 4 hours
  • Tier 3 Supporting Data: 24 hours

5. Disaster Scenario Triggers and Classification

Disasters can arise from various sources. This section outlines common disaster types and a classification system to guide the response.

5.1 Disaster Types

  • Natural Disasters: Earthquakes, floods, severe storms, fires.
  • Technological Failures: Hardware failure, software bugs, power outages, network outages, data corruption.
  • Human Error: Accidental data deletion, misconfiguration, security breaches.
  • Malicious Attacks: Cyberattacks (ransomware, DDoS), insider threats.

5.2 Disaster Classification

  • Level 1 (Minor Incident): Localized outage affecting a single system or small group of users. Can be resolved by local IT support.

Example:* Single server failure, minor network segment outage.

Response:* Standard incident management procedures.

  • Level 2 (Major Incident): Significant outage affecting multiple critical systems or a large user base, potentially impacting business operations. Requires DR team involvement.

Example:* Data center power outage, widespread network failure.

Response:* Activate relevant sections of the DRP, engage recovery teams.

  • Level 3 (Catastrophic Disaster): Widespread or total loss of primary data center or critical infrastructure, rendering the primary site unusable for an extended period. Requires full DRP activation.

Example:* Natural disaster destroying the primary site, major cyberattack leading to complete data loss.

Response:* Full DRP activation, relocation to recovery site, comprehensive recovery efforts.

6. Incident Response Plan

This outlines the initial steps from detection to escalation before full DR plan activation.

6.1 Detection and Notification

  • Monitoring Systems: Utilize network monitoring, application performance monitoring (APM), and security information and event management (SIEM) systems for early detection.
  • User Reports: Establish clear channels for users to report outages or anomalies.
  • Initial Triage: Incident Response Team (IRT) assesses the scope and severity of the incident.
  • Notification: If the incident is deemed Level 2 or 3, the IRT immediately notifies the DRC and relevant recovery team leads via primary and secondary communication channels (e.g., dedicated crisis SMS/email, phone calls).

6.2 Initial Assessment and Declaration

  • DRC Assessment: The DRC, in conjunction with IRT and technical leads, evaluates the incident against the disaster classification criteria.
  • Impact Analysis: Determine the affected systems, estimated downtime, potential data loss, and business impact.
  • Declaration: Based on the assessment, the DRC makes a formal declaration of a disaster (Level 2 or 3) and authorizes the activation of the DRP.

6.3 Escalation Procedures

  • Team Assembly: Designated DR teams are notified to assemble (physically or virtually) at the recovery command center or designated meeting point.
  • Management Briefing: DRC provides regular updates to executive management.
  • Communication Initiation: The Communication Team begins preparing internal and external communications as per the Communication Plan.

7. Backup and Data Recovery Strategies

A robust backup strategy is the foundation of any effective DRP.

7.1 Data Backup Strategy

  • Types of Backups:

* Full Backups: Performed weekly for all critical data and systems.

* Incremental Backups: Performed daily, capturing only changes since the last backup.

* Differential Backups: Performed daily, capturing changes since the last full backup.

* Continuous Data Protection (CDP): For Tier 1 RPO targets, real-time replication or snapshotting is utilized.

  • Backup Frequency and Retention:

* Tier 1 Data: Hourly snapshots/replication, 7 days retention on-site, 30 days off-site.

* Tier 2 Data: Daily incremental, 14 days retention on-site, 90 days off-site.

* Tier 3 Data: Weekly full, 30 days retention off-site.

  • Storage Locations:

* On-site: Short-term recovery, fast access.

* Off-site (Secure Facility): Regular transport of backup media or network replication to a geographically separate, secure location.

* Cloud Storage: Encrypted and geo-redundant cloud storage for long-term retention and off-site copies.

  • Encryption and Integrity Checks:

* All backups are encrypted in transit and at rest.

* Regular verification of backup integrity and restorability is performed (see Section 10).

7.2 Application/System Backup Strategy

  • Virtual Machine (VM) Backups: Image-based backups of critical VMs are performed according to RPO targets, enabling rapid restoration of entire server instances.
  • Database Backups:

* Logical Backups: SQL dumps, export utilities.

* Physical Backups: Database snapshots, transaction log shipping for high RPO.

  • Configuration Backups: Regular backups of network device configurations, firewall rules, application configurations, and operating system settings.
  • Documentation: Comprehensive documentation of all backup schedules, locations, and restoration procedures is maintained.

8. Failover and Recovery Procedures

This section details the step-by-step process for activating and executing recovery operations.

8.1 Activation Procedures

  1. Disaster Declaration: DRC formally declares a Level 2 or 3 disaster based on incident assessment.
  2. Team Notification: All DR team members are notified via primary and secondary communication channels (e.g., emergency contact list, SMS, crisis communication platform).
  3. **Command
disaster_recovery_plan.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);}});}