SEO Architect
Run ID: 69cbe94161b1021a29a8d79b2026-03-31SEO & Growth
PantheraHive BOS
BOS Dashboard

SEO Site Architecture Design: Comprehensive Strategy

This document outlines a robust SEO site architecture designed to optimize crawlability, indexability, topical authority, and user experience for a new website or a major redesign. A well-planned architecture is fundamental for long-term search engine visibility and sustainable organic growth.

1. Core Principles of SEO Site Architecture

Our design adheres to the following core principles:

2. URL Structure Design

A clean, logical, and consistent URL structure is critical for both users and search engines.

2.1. Best Practices:

2.2. Example Hierarchical URL Structure:

text • 471 chars
https://www.yourdomain.com/
├── /category/
│   ├── /category-name/
│   │   ├── /subcategory-name/
│   │   │   ├── /product-or-article-name/
│   │   │   └── /another-product-or-article/
│   │   └── /another-subcategory/
│   └── /another-category/
├── /blog/
│   ├── /blog-category/
│   │   ├── /article-title-1/
│   │   └── /article-title-2/
│   └── /another-blog-category/
├── /about-us/
├── /contact-us/
├── /services/
│   └── /service-detail-page/
└── /privacy-policy/
Sandboxed live preview

SEO Site Architecture Design: Comprehensive Plan

This document outlines a robust SEO site architecture designed to optimize your website for search engine visibility, user experience, and long-term scalability. A well-planned architecture is fundamental for efficient crawling, effective indexing, and strong topical authority, ultimately leading to improved organic rankings and traffic.


1. Overall SEO Site Architecture Philosophy & Goals

Our approach prioritizes clarity, relevance, and efficiency. The core goals are:

  • Enhanced Crawlability: Ensure search engine bots can easily discover, access, and understand all important pages on your site.
  • Improved Indexability: Facilitate the indexing of relevant content by clearly signaling its importance and avoiding common indexing issues.
  • Strong Topical Authority: Organize content into logical categories (silos) to demonstrate deep expertise to search engines, boosting keyword rankings for target topics.
  • Superior User Experience (UX): Create an intuitive navigation path that helps users find information quickly and effortlessly, reducing bounce rates and increasing engagement.
  • Scalability & Future-Proofing: Design an architecture that can easily accommodate future content expansion without compromising SEO performance.
  • Optimal Link Equity Distribution: Strategically distribute internal link value (PageRank) to key pages, enhancing their authority.

2. URL Structure Design

A clean, logical, and descriptive URL structure is crucial for both search engines and users.

Principles:

  • Hierarchical & Logical: URLs should reflect the site's content hierarchy, making it easy to understand the relationship between pages.
  • Descriptive & Keyword-Rich: Include relevant keywords where natural, providing context to search engines and users about the page's content.
  • Static & Permanent: Avoid dynamic parameters where possible; use static, readable URLs.
  • Consistent: Maintain a uniform structure across all sections of the site.
  • Concise: Keep URLs as short as possible while retaining descriptiveness.

Best Practices:

  • Hyphens for Word Separation: Use hyphens (-) instead of underscores (_) or spaces.

Example:* example.com/category/product-name (Good) vs. example.com/category/product_name (Bad)

  • Lowercase Only: All URLs should be lowercase to avoid duplicate content issues.

Example:* example.com/category/product-name (Good) vs. example.com/Category/Product-Name (Bad)

  • Avoid Special Characters & Parameters: Limit URLs to alphanumeric characters and hyphens. Avoid session IDs or unnecessary parameters. If parameters are unavoidable, ensure proper canonicalization.
  • Exclude Stop Words (Judiciously): Remove common words like "a," "the," "and," "of" if they don't add significant meaning, to keep URLs concise.
  • Trailing Slashes Consistency: Decide on a consistent approach (with or without trailing slashes) and implement 301 redirects for the non-preferred version.
  • 301 Redirects: Implement permanent 301 redirects for any URL changes, old URLs, or non-preferred versions to preserve link equity.

Proposed URL Structure Examples:

  • Homepage: https://www.yourdomain.com/
  • Primary Category Page: https://www.yourdomain.com/category-name/
  • Sub-Category Page: https://www.yourdomain.com/category-name/sub-category-name/
  • Product/Service Page: https://www.yourdomain.com/category-name/sub-category-name/product-service-name/
  • Blog Section: https://www.yourdomain.com/blog/
  • Blog Post: https://www.yourdomain.com/blog/topic-name/article-title/
  • Static Pages (About Us, Contact): https://www.yourdomain.com/about-us/

3. Internal Linking Strategy

A strategic internal linking structure is vital for distributing PageRank, improving crawlability, and guiding users through relevant content.

Key Objectives:

  • Link Equity Distribution: Pass authority from stronger pages (e.g., homepage, high-authority category pages) to deeper, important pages.
  • Enhanced Crawlability: Ensure all valuable pages are discoverable by search engine bots.
  • Improved User Navigation: Help users easily find related content, improving engagement and reducing bounce rates.
  • Topical Relevance Reinforcement: Use descriptive anchor text to signal the topic of the linked page to search engines.

Core Components:

  1. Global Navigation:

* Main Menu: Prominently feature primary categories and key sections. Keep it concise and user-friendly.

* Footer Navigation: Include links to important utility pages (e.g., About Us, Contact, Privacy Policy, Terms of Service) and secondary category links.

* Breadcrumbs: Implement hierarchical breadcrumbs (Home > Category > Sub-Category > Current Page) on all pages below the homepage. This provides clear navigation and reinforces site structure.

  1. Contextual Links:

* Embed links within the body content of articles, product descriptions, and service pages to other highly relevant pages on your site.

* Anchor Text: Use descriptive, keyword-rich (but natural) anchor text that accurately reflects the content of the linked page. Avoid generic "click here."

  1. Related Content Sections:

* Implement "Related Articles," "Related Products," or "Customers Also Viewed" sections to encourage further exploration and link relevant pages.

  1. Sitemaps:

* HTML Sitemap: A user-friendly page listing all major sections and important pages, primarily for user navigation.

* XML Sitemap: An XML file submitted to search engines (via Google Search Console, Bing Webmaster Tools) listing all canonical, indexable URLs on your site. Update this regularly.

  1. Link Depth:

* Aim for important pages (e.g., primary category pages, top products/services, pillar content) to be no more than 2-3 clicks deep from the homepage. Deeper pages can still rank, but they receive less link equity.

* Avoid "orphan pages" – pages with no internal links pointing to them.


4. Content Silos & Hub-and-Spoke Models

Content silos and hub-and-spoke models are advanced strategies for organizing content to build deep topical authority and improve rankings for specific keyword clusters.

4.1. Content Silos

Concept:

Content siloing involves grouping related content into distinct, thematically unified categories. This signals to search engines that your site is an authority on specific topics, rather than a generalist.

Structure:

  • Top-Level Category Page (Silo Hub): A broad, comprehensive page that introduces the main topic of the silo. This page will link to all sub-categories and key articles within its silo.

Example:* yourdomain.com/digital-marketing/

  • Sub-Category Pages: More specific topics within the main silo. These pages link up to the Silo Hub and down to individual content pieces.

Example:* yourdomain.com/digital-marketing/seo/

  • Individual Content Pieces (Spokes/Leaves): Detailed articles, blog posts, product pages, or service descriptions that delve into very specific aspects of the sub-category. These pages link back up to their sub-category and the main Silo Hub.

Example:* yourdomain.com/digital-marketing/seo/local-seo-guide/

Internal Linking within Silos:

  • Vertical Linking:

* The Silo Hub links down to all its sub-category pages and important content pieces within that silo.

* Sub-category pages link up to their Silo Hub and down to their specific content pieces.

* Individual content pieces link up to their sub-category and the main Silo Hub.

  • Horizontal Linking (within Silo):

Content pieces within the same* sub-category or silo can link to each other if highly relevant, using descriptive anchor text.

  • Strict Segregation: Crucially, avoid linking across different silos. If a blog post about "SEO" needs to reference a "Social Media Marketing" concept, it should do so without directly linking to the "Social Media Marketing" silo's pages. This maintains the integrity of each silo's topical focus.

Benefits:

  • Clear topical signals for search engines.
  • Enhanced keyword rankings for specific topic clusters.
  • Improved user experience by guiding users through related content.
  • Efficient distribution of link equity within a topic.

4.2. Hub-and-Spoke Models (Pillar Content Strategy)

Concept:

A specific application of siloing, where a central "pillar page" (the hub) provides a comprehensive overview of a broad topic, and then links out to multiple "spoke" pages that delve into specific sub-topics in detail. The spoke pages, in turn, link back to the pillar page.

Structure:

  • Pillar Page (Hub): A long-form, authoritative piece of content covering a broad topic comprehensively (e.g., "The Ultimate Guide to Content Marketing"). This page aims to rank for broad, high-volume keywords.
  • Cluster Content (Spokes): Numerous shorter, detailed articles or blog posts that explore specific sub-topics mentioned in the pillar page (e.g., "How to Conduct Keyword Research," "Content Promotion Strategies," "Measuring Content ROI"). Each spoke aims to rank for more specific, long-tail keywords.

Internal Linking in Hub-and-Spoke:

  • Hub to Spokes: The Pillar Page links out to all relevant Spoke Pages.
  • Spokes to Hub: Every Spoke Page links back to the Pillar Page, reinforcing its authority and relevance for the overarching topic.
  • Spokes to Spokes (Optional): Spoke pages can also link to other highly related spoke pages within the same cluster.

Benefits:

  • Establishes clear topical authority around a core subject.
  • Consolidates link equity to the pillar page, boosting its ranking for competitive keywords.
  • Improves user journey by offering both high-level overviews and deep dives.
  • Increases the likelihood of ranking for a wide range of related keywords.

5. Technical SEO Specifications

Robust technical SEO ensures your site is accessible, understandable, and performant for both search engines and users.

5.1. Crawlability & Indexability

  • Robots.txt:

* Properly configure to guide search engine crawlers, blocking access to irrelevant or duplicate content (e.g., /wp-admin/, /search/, development environments).

* Include a link to your XML sitemap.

  • XML Sitemaps:

* Generate and maintain an up-to-date XML sitemap listing all canonical, indexable URLs.

* Submit your XML sitemap to Google Search Console and Bing Webmaster Tools.

* Ensure the sitemap is kept clean of noindex or 404 pages.

  • Canonical Tags (<link rel="canonical" href="...">):

* Implement consistently to specify the preferred version of a page, preventing duplicate content issues (e.g., www vs. non-www, URL

Actionable Steps:

  • Map out primary categories and subcategories that align with core business offerings and target keywords.
  • Develop a URL naming convention guide for future content creation.
  • Implement 301 redirects for any existing URLs that will change during a redesign to preserve link equity.

3. Content Siloing and Hub-and-Spoke Models

Content siloing is a strategic way to organize related content to establish deep topical authority, improve user experience, and consolidate link equity.

3.1. Content Silos:

  • Definition: Grouping related web pages into distinct, thematic sections. This signals to search engines that your site has comprehensive coverage and expertise on a particular topic.
  • Purpose:

* Topical Authority: Demonstrates expertise in specific areas.

* Improved Relevance: Helps search engines understand the primary subject matter of your site and individual sections.

* Link Equity Consolidation: Directs internal link equity within a silo, strengthening the ranking potential of pages within that topic.

  • Implementation:

* Physical Silos: Achieved through URL structure (as outlined above) and dedicated directories for each main topic.

* Virtual Silos: Achieved purely through internal linking, connecting related pages even if their URLs aren't in the same directory. We will primarily focus on physical silos for foundational architecture, complemented by virtual linking.

3.2. Hub-and-Spoke Model:

  • Definition: A specific content siloing strategy where a central "hub" page provides a high-level overview of a broad topic and links out to multiple "spoke" pages, each detailing a specific sub-topic. The spoke pages, in turn, link back to the hub.
  • Purpose: To create a highly interconnected cluster of content around a core theme, maximizing topical authority and internal link flow.
  • Hub Page Characteristics:

* Comprehensive Overview: Addresses the broad topic comprehensively but at a high level.

* High-Level Keywords: Targets competitive, broader keywords.

* Links to Spokes: Contains clear, contextual links to all related spoke pages.

* Authoritative: Often a cornerstone content piece.

  • Spoke Page Characteristics:

* Detailed Dive: Explores a specific sub-topic in depth.

* Long-Tail Keywords: Targets more specific, detailed search queries.

* Links to Hub: Links back to the main hub page, reinforcing its authority.

* Inter-Spoke Links: Can link to other highly relevant spoke pages within the same silo.

3.3. Illustrative Example: Digital Marketing Hub-and-Spoke Model

  • Hub Page: /digital-marketing-guide/

Content:* Comprehensive overview of digital marketing, its channels, benefits, and strategies.

Internal Links To:*

* /digital-marketing-guide/seo-strategy/ (Spoke)

* /digital-marketing-guide/ppc-advertising/ (Spoke)

* /digital-marketing-guide/content-marketing-tactics/ (Spoke)

* /digital-marketing-guide/social-media-marketing/ (Spoke)

* /digital-marketing-guide/email-marketing-best-practices/ (Spoke)

  • Spoke Page Example: /digital-marketing-guide/seo-strategy/

Content:* Detailed guide on SEO, covering on-page, off-page, technical SEO, keyword research.

Internal Links To:*

* /digital-marketing-guide/ (Hub)

* /digital-marketing-guide/content-marketing-tactics/ (Related Spoke)

* /blog/advanced-keyword-research-techniques/ (Related Blog Post)

Actionable Steps:

  • Identify 5-10 core topics that represent the most important areas of your business. These will become your primary silos/hubs.
  • For each hub, brainstorm at least 5-10 detailed sub-topics that can serve as spoke pages.
  • Develop a content plan that ensures comprehensive coverage within each silo.

4. Internal Linking Strategy

An effective internal linking strategy is crucial for distributing PageRank, improving crawlability, and enhancing user navigation.

4.1. Key Principles:

  • Contextual Links: Embed links naturally within the body text of content, using descriptive and keyword-rich anchor text.
  • Hierarchical Linking:

* Parent to Child: Higher-level pages (categories, hubs) link down to lower-level pages (subcategories, spokes, products, articles).

* Child to Parent: Lower-level pages link back up to their relevant parent pages, reinforcing their authority.

* Sibling to Sibling: Link between related pages within the same silo or category to enhance user discovery and pass equity.

  • Breadcrumbs: Implement breadcrumb navigation (Home > Category > Subcategory > Current Page) on all relevant pages. This improves user experience and provides clear hierarchical signals to search engines.
  • Primary Navigation: Ensure the main navigation menu clearly reflects the top-level categories and services, making crucial pages easily accessible.
  • Footer Navigation: Include important but less frequently accessed pages (e.g., privacy policy, terms of service, contact) in the footer.
  • Related Content Sections: Implement "Related Posts," "Recommended Products," or "Further Reading" sections to encourage deeper engagement and distribute link equity.
  • Avoid Over-optimization: Use varied and natural anchor text. Avoid stuffing keywords into every internal link.
  • NoFollow Sparingly: Only use nofollow for links to genuinely untrusted content or pages you explicitly do not want search engines to crawl/index (e.g., login pages, thank you pages).

Actionable Steps:

  • Develop a linking matrix for each content silo, outlining which pages should link to each other.
  • Prioritize internal linking to high-value pages (e.g., product pages, service pages, core money pages) from relevant informational content.
  • Regularly audit internal links to identify broken links, redirect chains, or opportunities for new links.

5. Technical SEO Specifications for Architecture

Robust technical SEO ensures that search engines can efficiently crawl, index, and understand your site's content.

5.1. Crawlability & Indexability:

  • XML Sitemaps:

* Generate a comprehensive XML sitemap (or multiple sitemaps for large sites, e.g., separate for pages, posts, products).

* Ensure it includes only canonical, indexable URLs.

* Update it automatically upon content changes.

* Submit to Google Search Console and Bing Webmaster Tools.

  • Robots.txt:

* Correctly configured to block irrelevant or low-value content (e.g., /wp-admin/, internal search results, filter pages not meant for indexing).

* Allow access to all important content and resources (CSS, JS, images).

* Include a link to the XML sitemap.

  • Canonical Tags (<link rel="canonical">):

* Implement for all pages to specify the preferred version of

gemini Output

SEO Site Architecture Design: Comprehensive Strategy

1. Executive Summary

This document outlines a comprehensive SEO site architecture designed to optimize search engine crawlability, indexability, and ranking potential, while simultaneously enhancing user experience. By implementing a clear URL structure, robust internal linking, thematic content silos, and critical technical specifications, we aim to establish strong topical authority, efficiently distribute link equity, and ensure maximum visibility for key content. This architecture is foundational for sustainable organic growth and is tailored for new sites or major redesigns.

2. Foundational Principles of SEO Site Architecture

Our design is built upon the following core principles:

  • User-Centric Design: Prioritizing intuitive navigation and a seamless experience for visitors.
  • Crawlability & Indexability: Ensuring search engine bots can efficiently discover, understand, and index all valuable content.
  • Thematic Relevance: Grouping related content logically to establish expertise and authority in specific topic areas.
  • Scalability: Designing a structure that can easily accommodate future content expansion without compromising SEO effectiveness.
  • Authority & Equity Flow: Optimizing the distribution of "link juice" (PageRank) throughout the site to boost the ranking potential of important pages.
  • Mobile-First Approach: Ensuring the architecture fully supports and performs optimally on mobile devices.

3. URL Structure Design

The URL structure will be clean, descriptive, hierarchical, and keyword-rich, providing both users and search engines with a clear understanding of the page's content and its position within the site.

3.1. General Guidelines:

  • Hierarchical & Logical: URLs should reflect the site's information hierarchy.
  • Descriptive & Keyword-Rich: Include relevant keywords that accurately describe the page's content.
  • Concise: Keep URLs as short as possible while retaining descriptiveness.
  • Static: Avoid dynamic parameters where possible, favoring static, readable URLs.
  • Lowercase: All characters in URLs should be lowercase to prevent duplicate content issues.
  • Hyphens for Separation: Use hyphens (-) to separate words. Avoid underscores (_).
  • Avoid Special Characters: Steer clear of characters like _, %, $, ?, & unless absolutely necessary for functionality (and ensure proper canonicalization).
  • Trailing Slashes: Maintain consistency (e.g., always include or always omit) to avoid duplicate content. A common practice is to include them for directories/categories and omit for final files.

3.2. Recommended Structure Format:

https://www.yourdomain.com/category/subcategory/product-or-article-slug/

3.3. Examples:

  • Homepage: https://www.yourdomain.com/
  • Top-Level Category: https://www.yourdomain.com/camping-gear/
  • Subcategory: https://www.yourdomain.com/camping-gear/tents/
  • Product Page: https://www.yourdomain.com/camping-gear/tents/2-person-lightweight-tent-xyz/
  • Blog Category: https://www.yourdomain.com/blog/hiking-guides/
  • Blog Post: https://www.yourdomain.com/blog/hiking-guides/best-trails-zion-national-park/
  • Static Page (e.g., About Us): https://www.yourdomain.com/about-us/

3.4. Canonicalization:

  • Implement self-referencing canonical tags (<link rel="canonical" href="[preferred-url]"/>) on all pages to explicitly declare the preferred version of a URL to search engines.
  • Crucial for managing variations (e.g., filtered results, sorting parameters, print versions) to consolidate link equity to the primary URL.

4. Content Siloing and Hub-and-Spoke Models

Content siloing is a strategic organization method that groups related content into distinct, thematically strong categories. This establishes clear topical authority for search engines and improves user navigation. The Hub-and-Spoke model is an advanced form of siloing, identifying cornerstone content (hubs) and supporting articles (spokes).

4.1. Content Siloing Implementation:

  • Vertical Silos: Create distinct top-level categories that serve as the "parent" for all related subcategories and content.

* Example (Outdoor Gear Site):

* Silo 1: Camping Gear

* Tents (Sub-category)

* Sleeping Bags (Sub-category)

* Cooking Equipment (Sub-category)

* Silo 2: Hiking & Backpacking

* Backpacks (Sub-category)

* Footwear (Sub-category)

* Navigation (Sub-category)

* Silo 3: Apparel

* Jackets (Sub-category)

* Pants (Sub-category)

* Base Layers (Sub-category)

  • Silo Reinforcement: Internal links within a silo should primarily point to other pages within that same silo. Cross-silo linking should be done sparingly and strategically.

4.2. Hub-and-Spoke Model Implementation:

This model leverages content silos by identifying comprehensive "hub" pages that cover a broad topic, and then linking to numerous, more specific "spoke" pages that delve into sub-topics.

  • Hub Content (Pillar Pages):

* Purpose: Comprehensive, authoritative, long-form content covering a broad topic (e.g., "Ultimate Guide to Choosing a Camping Tent"). These pages target broad, high-volume keywords.

* Characteristics: Acts as a central resource, often a category page or a detailed guide.

* Interlinking: The hub page links out to all relevant spoke pages within its silo.

  • Spoke Content (Supporting Pages):

* Purpose: More specific articles, product pages, or blog posts that expand on a particular aspect of the hub topic (e.g., "Review of the XYZ 2-Person Lightweight Tent," "How to Set Up a Dome Tent," "Best Waterproof Tents for Backpacking"). These pages target long-tail keywords.

* Characteristics: Provides in-depth information on a narrower subject.

* Interlinking: Each spoke page links back to its parent hub page and can link to other relevant spoke pages within the same silo.

4.3. Example Hub-and-Spoke Structure:

  • Hub Page: https://www.yourdomain.com/camping-gear/tents/ultimate-tent-buyers-guide/

* Links to Spokes:

* https://www.yourdomain.com/camping-gear/tents/2-person-lightweight-tent-xyz/ (Product Page)

* https://www.yourdomain.com/blog/tent-setup-tips/ (How-to Guide)

* https://www.yourdomain.com/blog/best-waterproof-tents/ (Comparison Article)

* https://www.yourdomain.com/camping-gear/tents/family-camping-tents/ (Subcategory Page)

  • Spoke Pages: Each of the above spoke pages would link back to the "Ultimate Tent Buyer's Guide" hub page, reinforcing its authority.

5. Internal Linking Strategy

A robust internal linking strategy is crucial for distributing link equity, guiding search engine crawlers, and enhancing user navigation.

5.1. Key Principles:

  • Contextual Relevance: Links should be naturally integrated into the content, pointing to relevant pages that offer further information or related products.
  • Descriptive Anchor Text: Use keyword-rich, descriptive anchor text that accurately reflects the content of the linked page. Avoid generic phrases like "click here."
  • Link Equity Distribution: Ensure important pages receive sufficient internal links to pass authority and improve their ranking potential.
  • Crawl Depth: Aim to keep all important content within 3-4 clicks from the homepage to ensure efficient crawling and indexing.
  • Orphaned Pages: Regularly monitor for and eliminate orphaned pages (pages with no internal links pointing to them).

5.2. Internal Linking Components:

  • Navigational Links:

* Main Navigation (Header): Primary categories and top-level pages.

* Breadcrumbs: Essential for user orientation and providing a clear path back to parent categories. Reflects the URL structure.

* Footer Navigation: Important static pages (e.g., About Us, Contact, Privacy Policy) and secondary category links.

* Sidebar Navigation: Category filters, related products/articles within specific sections.

  • Contextual Links (In-Content):

* The most powerful type of internal link. Strategically place links within the body copy of articles and product descriptions.

* Example: In a blog post about "Best Hiking Boots," link to specific product pages for recommended boots and to a category page for "Hiking Footwear."

  • Related Content/Product Widgets:

* "Related Articles," "You May Also Like," "Customers Also Bought" sections help keep users engaged and distribute link equity.

  • Silo-Specific Linking:

* Prioritize linking within the same content silo to strengthen topical authority.

* Only link across silos when it provides genuine user value and logical relevance

seo_architect.txt
Download source file
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);}});}