Disaster Recovery Plan
Run ID: 69cc122604066a6c4a1691892026-03-31Infrastructure
PantheraHive BOS
BOS Dashboard

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

As a professional AI assistant within PantheraHive, I am generating the comprehensive Disaster Recovery Plan as requested for step 1 of your workflow. This output will serve as a detailed deliverable.


Comprehensive Disaster Recovery Plan

Document Version: 1.0

Date: October 26, 2023

Prepared For: [Customer Name/Organization]

Prepared By: PantheraHive AI Assistant


1. Introduction and Purpose

This Disaster Recovery Plan (DRP) outlines the procedures and strategies to minimize the impact of disruptive events on critical business operations and IT infrastructure. Its primary purpose is to ensure the rapid recovery of essential systems and data, thereby maintaining business continuity, protecting organizational assets, and safeguarding customer trust. This plan provides a structured approach to prevent, prepare for, respond to, and recover from various disaster scenarios.

2. Scope

This DRP covers all critical IT systems, applications, data, and associated infrastructure essential for the core operations of [Customer Name/Organization]. This includes, but is not limited to:

  • Data Centers/Cloud Environments: Primary and secondary data centers, public/private cloud infrastructure.
  • Critical Applications: [List 3-5 example critical applications, e.g., CRM, ERP, Financial Systems, E-commerce Platform, Internal Communication Tools].
  • Network Infrastructure: Routers, switches, firewalls, VPNs, internet connectivity.
  • Servers: Physical and virtual servers, operating systems.
  • Databases: All production databases.
  • Storage Systems: SAN, NAS, object storage.
  • End-User Devices: Critical workstations, laptops (for key personnel).
  • Third-Party Services: SaaS applications, managed services (where applicable).

Out-of-scope items generally include non-critical systems, personal devices not used for critical business functions, and isolated incidents affecting only a single, non-essential workstation.

3. Key Personnel and Roles

Effective disaster recovery requires a dedicated team with clear roles and responsibilities.

3.1. Disaster Recovery Team (DRT)

| Role | Primary Responsibility | Backup/Alternate | Contact (Primary) | Contact (Backup) |

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

| DRP Coordinator | Overall plan activation, management, communication, and decision-making. | [Name/Title] | [Phone/Email] | [Phone/Email] |

| IT Infrastructure Lead | Recovery of network, servers, storage, and virtualization platforms. | [Name/Title] | [Phone/Email] | [Phone/Email] |

| Applications Lead | Recovery and verification of critical business applications. | [Name/Title] | [Phone/Email] | [Phone/Email] |

| Data & Database Lead | Data restoration, database recovery, integrity checks. | [Name/Title] | [Phone/Email] | [Phone/Email] |

| Communications Lead | Internal and external communications, stakeholder updates, media relations. | [Name/Title] | [Phone/Email] | [Phone/Email] |

| Business Operations Lead | Liaison with business units, prioritization of business functions, impact assessment on operations. | [Name/Title] | [Phone/Email] | [Phone/Email] |

| Security Lead | Ensuring security integrity throughout the recovery process, incident response coordination. | [Name/Title] | [Phone/Email] | [Phone/Email] |

| Facilities Lead | Physical site assessment, power, HVAC, physical security at recovery sites. | [Name/Title] | [Phone/Email] | [Phone/Email] |

  • Note: All contact information should include primary and secondary phone numbers (office, mobile) and email addresses. An out-of-band communication method (e.g., satellite phone, emergency contact list on personal devices) should be available.

4. Risk Assessment and Business Impact Analysis (Summary)

A thorough risk assessment and BIA are foundational to this DRP.

4.1. Key Risks Identified (Examples)

  • Natural Disasters (e.g., floods, earthquakes, severe storms)
  • Cyber Attacks (e.g., ransomware, DDoS, data breaches)
  • Hardware Failure (e.g., server crash, storage array failure)
  • Software Failure (e.g., OS corruption, application bugs)
  • Human Error (e.g., accidental data deletion, misconfiguration)
  • Power Outages (prolonged)
  • Supply Chain Disruptions (impacting hardware/software availability)

4.2. Business Impact Analysis (BIA) Summary

The BIA identifies critical business functions and their dependencies on IT systems. It quantifies the potential impact of downtime (financial, reputational, legal, operational). This analysis informs the RTO/RPO targets.

  • Critical Functions: [List 3-5 examples: Order Processing, Customer Support, Financial Reporting, Manufacturing Control, Employee Payroll].
  • High Impact Systems: Systems supporting critical functions with severe consequences for downtime.
  • Medium Impact Systems: Systems with significant but manageable consequences for downtime.
  • Low Impact Systems: Systems with minimal consequences for downtime.

5. Recovery Time Objective (RTO) and Recovery Point Objective (RPO) Targets

RTO and RPO are critical metrics defining the acceptable limits for system downtime and data loss.

5.1. RTO (Recovery Time Objective)

The maximum acceptable duration of time that a business process or system can be unavailable after an incident or disaster without causing unacceptable consequences.

| System/Application Category | Example Systems/Applications | Target RTO | Rationale |

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

| Tier 1 (Critical) | Core ERP, CRM, E-commerce Platform, Financial Systems | 2-4 Hours | Direct impact on revenue, customer satisfaction, legal/compliance. |

| Tier 2 (Important) | Internal Communication, HR Systems, Development Environments | 8-24 Hours | Significant operational disruption, but not immediate revenue loss. |

| Tier 3 (Supportive) | Legacy Archives, Non-critical Intranet, Test Environments | 24-72 Hours / 1 Week | Minimal immediate impact, can operate manually for a short period. |

5.2. RPO (Recovery Point Objective)

The maximum acceptable amount of data loss measured in time. It defines the point in time to which data must be recovered.

| System/Application Category | Example Systems/Applications | Target RPO | Rationale |

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

| Tier 1 (Critical) | Core ERP, CRM, E-commerce Platform, Financial Systems | 0-15 Minutes | Real-time or near real-time data integrity is paramount. |

| Tier 2 (Important) | Internal Communication, HR Systems, Development Environments | 1-4 Hours | Acceptable to lose a few hours of non-transactional or easily recreatable data. |

| Tier 3 (Supportive) | Legacy Archives, Non-critical Intranet, Test Environments | 24 Hours / 1 Week | Data changes infrequently, or loss is easily absorbed. |

6. Backup and Restoration Strategies

A robust backup strategy is the cornerstone of data recovery.

6.1. Data Classification and Prioritization

  • Tier 1 Data: Critical, high-transactional data. Requires continuous protection (e.g., replication, CDP).
  • Tier 2 Data: Important, frequently updated data. Requires daily backups.
  • Tier 3 Data: Less frequently updated, archival data. Requires weekly/monthly backups.

6.2. Backup Methods

  • Full Backups: Complete copy of all selected data. Performed [e.g., weekly/monthly].
  • Incremental Backups: Copies only data that has changed since the last full or incremental backup. Performed [e.g., daily].
  • Differential Backups: Copies all data that has changed since the last full backup. Performed [e.g., daily].
  • Snapshotting: Point-in-time copies of virtual machines or storage volumes for rapid recovery.
  • Continuous Data Protection (CDP): Near real-time replication, allowing recovery to any point in time. Used for Tier 1 systems.

6.3. Backup Locations

  • On-site: For quick recovery of minor incidents (e.g., local disk, NAS).
  • Off-site: Secure, geographically separate location for disaster recovery (e.g., another data center, cloud storage).
  • Cloud Storage: Utilize services like AWS S3, Azure Blob Storage for cost-effective, durable, and geographically dispersed backups.

6.4. Backup Retention Policies

  • Daily Backups: Retain for [e.g., 7-30 days].
  • Weekly Backups: Retain for [e.g., 4-8 weeks].
  • Monthly Backups: Retain for [e.g., 12 months].
  • Annual Backups: Retain for [e.g., 7 years] or as per regulatory compliance.
  • Long-Term Archival: For specific data types as required by compliance (e.g., financial records).

6.5. Restoration Procedures

  • Step 1: Isolate the Incident: Prevent further data corruption or loss.
  • Step 2: Identify Recovery Point: Determine the latest valid RPO based on the incident.
  • Step 3: Select Backup Source: Identify the appropriate backup media/location.
  • Step 4: Restore Data/System: Execute restoration using documented procedures for specific systems (e.g., bare-metal restore, VM restore, database restore).
  • Step 5: Verify Integrity: Perform data integrity checks, application functionality tests, and user acceptance testing (UAT).
  • Step 6: Post-Recovery Actions: Document lessons learned, update configurations.

7. Failover and Failback Procedures

These procedures ensure the seamless transition to a secondary environment and back to the primary.

7.1. Failover Strategy

  • Automated Failover: For Tier 1 systems, utilize technologies like database replication (e.g., AlwaysOn Availability Groups, PostgreSQL Streaming Replication), VM replication (e.g., VMware SRM, Azure Site Recovery), or load balancers with health checks to automatically redirect traffic to the secondary site.
  • Manual Failover: For Tier 2/3 systems, documented manual steps for activating secondary systems and reconfiguring network settings (DNS, routing).
  • Recovery Site:

* Hot Site: Fully equipped, mirrored primary site, ready for immediate failover (for Tier 1).

* Warm Site: Partially equipped, requires some configuration and data restoration (for Tier 2).

* Cold Site: Basic infrastructure, requires significant setup and data loading (for Tier 3 or long-term recovery).

* Cloud-based DR: Leverage cloud providers' regional redundancy and DRaaS offerings for flexible and scalable recovery sites.

7.2. General Failover Procedure

  • Step 1: Declare Disaster: DRP Coordinator formally declares a disaster and activates the DRT.
  • Step 2: Assess Impact: DRT assesses the scope and severity of the disaster.
  • Step 3: Initiate Failover: Execute documented failover procedures for each critical system based on its tier.
  • Step 4: Verify Functionality: Test all critical applications and services at the recovery site.
  • Step 5: Re-route Traffic: Update DNS records, load balancer configurations, and network routes to direct users to the recovery site.
  • Step 6: Communicate: Inform stakeholders of the operational status.

7.3. General Failback Procedure

  • Step 1: Assess Primary Site Readiness: Confirm the primary site is fully restored, stable, and secure.
  • Step 2: Synchronize Data: Ensure all data changes from the recovery site are replicated back to the primary site.
  • Step 3: Plan Failback Window: Schedule a maintenance window to minimize disruption.
  • Step 4: Initiate Failback: Execute documented failback procedures, typically reversing the failover steps.
  • Step 5: Verify Functionality: Test all critical applications and services at the primary site.
  • Step 6: Re-route Traffic: Update DNS records and network configurations back to the primary site.
  • Step 7: Deactivate Recovery Site: Power down or reconfigure recovery site resources as needed.
  • Step 8: Post-Failback Review: Conduct a post-incident review.

8. Communication Plan

Effective communication is crucial during a disaster.

8.1. Internal Communication

  • DRT Activation: Automated alerts (SMS, email, paging system) to DRT members.
  • Employee Updates: Regular updates via internal communication channels (e.g., emergency portal, dedicated email, SMS blast, internal communication app) on incident status, expected recovery times, and alternative work arrangements.
  • Management Briefings: Scheduled updates for senior management and executive leadership.
  • Out-of-band Communication: Use of non-network dependent methods (e.g., personal mobile phones, satellite phones, pre-printed contact lists) if primary systems are down.

8.2. External Communication

  • Customers: Pre-approved statements for website, social media, customer portals, email notifications. Provide clear, concise, and empathetic updates.
  • Vendors/Partners: Inform critical vendors and partners about the incident and potential impact on services.
  • Regulatory Bodies: Notify relevant regulatory authorities as required by law or industry standards.
  • Media/Public: All media inquiries to be handled by the Communications Lead or designated spokesperson. Pre-approved media statements are essential.

8.3. Communication Tools

  • Emergency Notification System: Dedicated system for mass communication.
  • Shared Document Repository: Cloud-based (e.g., SharePoint, Google Drive) for DRP and contact lists.
  • Conference Bridge: Dedicated line for DRT meetings.
  • Status Dashboard: Real-time online dashboard for internal updates.

9. Testing and Maintenance Schedule

Regular testing and maintenance ensure the DRP remains effective and up-to-date.

9.1. Testing Types

  • Tabletop Exercises: Quarterly discussions of disaster scenarios with DRT to review roles, responsibilities, and procedures.
  • Walkthroughs: Semi-annual step-by-step review of recovery procedures without actual system execution.
  • Simulation Exercises: Annual testing of specific components (e.g., data restoration from backup, failover of a single application) in a controlled environment.
  • Full DR Drills: Annual comprehensive test involving activation of the recovery site, failover of all critical systems, and verification of RTO/RPO targets. This should be as realistic as possible, ideally without impacting production.
  • Unannounced Drills: Periodically conduct drills without prior notice to assess team readiness under pressure.

9.2. Testing Schedule

| Activity | Frequency | Participants | Outcome |

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

| Tabletop Exercise | Quarterly | DRT, Key Stakeholders | Identify gaps, refine procedures. |

| Backup Restoration Test | Monthly | Data & Database Lead, IT Infrastructure Lead | Verify backup integrity and restoration capability. |

| Application Failover Test | Semi-Annually | Applications Lead, IT Infrastructure Lead | Confirm failover mechanisms for key applications. |

| Full DR Drill | Annually | Entire DRT, Business Operations Lead | Validate RTO/RPO, identify weaknesses in the plan. |

| Communication Plan Test | Semi-Annually | Communications Lead, DRT | Verify contact lists, notification systems. |

| Security Incident Response | Annually | Security Lead, DRT | Test coordination with security incident response. |

9.3. Maintenance and Review

  • Annual Review: The DRP will be formally reviewed and updated annually, or whenever there are significant changes to IT infrastructure, business processes, or
gemini Output

Disaster Recovery Plan

Document Version: 1.0

Date: October 26, 2023

Prepared For: [Customer Name/Organization]

Prepared By: PantheraHive


Table of Contents

  1. Introduction

1.1 Purpose

1.2 Scope

1.3 Objectives

  1. Key Definitions
  2. Roles and Responsibilities
  3. Business Impact Analysis (BIA) Summary and Recovery Objectives

4.1 Critical Systems and Applications

4.2 Recovery Time Objectives (RTO)

4.3 Recovery Point Objectives (RPO)

  1. Disaster Declaration and Activation

5.1 Criteria for Disaster Declaration

5.2 Notification Procedures

5.3 Plan Activation

  1. Recovery Strategies

6.1 Data Backup and Restoration

6.2 System and Application Recovery (Failover Procedures)

6.3 Network Recovery

6.4 Workspace and Infrastructure Recovery

  1. Communication Plan

7.1 Internal Communication

7.2 External Communication

  1. Plan Testing and Maintenance

8.1 Testing Schedule and Types

8.2 Testing Procedures

8.3 Post-Test Review and Documentation

8.4 Plan Review and Update Schedule

  1. Post-Disaster Activities

9.1 Damage Assessment and Remediation

9.2 System Restoration (Failback)

9.3 Post-Incident Review and Lessons Learned

  1. Appendix

10.1 Emergency Contact List

10.2 Critical Vendor Contact List

10.3 Glossary of Terms

10.4 Critical System Inventory Snapshot


1. Introduction

1.1 Purpose

The purpose of this Disaster Recovery Plan (DRP) is to provide a structured and actionable framework for restoring critical IT systems and business operations following a disruptive event or disaster. This plan aims to minimize the impact of such events, ensure business continuity, protect vital data assets, and facilitate a swift and efficient return to normal operations, thereby safeguarding the organization's reputation, financial stability, and regulatory compliance.

1.2 Scope

This DRP covers the recovery of essential IT infrastructure, applications, and data critical to the continued operation of [Customer Name/Organization]. It addresses potential disruptions affecting primary data centers, cloud services, network infrastructure, and key end-user computing environments.

In-Scope:

  • Core business applications (e.g., CRM, ERP, Financial Systems)
  • Critical databases (e.g., SQL Server, Oracle, PostgreSQL)
  • Network infrastructure (e.g., Firewalls, Routers, Switches, VPN)
  • Virtualization platforms (e.g., VMware, Hyper-V)
  • Cloud-based services and integrations
  • Data storage and backup systems
  • End-user access to critical systems

Out-of-Scope (unless explicitly stated elsewhere):

  • Detailed business continuity procedures for non-IT-dependent functions (covered in a separate Business Continuity Plan)
  • Physical security protocols beyond IT asset protection
  • Response to minor, localized incidents that do not qualify as a disaster

1.3 Objectives

The primary objectives of this DRP are to:

  • Define clear roles, responsibilities, and procedures for disaster response and recovery.
  • Establish and meet defined Recovery Time Objectives (RTO) and Recovery Point Objectives (RPO) for critical systems.
  • Ensure the integrity and availability of critical data through robust backup and restoration strategies.
  • Provide a systematic approach to failover and failback processes for key IT services.
  • Minimize downtime and data loss in the event of a disaster.
  • Facilitate effective communication with internal and external stakeholders during a crisis.
  • Regularly test and update the plan to ensure its effectiveness and relevance.

2. Key Definitions

  • Business Impact Analysis (BIA): A process that identifies the critical business functions and systems and quantifies the impact of their disruption.
  • Disaster: An unexpected event that causes significant disruption to business operations and IT infrastructure, requiring activation of the DRP.
  • Disaster Recovery (DR): The process of restoring data, hardware, and software systems after a disaster.
  • Failover: The process of automatically or manually 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 a failover and the primary system has been repaired or recovered.
  • Recovery Point Objective (RPO): The maximum tolerable amount of data loss measured in time (e.g., 4 hours, 24 hours). It defines the point in time to which systems must be recovered.
  • Recovery Time Objective (RTO): The maximum tolerable duration of time that a system or application can be down following a disaster. It defines how quickly systems must be restored.
  • Warm Site: A recovery site that has hardware and connectivity but requires some configuration and data loading.
  • Hot Site: A fully equipped redundant data center that can take over operations immediately with minimal downtime.
  • Cold Site: A basic facility with power and connectivity, but requiring significant effort to install hardware and software.

3. Roles and Responsibilities

Effective disaster recovery requires a clear command structure and defined responsibilities. The following roles are critical during a disaster event:

  • DR Coordinator (Overall Lead):

* Declares a disaster and activates the DRP.

* Oversees all recovery efforts and coordinates teams.

* Primary point of contact for executive management.

* Ensures adherence to RTO/RPO targets.

* Authorizes expenditure for recovery resources.

  • IT Recovery Team Lead:

* Manages the IT recovery team.

* Directs technical recovery activities (e.g., system restoration, network configuration).

* Reports recovery status to the DR Coordinator.

* Responsible for failover and failback procedures.

  • Data Management/Backup & Restore Specialist:

* Executes data restoration procedures from backups.

* Verifies data integrity and consistency.

* Manages backup systems and off-site storage.

  • Network Specialist:

* Restores network connectivity at the recovery site.

* Configures firewalls, routers, VPNs, and DNS.

* Ensures secure remote access.

  • Systems/Application Specialist:

* Restores operating systems, virtual machines, and applications.

* Configures application-specific settings and dependencies.

* Conducts application functionality testing.

  • Communications Lead:

* Manages all internal and external communications during a disaster.

* Drafts and disseminates status updates to stakeholders.

* Coordinates with media relations if necessary.

  • Business Unit Liaisons:

* Represent specific business units to define critical needs and test restored services.

* Provide feedback on system functionality.

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

Based on the latest Business Impact Analysis (BIA), the following critical systems and recovery objectives have been identified. These targets are paramount for minimizing business disruption.

4.1 Critical Systems and Applications

| System/Application ID | System/Application Name | Description | Business Owner | Criticality | Dependencies |

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

| SYS-001 | ERP System (SAP/Oracle) | Core financial, inventory, and HR management | Finance, Operations | Critical | Database Server, Authentication, Network |

| SYS-002 | CRM System (Salesforce) | Customer relationship management, sales | Sales, Marketing | Critical | Authentication, Network |

| SYS-003 | Database Server Cluster | Hosts critical databases for ERP, custom apps | IT Operations | Critical | Storage, Virtualization, Network |

| SYS-004 | Email Server (Exchange/M365)| Internal/External communication platform | IT Operations | High | Active Directory, DNS, Network |

| SYS-005 | File Server/SharePoint | Document management, shared files | All Departments | High | Active Directory, Network |

| SYS-006 | Web Application Server | Hosts customer-facing web applications | Product Development | High | Database Server, Load Balancer, Network |

| SYS-007 | Active Directory/LDAP | User authentication and authorization | IT Security | Critical | DNS, Network |

4.2 Recovery Time Objectives (RTO)

The maximum acceptable downtime for critical systems:

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

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

| SYS-001 | ERP System | 4 hours | Direct impact on financial transactions, order processing, and payroll. |

| SYS-002 | CRM System | 8 hours | Sales and customer service operations can be manually deferred for a limited time.|

| SYS-003 | Database Server Cluster | 2 hours | Foundation for most critical applications; must be restored rapidly. |

| SYS-004 | Email Server | 12 hours | Critical for communication, but external communication can use alternatives. |

| SYS-005 | File Server/SharePoint | 24 hours | Can use local copies or temporary workarounds for a day. |

| SYS-006 | Web Application Server | 6 hours | Direct impact on customer experience and revenue generation. |

| SYS-007 | Active Directory/LDAP | 1 hour | Core authentication service; without it, almost no other system can function. |

4.3 Recovery Point Objectives (RPO)

The maximum acceptable data loss for critical systems:

| System/Application ID | System/Application Name | RPO (Time) | RPO Justification |

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

| SYS-001 | ERP System | 1 hour | High transaction volume; significant financial and operational impact of data loss.|

| SYS-002 | CRM System | 4 hours | Customer interaction data must be preserved with minimal loss. |

| SYS-003 | Database Server Cluster | 1 hour | Data integrity and consistency across dependent applications are paramount. |

| SYS-004 | Email Server | 4 hours | Minimal loss of recent communication is acceptable. |

| SYS-005 | File Server/SharePoint | 24 hours | Daily backups are sufficient; users can recreate recent work. |

| SYS-006 | Web Application Server | 1 hour | Real-time customer data and transactions need near-zero loss. |

| SYS-007 | Active Directory/LDAP | 24 hours | Less frequent changes, daily replication is adequate. |

5. Disaster Declaration and Activation

5.1 Criteria for Disaster Declaration

A disaster is declared when an event significantly disrupts normal business operations and IT services, and cannot be resolved through standard operational procedures. Examples include:

  • Major data center outage (e.g., power failure, fire, flood).
  • Catastrophic data loss or corruption beyond normal recovery capabilities.
  • Widespread cyberattack (e.g., ransomware, major data breach) rendering systems unusable.
  • Destruction or unavailability of primary office/data center facilities.
  • Prolonged regional service provider outage (e.g., internet, cloud services).
  • Any event that prevents the organization from meeting its RTOs and RPOs for critical systems.

5.2 Notification Procedures

  1. Initial Alert: Any employee discovering a potential disaster should immediately notify the IT Help Desk and their direct manager.
  2. Assessment: The IT Operations team, in coordination with the DR Coordinator, will assess the incident's scope and potential impact.
  3. DR Coordinator Notification: If the incident meets disaster criteria, the IT Operations Lead notifies the DR Coordinator (or designated alternate).
  4. Executive Management Notification: The DR Coordinator notifies Executive Management of the potential disaster and initiates a conference call.
  5. Disaster Declaration: Based on the assessment and consultation, the DR Coordinator, with Executive Management approval, formally declares a disaster.

5.3 Plan Activation

Upon disaster declaration, the DR Coordinator will initiate the following:

  1. Assemble DR Team: Activate the core DR team via pre-defined communication channels (e.g., dedicated conference bridge, secure chat, SMS).
  2. Establish Command Center: Identify and activate the primary or alternate command center (physical or virtual).
  3. Initial Briefing: Conduct an initial briefing with the DR Team to confirm the incident details, assign specific tasks, and review recovery priorities based on RTO/RPO.
  4. Secure Recovery Site: Begin the process of bringing up the designated recovery site (e.g., cloud environment, secondary data center).
  5. Communication Plan Activation: The Communications Lead begins internal and external communication as per Section 7.

6. Recovery Strategies

This section outlines the detailed procedures for recovering critical IT infrastructure and data.

6.1 Data Backup and Restoration

Robust backup strategies are fundamental to meeting RPO targets.

  • Backup Types and Frequencies:

* Critical Databases (SYS-001, SYS-003, SYS-006):

* Full Backup: Weekly (Sunday night)

* Differential Backup: Daily (Monday-Saturday night)

* Transaction Log Backups: Every 15 minutes (24/7)

RPO achieved: 15 minutes to 1 hour (depending on transaction log application).*

* Critical Application Servers (SYS-001, SYS-002, SYS-006):

* Full VM Image Backup: Weekly (Sunday night)

* Incremental VM Image Backup: Daily (Monday-Saturday night)

RPO achieved: 24 hours (for VM state).*

* File Servers/SharePoint (SYS-005):

* Full Backup: Weekly (Sunday night)

* Differential Backup: Daily (Monday-Saturday night)

RPO achieved: 24 hours.*

*Active Directory (SYS-007

gemini Output

Disaster Recovery Plan

Document Version: 1.0

Date: October 26, 2023

Author: PantheraHive AI Assistant

Approved By: [Client Management / DR Committee]


1. Executive Summary

This Disaster Recovery Plan (DRP) outlines the strategies, procedures, and responsibilities required to ensure the timely recovery of critical IT systems and data in the event of a disruptive incident. The primary goal is to minimize downtime, data loss, and operational impact, thereby maintaining business continuity and protecting organizational assets. This plan defines Recovery Time Objectives (RTOs) and Recovery Point Objectives (RPOs) for critical systems, details backup strategies, outlines failover and failback procedures, establishes a robust communication framework, and mandates a rigorous testing schedule to ensure readiness.

2. Introduction

2.1. Purpose

The purpose of this DRP is to provide a structured and actionable framework for responding to and recovering from disruptive events that impact critical IT infrastructure and services. It aims to restore operations to an acceptable level within predefined timeframes, minimizing financial losses, reputational damage, and regulatory non-compliance.

2.2. Scope

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

  • Primary Data Center infrastructure (servers, storage, network)
  • Key business applications (e.g., ERP, CRM, Financials, Email)
  • Critical databases
  • Network services and connectivity
  • End-user computing environments (as applicable for recovery efforts)

2.3. Objectives

  • Minimize Downtime: Restore critical systems and applications within their defined RTOs.
  • Minimize Data Loss: Recover data to the latest possible consistent state, adhering to defined RPOs.
  • Ensure Data Integrity: Guarantee the accuracy and consistency of recovered data.
  • Provide Clear Guidance: Establish clear roles, responsibilities, and step-by-step procedures for the DR Team.
  • Facilitate Communication: Ensure effective and timely communication with all relevant stakeholders during a disaster.
  • Maintain Compliance: Support regulatory and contractual obligations for data availability and business continuity.

2.4. Assumptions

  • A dedicated Disaster Recovery (DR) site or cloud-based DR environment is available and provisioned.
  • Necessary hardware, software licenses, and network connectivity are available at the DR site.
  • DR Team members are trained and familiar with their roles and responsibilities.
  • Backup data is valid, restorable, and accessible.
  • Key third-party vendors and service providers have their own DR plans that align with our requirements.

3. Key Definitions

  • Disaster Recovery (DR): The process of restoring IT infrastructure and operations after a disruptive event.
  • Business Continuity Plan (BCP): A comprehensive plan that outlines how an organization will continue to operate during and after a disruption. DR is a component of BCP.
  • Recovery Time Objective (RTO): The maximum acceptable duration of time an application or system can be down after a disaster before significant damage occurs.
  • Recovery Point Objective (RPO): The maximum acceptable amount of data loss, measured in time, that an application or system can sustain after a disaster.
  • Critical System: An IT system or application whose unavailability would severely impact business operations, financial stability, or regulatory compliance.
  • Failover: The process of automatically or manually switching to a redundant or standby system, server, or network when the primary system fails.
  • Failback: The process of restoring operations to the primary data center or infrastructure after the primary systems have been repaired and validated.

4. Disaster Recovery Team

The DR Team is responsible for executing this plan. Roles and responsibilities are assigned to ensure a coordinated and efficient response.

4.1. Roles and Responsibilities

| Role | Primary Contact | Alternate Contact | Responsibilities |

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

| DR Coordinator | [Name/Title] | [Name/Title] | Overall command, decision-making, external communications, plan activation. |

| Infrastructure Lead | [Name/Title] | [Name/Title] | Oversees server, storage, and virtualization recovery; coordinates hardware provisioning. |

| Network Lead | [Name/Title] | [Name/Title] | Manages network connectivity, VPNs, firewalls, DNS, and IP configurations at the DR site. |

| Applications Lead | [Name/Title] | [Name/Title] | Coordinates application-specific recovery, configuration, and testing; liaises with business owners. |

| Database Lead | [Name/Title] | [Name/Title] | Manages database restoration, integrity checks, and synchronization. |

| Communications Lead | [Name/Title] | [Name/Title] | Manages internal and external communications, updates stakeholders, drafts official statements. |

| Security Lead | [Name/Title] | [Name/Title] | Ensures security protocols are maintained during recovery, manages access control, monitors for threats. |

4.2. DR Team Contact Information

A full, up-to-date contact list for the DR Team, key personnel, and critical vendors is maintained in Appendix A: Contact List. This list includes primary and alternate phone numbers (office, mobile), email addresses, and emergency contact details. Hard copies are stored offsite.

5. Business Impact Analysis (BIA) Summary & RTO/RPO Targets

Based on the Business Impact Analysis (BIA) conducted on [Date of BIA], critical systems have been identified and assigned specific Recovery Time Objectives (RTOs) and Recovery Point Objectives (RPOs). These targets dictate the priority and methodology for recovery.

5.1. System Tiering and Targets

| System Tier | Description | RTO (Time) | RPO (Data Loss) | Example Systems |

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

| Tier 0 | Mission Critical: Immediate and continuous availability required. Zero tolerance for downtime/data loss. | < 1 hour | 0 - 15 mins | Core Transaction Processing, Critical Customer-Facing Web Applications, Real-time Data |

| Tier 1 | Critical: Essential for core business operations. Significant impact if unavailable. | 1-4 hours | 15 mins - 1 hour| ERP, CRM, Financial Systems, Primary Email/Collaboration, Core Databases |

| Tier 2 | Important: Supports key business processes. Operations can be degraded for a short period. | 4-24 hours | 1-4 hours | HR Systems, Intranet, Development Environments, Reporting Services |

| Tier 3 | Non-Critical: Can be unavailable for an extended period without significant business impact. | > 24 hours | > 4 hours | Test Systems, Archival Systems, Non-essential Internal Tools |

5.2. Critical System Inventory (Example)

| System/Application | Tier | RTO | RPO | Owner | Dependencies |

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

| ERP System (SAP) | 1 | 2 hours | 30 mins | Finance/Operations | Oracle DB, Active Directory, Network, Web Servers |

| Exchange Email | 1 | 2 hours | 1 hour | IT Services | Active Directory, DNS, Network, Storage |

| CRM (Salesforce) | 0 | 1 hour | 15 mins | Sales | Internet Connectivity, Integration Services |

| Oracle Database | 1 | 1.5 hours | 30 mins | IT Services | Storage, Compute, Network |

| Web Servers (IIS) | 1 | 1 hour | 30 mins | Marketing/IT | Database, Load Balancer, Network |

| File Share Server | 2 | 8 hours | 4 hours | All Departments | Active Directory, Storage, Network |

A comprehensive Critical System Inventory is maintained in Appendix B: System Inventory.

6. Backup and Recovery Strategy

A multi-layered backup strategy is in place to ensure data availability and recoverability for all critical systems.

6.1. Data Backup Strategy

  • Full Backups: Performed weekly for all critical data and systems. Stored locally and replicated offsite.
  • Differential Backups: Performed daily, capturing changes since the last full backup. Stored locally and replicated offsite.
  • Incremental Backups: Performed hourly for Tier 0/1 systems, capturing changes since the last backup (full or incremental). Stored locally and replicated offsite.
  • Database Backups:

* Transaction Log Shipping/Replication: For Tier 0/1 databases, continuous or near-continuous replication is configured to a standby database at the DR site, ensuring minimal data loss (low RPO).

* Full/Differential Database Backups: Performed daily/weekly and stored on dedicated backup infrastructure, replicated offsite.

  • Cloud-Native Backups: For cloud-based applications or data, native cloud backup services (e.g., AWS Snapshots, Azure Backup) are utilized according to RPO/RTO requirements.

6.2. Backup Storage and Retention

  • Primary Storage: On-premises backup appliances/servers for immediate recovery.
  • Secondary Storage (Offsite): Encrypted backups replicated to a secure offsite facility or cloud storage (e.g., AWS S3, Azure Blob Storage) daily.
  • Retention Policy:

* Daily backups: Retained for 30 days.

* Weekly full backups: Retained for 90 days.

* Monthly full backups: Retained for 1 year.

* Annual full backups: Retained for 7 years (for compliance).

6.3. Configuration Backups

  • Network Device Configurations: Automated daily backups of router, switch, firewall, and load balancer configurations to a secure repository.
  • Server Configurations (OS/Application): Regular snapshots or image-level backups of critical server configurations.
  • Application-Specific Configurations: Exported and backed up as part of application data.

6.4. Backup Verification

  • Regular Verification: Automated checks verify backup job completion and integrity.
  • Quarterly Restore Tests: Critical system backups are randomly selected and fully restored to an isolated test environment to validate restorability and data integrity. Results are documented.

7. Recovery Procedures (Failover and Failback)

This section details the step-by-step procedures for declaring a disaster, activating the DR site, recovering systems, and ultimately returning to normal operations at the primary site.

7.1. Disaster Declaration Process

  1. Detection: Incident detected by monitoring systems, IT staff, or business users.
  2. Initial Assessment: DR Coordinator and relevant leads assess the scope, severity, and potential duration of the outage.
  3. Impact Analysis: Determine if the outage meets the criteria for a disaster (e.g., primary data center unavailable, critical systems down beyond RTO).
  4. Declaration: DR Coordinator, in consultation with senior management, formally declares a disaster.
  5. DR Team Activation: All DR Team members are notified via multiple channels (phone, SMS, email) to convene at the designated command center (physical or virtual).

7.2. Initial Response and Assessment at DR Site

  1. Establish Communications: Ensure primary and alternate communication channels are operational.
  2. Verify DR Site Readiness: Confirm power, cooling, physical access, and network connectivity at the DR site.
  3. Inventory Check: Verify availability of necessary hardware, software, and licenses.
  4. Assign Tasks: DR Coordinator assigns specific recovery tasks to team members based on their roles and system priorities (referencing Section 5.2).

7.3. System-Specific Recovery Procedures (Failover)

The following outlines a general sequence. Detailed, system-specific runbooks are maintained in Appendix C: Recovery Runbooks.

  1. Network Infrastructure Recovery:

* Activate DR site network devices (routers, switches, firewalls).

* Configure external DNS to point to DR site public IPs (if applicable).

* Establish VPN tunnels or direct links to remote offices/cloud providers.

* Verify internal DNS and DHCP services are operational at DR site.

  1. Core Services Recovery (Tier 0/1):

* Directory Services (e.g., Active Directory): Restore/activate domain controllers at the DR site. Ensure replication and authentication services are functional.

* Virtualization Platform (e.g., VMware vSphere, Hyper-V): Bring up hypervisor hosts and management plane.

* Storage Systems: Activate DR site storage, ensuring data replication or restoration is complete and accessible to compute resources.

  1. Database Recovery (Tier 0/1):

* Activate standby databases (if using replication/log shipping).

* Perform point-in-time recovery from the latest available backup for other databases, according to RPO.

* Validate database integrity and consistency.

  1. Application Server Recovery (Tier 0/1):

* Restore/provision application servers from images or backups.

* Install necessary operating system patches and application prerequisites.

* Configure application settings, connect to recovered databases.

* Deploy application code from source control or latest backup.

  1. Middleware/Web Server Recovery:

* Restore/provision web servers and application servers.

* Configure load balancers to direct traffic to the recovered web/app servers.

* Deploy web application content.

  1. Testing and Validation at DR Site:

* Internal Testing: DR Team performs functional tests on all recovered systems and applications.

* Business User Testing: Designated business users perform User Acceptance Testing (UAT) on critical applications.

* Performance Testing: Basic performance checks to ensure systems are responsive.

* Security Validation: Verify firewalls, access controls, and monitoring are active.

  1. Service Restoration: Once all critical systems are validated, the DR Coordinator authorizes the official cutover to the
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
\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);}});}