Training Course Builder
Run ID: 69cadb0874bac0555ea30e682026-03-30Education
PantheraHive BOS
BOS Dashboard

Build a complete training course with modules, lesson plans, quizzes, hands-on exercises, and certification criteria for any subject.

Training Course Builder: Research & Design Requirements

This document outlines the detailed research and design requirements for the "Training Course Builder" platform. The goal is to create an intuitive, powerful, and flexible tool that empowers users to build comprehensive training courses for any subject, complete with modules, lesson plans, quizzes, hands-on exercises, and certification criteria.


1. Introduction & Project Overview

The Training Course Builder will be a web-based application designed to streamline the creation and management of educational content. It will cater to individual educators, corporate trainers, and organizations looking to develop structured learning paths. The platform will emphasize ease of use for content creators while ensuring a rich and engaging experience for learners.

Core Objectives:

  • Provide a comprehensive suite of tools for content creation (text, multimedia, interactive elements).
  • Facilitate structured course organization (modules, lessons).
  • Integrate diverse assessment methods (quizzes, exercises).
  • Enable formal recognition of achievement (certification).
  • Offer a professional and intuitive user interface for both creators and learners.

2. Design Specifications

2.1. Core Features & Functionality

The platform will support the following key functionalities:

  • Course Management:

* Create, edit, duplicate, archive, and delete courses.

* Define course title, description, target audience, prerequisites, and learning objectives.

* Set course pricing (if applicable) and access settings (public, private, invite-only).

* Upload course thumbnail/banner image.

* Preview course as a learner.

  • Module Management:

* Create, reorder (drag-and-drop), edit, and delete modules within a course.

* Define module title and brief description.

* Set module completion criteria.

  • Lesson Plan Editor:

* Create, reorder (drag-and-drop), edit, and delete lessons within a module.

* Rich Text Editor: WYSIWYG editor for text, headings, lists, tables, quotes, code blocks.

* Multimedia Integration: Embed videos (YouTube, Vimeo, custom uploads), images, audio files.

* File Attachments: Allow uploading downloadable files (PDFs, documents, spreadsheets).

* Interactive Elements: Support for embeddable content (e.g., Google Docs, interactive simulations, external quizzes).

* Content Blocks: Ability to add various content types as distinct blocks for flexible layout and reordering.

  • Quiz Builder:

* Create multiple-choice, true/false, short answer, and matching questions.

* Add explanations/feedback for correct/incorrect answers.

* Set passing scores and attempt limits.

* Randomize question order.

* Support for question banks.

* Link quizzes to specific lessons or modules.

  • Hands-on Exercise Definition:

* Provide clear instructions and objectives for practical tasks.

* Define submission requirements (e.g., text entry, file upload, link to external project).

* Option for peer review or instructor grading.

* Provide rubrics or grading criteria.

  • Certification Criteria & Management:

* Define requirements for certification (e.g., complete all modules, pass all quizzes, submit all exercises, achieve a minimum overall score).

* Design customizable certificate templates (logo, signature, dynamic fields for learner name, course title, date).

* Automated certificate generation upon completion.

  • Learner Management (for course creators):

* Enroll/unenroll learners.

* Track learner progress (completion status, quiz scores, exercise submissions).

* Communicate with learners.

  • Reporting & Analytics (for course creators):

* Dashboard view of course performance (enrollments, completion rates, average scores).

* Detailed learner progress reports.

* Quiz performance analysis.

  • Publishing & Sharing:

* Option to publish courses to a public catalog or share via private link.

* SEO optimization for public courses.

  • Branding & Customization:

* Upload organization logo.

* Set primary brand colors for the course player interface.

2.2. Technical Considerations (High-Level)

  • Responsive Design: The platform must be fully responsive, providing an optimal experience across desktops, tablets, and mobile devices for both creators and learners.
  • Scalability: Designed to handle a growing number of courses, modules, lessons, and users without performance degradation.
  • API-First Approach: A robust API will underpin the frontend, allowing for future integrations and extensibility.
  • Security: Implement industry-standard security practices for data protection, user authentication (OAuth2, JWT), and authorization.
  • Cloud-Native: Leverage cloud services for hosting, storage, and computing to ensure reliability and scalability.

2.3. High-Level Data Model (Conceptual)

  • User: ID, Name, Email, Role (Admin, Creator, Learner)
  • Organization: ID, Name, Logo, BrandColors
  • Course: ID, OrgID, Title, Description, Objectives, Prerequisites, Thumbnail, Status (Draft, Published, Archived), Price, AccessType, CreatorID
  • Module: ID, CourseID, Title, Description, Order, CompletionCriteria
  • Lesson: ID, ModuleID, Title, Order, Type (Content, Quiz, Exercise)
  • ContentBlock: ID, LessonID, Type (Text, Image, Video, Embed, File), ContentData
  • Quiz: ID, LessonID, Title, Description, PassingScore, AttemptsAllowed, IsRandomized
  • Question: ID, QuizID, Type (MCQ, True/False, ShortAnswer, Matching), Text, Options, CorrectAnswer, Explanation
  • Exercise: ID, LessonID, Title, Description, Instructions, SubmissionType, GradingRubric
  • Certification: ID, CourseID, Title, Requirements, TemplateID, IssuedDate, LearnerID
  • LearnerProgress: ID, LearnerID, CourseID, ModuleID, LessonID, Status (Started, Completed), Score, Submission

3. Wireframe Descriptions (Key Interfaces)

The following descriptions outline the structure and key interactive elements for critical screens.

3.1. Creator Dashboard / Course Overview

  • Layout:

* Top Navigation Bar: Logo, Search, User Profile (Avatar, Logout), Notifications.

* Left Sidebar: Main navigation (Dashboard, My Courses, Learners, Reports, Settings). Active link highlighted.

* Main Content Area:

* Header: "My Courses" title, "Create New Course" primary button.

* Course Cards/List: Grid or list view of all created courses. Each card/row displays:

* Course Thumbnail/Title

* Status (Draft, Published)

* Number of Modules/Lessons

* Number of Enrolled Learners

* Last Edited Date

* Action Menu (e.g., three dots icon): Edit Course, Preview, Publish/Unpublish, Duplicate, Archive, Delete.

* Filtering/Sorting Options: Dropdowns for Status, Category, Last Edited.

3.2. Course Builder Interface (Module & Lesson Editor)

  • Layout:

* Top Navigation Bar: Course Title, "Save Draft" (secondary), "Preview" (secondary), "Publish Course" (primary), "Back to Dashboard" link.

* Left Sidebar (Course Structure Navigator):

* Course Title (draggable for reordering courses, if applicable).

* List of Modules. Each module is collapsible/expandable.

* Within each module, a list of Lessons.

* Drag-and-Drop: Modules and Lessons can be reordered by dragging.

* Add Buttons: "+ Add Module", "+ Add Lesson" (within each module).

* Context Menus (e.g., three dots icon): Edit Module/Lesson Name, Duplicate, Delete.

* Main Content Area (Lesson/Module Editor):

* Contextual Header: "Editing: [Module/Lesson Title]".

* Module Editor (if module selected): Form fields for Module Title, Description, Completion Criteria.

* Lesson Editor (if lesson selected):

* Lesson Title Field.

* Content Blocks Area: A visual representation of content blocks.

* Each block has a type icon (Text, Video, Image, Quiz, Exercise).

* Drag Handle: To reorder blocks.

* Edit Icon: To open/edit block content.

* Delete Icon.

* "+ Add Content Block" Button: Opens a modal/sidebar to select block type (Text, Video, Image, Audio, File, Quiz, Exercise, Embed).

* WYSIWYG Editor: For Text Blocks, a rich text editor appears upon selection/creation.

* Media Uploaders: For Image/Video/Audio/File blocks, appropriate upload/embed fields appear.

3.3. Quiz Builder Interface

  • Layout:

* Top Bar: Quiz Title, "Save Quiz", "Back to Lesson".

* Left Sidebar (Question Navigator): List of questions (e.g., "Question 1", "Question 2").

* Drag-and-Drop: Reorder questions.

* Add Button: "+ Add New Question".

* Context Menu: Duplicate, Delete.

* Main Content Area (Question Editor):

* Quiz Settings: Form fields for Quiz Title, Description, Passing Score, Attempts Allowed, Randomize Questions checkbox.

* Question Type Selector: Dropdown/radio buttons (Multiple Choice, True/False, Short Answer, Matching).

* Question Text Area: Rich text editor for the question prompt.

* Answer Options (based on type):

* MCQ: Input fields for options, radio button/checkbox to mark correct answer(s). "+ Add Option" button.

* True/False: Toggle switch for True/False, or radio buttons.

* Short Answer: Single text input field for expected answer(s).

* Feedback/Explanation Fields: For correct and incorrect answers.

3.4. Hands-on Exercise Editor

  • Layout: Similar top bar and left navigation as Quiz Builder.

* Main Content Area:

* Exercise Title Field.

* Description/Objectives: Rich text editor for detailed background and learning goals.

* Instructions: Rich text editor for step-by-step guidance.

* Submission Requirements:

* Dropdown: "Text Submission", "File Upload", "URL Link".

* Conditional fields based on selection (e.g., "Allowed File Types" for file upload).

* Grading Criteria/Rubric: Rich text editor or structured form to define grading points.

* Instructor Notes (optional): Private notes for the course creator.

3.5. Certification Editor

  • Layout:

* Top Bar: "Certification Settings", "Save", "Preview Certificate".

* Main Content Area:

* Certification Title.

* Requirements Definition: Checkboxes/Toggles for:

* "Complete all modules"

* "Pass all quizzes" (with option to set minimum average score)

* "Submit all exercises"

* "Achieve overall course score of X%"

* Certificate Template Selection/Customization:

* Gallery of pre-designed templates.

* Customization Panel:

* Upload Logo.

* Upload Signature Image (for instructor/organization).

* Dynamic text fields (Learner Name, Course Title, Date of Completion, Instructor Name).

* Font selection for dynamic text.

* Background color/image.

* Preview Area: Real-time rendering of the certificate with sample data.


4. Color Palette

The chosen color palette aims for professionalism, clarity, and approachability.

  • Primary Accent: #007BFF (A vibrant, professional blue for main CTAs, active states, and key branding elements.)

Usage:* Primary buttons, active navigation items, progress bars, highlights.

  • Secondary Accent: #28A745 (A calming green for success messages, completion indicators, and positive actions.)

Usage:* Success alerts, "Course Completed" badges, "Publish" button.

  • Neutral Dark (Text/Icons): #343A40 (A deep charcoal for primary text, headings, and icons, ensuring high readability.)

Usage:* All body text, headings, main icons.

  • Neutral Medium (Borders/Dividers): #CED4DA (A soft grey for borders, dividers, and subtle separators.)

Usage:* Card borders, form field borders, section dividers.

  • Neutral Light (Backgrounds): #F8F9FA (A very light grey for main backgrounds, providing a clean canvas.)

Usage:* Page backgrounds, card backgrounds, modal backgrounds.

  • Warning/Error: #DC3545 (A standard red for error messages, warnings, and destructive actions.)
gemini Output

As a professional AI assistant, I am pleased to present the detailed design specifications for the "Training Course Builder" tool. This document outlines the core functionalities, user interface layouts, aesthetic guidelines, and user experience best practices to ensure a robust, intuitive, and professional product.


Training Course Builder: Design Specifications

This document details the design specifications for the "Training Course Builder" application, providing a comprehensive blueprint for its development.

1. Detailed Design Specifications

The Training Course Builder is designed to empower users to create, manage, and publish comprehensive training courses with ease. Below are the key functional areas and their specific design considerations.

1.1. Course Management & Overview

  • Dashboard View: A central hub displaying all created courses.

* Course Cards/Table: Each course will be represented with a clear title, status (Draft, Published, Archived), creation/last modified date, and quick action buttons (Edit, Preview, Publish/Unpublish, Delete).

* Search & Filter: Functionality to quickly find courses by title, status, or category.

* "Create New Course" Button: Prominently displayed for immediate course initiation.

  • Course Settings:

* Basic Information: Fields for Course Title, Short Description, Detailed Description (rich text editor), Target Audience, Learning Objectives, Prerequisites.

* Branding & Visuals: Upload functionality for Course Thumbnail/Banner Image.

* Categorization: Dropdown or multi-select for course categories/tags.

* Visibility: Options for Public/Private access.

* Status Management: Toggle between Draft and Published.

1.2. Module & Lesson Structure Builder

  • Hierarchical Structure: A visual representation (tree view or collapsible list) of the course's modules and their nested lessons/quizzes/exercises.
  • Drag-and-Drop Reordering: Intuitive interface for reordering modules and their contents.
  • Module Management:

* Add/Edit Module: Input for Module Title, Description, and Module-specific Learning Objectives.

* Module Status: Option to publish/unpublish individual modules.

  • Content Addition: Contextual buttons within each module to "Add Lesson", "Add Quiz", or "Add Hands-on Exercise".

1.3. Lesson Plan Editor

  • Rich Text Editor (WYSIWYG): A full-featured editor supporting:

* Text formatting (bold, italics, headings, lists).

* Image and Video embedding (from URL or upload).

* Table creation.

* Code blocks (if applicable).

* Hyperlink insertion.

  • Media Integration: Dedicated sections or tools for embedding external content (e.g., YouTube, Vimeo, Google Docs).
  • Attachments: Option to upload and link downloadable files (PDFs, documents, spreadsheets).
  • Lesson Metadata: Fields for Estimated Completion Time and Specific Learning Outcomes for the lesson.

1.4. Quiz Builder

  • Question Types: Support for a variety of question formats:

* Multiple Choice (single/multiple correct answers).

* True/False.

* Short Answer (text input with optional keyword matching).

* Matching (drag-and-drop or dropdown selections).

  • Question Bank: Ability to create and manage a repository of questions, allowing reuse across multiple quizzes.
  • Quiz Settings:

* Scoring: Points per question, passing score percentage.

* Attempts: Number of allowed attempts.

* Time Limit: Optional timer for quiz completion.

* Feedback: Configurable feedback messages for correct/incorrect answers.

* Randomization: Option to randomize question order and/or answer choices.

  • Question Editor: Interface to add/edit question text, answer options, designate correct answers, and add feedback.

1.5. Hands-on Exercise Designer

  • Exercise Description: Rich text editor for detailed problem statements, objectives, and instructions.
  • Submission Methods:

* Text Input: For written responses or code snippets.

* File Upload: For submitting documents, code files, design mockups, etc.

* Integrated Code Editor (Optional but recommended): If the subject involves programming, provide a basic in-browser code editor.

  • Evaluation Criteria/Rubric: Section to define how the exercise will be graded, including specific points or qualitative criteria.
  • Example Solutions/Resources: Option to provide supplementary materials or example solutions (visible after submission/grading).

1.6. Certification Criteria & Generation

  • Completion Requirements: Define conditions for course completion and certificate eligibility:

* "All modules/lessons marked complete."

* "Achieve an average quiz score of X%."

* "Submit all required hands-on exercises."

* "Pass specific quizzes/exercises."

  • Certificate Design:

* Template Customization: Upload course-specific logos, background images.

* Dynamic Fields: Automatically populate learner's name, course title, completion date, instructor name.

* Preview: Real-time preview of the certificate design.

  • Certificate Management: Option to enable/disable certificate issuance for the course.

1.7. Preview Functionality

  • Learner View Simulation: A mode to view the course exactly as a learner would, ensuring content and flow are as intended.
  • Responsive Preview: Toggle between desktop, tablet, and mobile views.

2. Wireframe Descriptions

The following describes key screens and their layouts, focusing on primary content areas and user interactions.

2.1. Dashboard / Course List Page

  • Layout: Full-width page with a fixed header and main content area.
  • Header:

* Left: Product Logo, Navigation (e.g., Dashboard, Analytics, Settings).

* Right: User Profile/Account menu, "Create New Course" button (prominent).

  • Main Content Area:

* Course Filter/Search Bar: Above the course list.

* Course List:

* Card View (Recommended): Each card displays Course Title, Thumbnail, Status (e.g., "Draft", "Published"), Last Edited date, and an ellipsis menu (three dots) for actions (Edit, Preview, Publish/Unpublish, Delete).

* Table View (Alternative): Rows for each course with columns for Title, Status, Progress, Actions.

* Pagination: At the bottom of the list.

2.2. Course Editor Page (Overview & Settings)

  • Layout: Two-column layout with a persistent left-hand navigation sidebar and a main content area.
  • Header: Course Title (editable), Breadcrumbs (e.g., Dashboard > Course Name > Settings), "Save Draft", "Publish Course" buttons.
  • Left Sidebar Navigation:

* Course Sections: "Overview", "Modules & Lessons", "Quizzes", "Hands-on Exercises", "Certification", "Preview".

* Clear visual indicator for the active section.

  • Main Content Area (Overview Section):

* Form Fields: Course Title (large input), Description (rich text editor), Target Audience (text area), Learning Objectives (bulleted list input), Prerequisites (text area).

* Image Upload: Drag-and-drop or click-to-upload area for Course Thumbnail/Banner.

* Save/Cancel Buttons: At the bottom.

2.3. Module & Lesson Structure Page

  • Layout: Same two-column layout as Course Editor.
  • Header: Course Title, Breadcrumbs, "Save Draft", "Publish Course" buttons.
  • Left Sidebar Navigation: Course sections (as above).
  • Main Content Area:

* "Add New Module" Button: Prominently displayed at the top or bottom.

* Module List:

* Each Module: Collapsible panel/card with Module Title.

* Inside each Module: List of Lessons, Quizzes, Exercises.

* Drag Handle: Icon next to each item (module, lesson, quiz, exercise) for reordering.

* Action Buttons (per item): Edit (pencil icon), Delete (trash icon), Preview (eye icon).

* "Add Lesson", "Add Quiz", "Add Exercise" Buttons: Within each module panel.

* Clear visual distinction between module, lesson, quiz, and exercise items (e.g., different icons).

2.4. Lesson Plan Editor Page

  • Layout: Focused single-column content area, potentially with a minimal header.
  • Header: Lesson Title, Breadcrumbs (e.g., Course > Module > Lesson Name), "Save", "Cancel", "Preview" buttons.
  • Main Content Area:

* Lesson Title Field: At the top.

* Rich Text Editor: Large, central area for lesson content.

* Sections Below Editor:

* "Learning Outcomes": Bulleted list input.

* "Estimated Time": Numeric input with units (e.g., minutes, hours).

* "Attachments": File upload area with list of uploaded files and delete option.

* Footer: "Save Lesson", "Cancel" buttons.

2.5. Quiz Builder Page

  • Layout: Two-column layout for question list and question editor.
  • Header: Quiz Title, Breadcrumbs, "Save Quiz", "Cancel", "Preview" buttons.
  • Left Column (Question List):

* "Add New Question" button.

* List of questions: Each item shows question number, type, and a snippet of the question text. Click to edit.

* Drag handles for reordering questions.

  • Right Column (Question Editor & Quiz Settings):

* Question Editor (when a question is selected):

* Dropdown for "Question Type".

* Rich text editor for "Question Text".

* Input fields/checkboxes for "Answer Options" (dynamic based on question type).

* "Correct Answer" indicator.

* "Feedback for Correct/Incorrect Answer" (text areas).

* "Points" input.

* Quiz Settings (collapsible section or separate tab):

* Inputs for "Passing Score", "Number of Attempts", "Time Limit".

* Checkboxes for "Randomize Questions", "Shuffle Answer Choices".

* "Save Question", "Delete Question" Buttons: For the currently edited question.

3. Color Palettes

A professional, clean

gemini Output

Finalized Design Assets: Training Course Presentation

This document outlines the detailed design specifications, wireframe descriptions, color palettes, and user experience (UX) recommendations for presenting the generated training course content to learners. The objective is to create an intuitive, engaging, and professional learning environment that maximizes content absorption and learner satisfaction.


1. Overall Design Principles

The design of the training course presentation will adhere to the following core principles:

  • Clarity & Simplicity: Prioritize content readability and straightforward navigation to reduce cognitive load.
  • Consistency: Maintain a uniform visual language, layout, and interaction patterns across all course modules and lessons.
  • Engagement: Incorporate visually appealing elements, interactive components, and clear progress indicators to keep learners motivated.
  • Accessibility: Design for inclusivity, ensuring all users, including those with disabilities, can effectively access and interact with the content.
  • Responsiveness: Guarantee optimal viewing and interaction experiences across a variety of devices, from desktops to mobile phones.

2. Detailed Design Specifications

This section details the specific components and their characteristics within the course presentation interface.

A. Course Structure & Navigation

  • Course Dashboard / Overview Page:

* Prominent Course Title, brief description, and instructor information.

* Overall Course Progress Bar (e.g., X% complete) with a visual representation.

* Cards or list view of all Modules, each indicating status (Not Started, In Progress, Completed).

* "Continue Learning" button linking directly to the next uncompleted lesson.

* Clear link/status for Certification.

  • Module Page:

* Module Title and a concise description of its learning objectives.

* Module-specific Progress Bar.

* List of Lessons within the module, each with an individual status indicator (e.g., icon, color).

* Direct links to any associated quizzes or hands-on exercises for the module.

  • Lesson Page:

* Clear Lesson Title at the top of the content area.

* Primary content area supporting rich text, images, embedded videos, and interactive elements.

* "Previous Lesson" and "Next Lesson" navigation buttons, clearly visible at the bottom.

* An optional "Mark as Complete" button if manual completion tracking is desired.

* A dedicated section for supplementary materials (e.g., downloadable PDFs, external links) in an accordion or collapsible format.

* (Optional) Integrated discussion forum or comment section for learner interaction.

  • Quiz Page:

* Quiz Title, clear instructions, and any applicable time limits.

* Question area with distinct presentation for different question types (multiple choice, true/false, short answer, etc.).

* Visual progress indicator (e.g., "Question X of Y").

* "Submit Answer" or "Next Question" buttons.

* A summary or results page after quiz submission, providing feedback and scores.

  • Hands-on Exercise Page:

* Exercise Title, detailed instructions, and learning objectives.

* Scenario or problem description.

* List of required resources, tools, or software.

* Submission area (e.g., text input, file upload) or guided steps for external activities.

* (Optional) Rubric or evaluation criteria for clarity.

  • Certification Criteria & Download Page:

* Clearly articulated requirements for earning certification.

* Real-time progress tracker towards meeting certification criteria.

* Prominent button to download the certificate upon successful completion.

B. Typography

  • Headings (H1, H2, H3): A clean, modern sans-serif font (e.
training_course_builder.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);}});}