Training Course Builder
Run ID: 69cbd83961b1021a29a8cd432026-03-31Education
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 design specifications, wireframe descriptions, color palettes, and user experience (UX) recommendations for the "Training Course Builder" platform. The goal is to create a robust, intuitive, and highly functional tool that empowers users to build comprehensive training courses for any subject with ease and efficiency.


1. Design Specifications

The Training Course Builder will be a web-based application designed to facilitate the end-to-end creation, management, and publishing of online training courses.

1.1 Core Functionality Requirements:

  • Course Structure Definition:

* Ability to define hierarchical course structures: Course > Modules > Lessons > Topics.

* Drag-and-drop interface for reordering modules, lessons, and topics.

* Settings for module/lesson descriptions, objectives, and prerequisites.

  • Content Creation & Management:

* Rich Text Editor (WYSIWYG): For lesson text, descriptions, instructions.

* Media Integration: Upload and embed images, videos (MP4, YouTube, Vimeo), audio, and external documents (PDF, PPT).

* Interactive Content Components: Embed polls, surveys, and interactive simulations.

* Code Snippet Support: Syntax highlighting for various programming languages.

* Version Control: Track changes and allow rollback to previous drafts of content.

  • Quiz Builder:

* Support for various question types:

* Multiple Choice (single/multiple select)

* True/False

* Short Answer / Essay

* Drag-and-Drop (matching, ordering)

* Fill-in-the-Blanks

* Ability to set correct answers, points, and provide immediate feedback/explanations.

* Question banks for reusability across courses.

* Randomization of questions and answer options.

  • Hands-on Exercise Builder:

* Problem Description Interface: Rich text editor for exercise instructions.

* Input/Output Fields: Define expected inputs and outputs for coding exercises.

* Integrated Code Editor: Support for multiple programming languages with syntax highlighting and basic execution environment (optional, for advanced scenarios).

* File Upload/Submission: For project-based exercises.

* Scenario-Based Simulations: Framework for creating interactive scenarios (e.g., branching narratives, virtual labs).

* Automated Grading/Validation: For specific exercise types (e.g., unit tests for code).

  • Certification Criteria & Management:

* Define course completion requirements (e.g., 100% module completion, minimum quiz scores, exercise submission).

* Customizable digital certificate templates with dynamic fields (student name, course title, date).

* Automatic certificate generation upon successful completion.

  • User & Role Management:

* Admin: Full control over platform, users, courses.

* Instructor/Course Creator: Create, edit, publish courses; manage students enrolled in their courses.

* Student: Access enrolled courses, track progress, complete assignments.

  • Preview & Publishing:

* Real-time preview mode to view the course from a student's perspective.

* Export options: SCORM 1.2/2004, xAPI, PDF, HTML5 package.

* Direct publishing to an integrated Learning Management System (LMS) or a standalone course portal.

  • Analytics & Reporting:

* Course completion rates.

* Student progress tracking (per module/lesson).

* Quiz performance reports (average scores, common incorrect answers).

* Exercise submission and grading status.

  • Collaboration Features:

* Ability to share course drafts with collaborators for review and co-editing.

* Comment functionality for feedback on specific course elements.

  • Templating System:

* Pre-designed course templates for common structures (e.g., compliance training, software tutorials).

* Ability to save custom course structures as templates.

1.2 Technical Requirements:

  • Architecture: Scalable, cloud-native architecture (e.g., microservices) to handle varying loads and ensure high availability.
  • Database: PostgreSQL for relational data (course structure, user data) and potentially MongoDB/NoSQL for content blocks for flexibility.
  • API: RESTful API for seamless integration with external systems (LMS, CRM, analytics tools).
  • Security:

* Robust authentication (OAuth2, JWT) and authorization (role-based access control).

* Data encryption at rest and in transit (SSL/TLS).

* Regular security audits and penetration testing.

  • Performance: Optimized for fast loading times, responsive interactions, and efficient content delivery.
  • Browser Compatibility: Full support for modern web browsers (Chrome, Firefox, Safari, Edge).
  • Accessibility: Adherence to WCAG 2.1 AA standards for inclusive design.
  • Localization: Support for multiple languages (optional, for future expansion).

2. Wireframe Descriptions

The following descriptions outline the key screens and their primary components, serving as blueprints for the wireframing process.

2.1 Dashboard (Course Creator Home)

  • Layout: Two-column layout.

* Left Sidebar: Main navigation (Dashboard, Create New Course, My Courses, Templates, Analytics, Settings).

* Main Content Area:

* "Create New Course" CTA: Prominent button to start a new course.

* "My Courses" Section: Card-based display of active courses (title, status: Draft/Published, progress bar, quick edit/preview actions).

* "Recent Activity" Feed: Shows latest edits, student enrollments, or course performance summaries.

* "Templates" Showcase: Quick access to popular or custom templates.

* "Quick Links": To documentation, support, tutorials.

2.2 Course Editor (Main Workspace)

  • Layout: Three-column layout, highly interactive.

* Left Sidebar (Course Outline): Tree-view navigation of Course > Modules > Lessons > Topics. Drag-and-drop functionality for reordering. Add/delete buttons for each level.

* Central Content Area (Editor Panel):

* Contextual editor based on selected item in the outline (Module, Lesson, Quiz, Exercise).

* Lesson Editor: WYSIWYG rich text editor, media upload/embed tools, content block insertion (text, image, video, quiz, exercise).

* Quiz Editor: Question type selector, question input field, answer options (add/remove), correct answer selection, feedback fields, point value setter.

* Exercise Editor: Problem description field, input/output definition, code editor integration, file upload configuration.

* Right Sidebar (Properties Panel):

* Contextual settings for the currently selected element (e.g., Module settings: title, description, objectives, prerequisites; Lesson settings: learning outcomes, duration; Quiz settings: passing score, time limit; Course settings: title, description, category, certification criteria, publishing options).

* Preview button to instantly see how the current element looks.

2.3 Quiz Builder Screen

  • Layout: Focused on question creation.

* Top Bar: Quiz title, total points, settings (time limit, passing score).

* Left Panel: List of questions in the quiz (draggable to reorder). Add New Question button.

* Main Content Area:

* Question Type Selector: Dropdown/buttons for Multiple Choice, True/False, Short Answer, etc.

* Question Text Editor: Rich text field.

* Answer Options: Dynamic list of input fields with radio buttons/checkboxes for correct answer selection. Add/Remove option buttons.

* Feedback Fields: For correct/incorrect answers.

* Point Value Input.

* Media Upload: For images/videos related to the question.

* Bottom Bar: Save Question, Delete Question, Preview Quiz.

2.4 Hands-on Exercise Builder Screen

  • Layout: Designed for structured problem definition.

* Top Bar: Exercise title, associated lesson, settings (grading method, submission type).

* Left Panel: Exercise details (description, objectives, resources).

* Main Content Area:

* Problem Description Editor: Rich text editor for detailed instructions and context.

* File/Resource Upload: For starter code, data files, reference materials.

* Solution Requirements: Input fields for expected output, test cases, or rubric definition.

* Integrated Code Editor (Optional): Pre-populated with boilerplate code, language selection.

* Submission Settings: File types allowed, maximum file size, number of attempts.

* Bottom Bar: Save Exercise, Preview Exercise.

2.5 Certification Settings Screen

  • Layout: Form-based for defining criteria and template.

* Top Bar: Course title, save/publish actions.

* Main Content Area:

* Completion Criteria Section: Checkboxes/input fields for:

* "Complete all modules"

* "Achieve X% on all quizzes"

* "Submit all exercises"

* "Achieve X% overall score"

* "Pass final assessment"

* Certificate Design Section:

* Template selector (pre-defined templates).

* Customization options: logo upload, background image, font selection, color picker.

* Dynamic text fields (student name, course name, completion date, instructor signature).

* Preview of the certificate.

* Certificate Generation Settings: Automatic/Manual, Expiry Date (optional).


3. Color Palettes

A professional, clean, and engaging color palette will be used to ensure clarity and user comfort.

3.1 Primary Palette:

  • Primary Brand Color: #0056B3 (Deep Professional Blue) - For headers, main navigation, primary buttons, branding elements. Conveys trust, stability, and professionalism.
  • Secondary Brand Color: #34A853 (Vibrant Green) - For success messages, positive indicators, and secondary calls to action. Suggests growth and completion.

3.2 Accent & Interactive Palette:

  • Accent Color: #FFC107 (Amber/Gold) - For interactive elements, highlights, warnings, and elements requiring user attention. Creates visual pop.
  • Interactive Hover/Active: #004085 (Darker Blue) - A slightly darker shade of the primary blue for hover states on primary buttons and links.
  • Link Color: #007BFF (Standard Blue) - For clickable text links.

3.3 Neutral Palette:

  • Background (Light): #F8F9FA (Off-White/Light Gray) - For main content areas and overall page backgrounds. Provides a clean, spacious feel.
  • Background (Darker): #E9ECEF (Light Gray) - For sidebars, card backgrounds, or subtle section dividers.
  • Text (Primary): #212529 (Dark Gray) - For body text, ensuring high readability.
  • Text (Secondary/Muted): #6C757D (Medium Gray) - For less prominent text, labels, hints.
  • Borders/Dividers: #DEE2E6 (Light Border Gray) - For subtle separation of elements.

3.4 Semantic Colors:

  • Success: #28A745 (Green) - For successful actions, completion.
  • Warning: #FFC107 (Amber) - For warnings, attention required.
  • Error: #DC3545 (Red) - For error messages, critical issues.
  • Info: #17A2B8 (Cyan) - For informational messages.

3.5 Font Selection:

  • Primary Font: Inter or Open Sans - Clean, modern sans-serif fonts for excellent readability across all screen sizes.
  • Secondary Font: (Optional) A slightly more distinctive font for headings, if desired, but generally maintaining a sans-serif for consistency.

4. UX Recommendations

User experience is paramount for a complex tool like a course builder. The following recommendations focus on intuitiveness, efficiency, and accessibility.

4.1 User-Centric Design Principles:

  • Clarity over Complexity: Prioritize clear labeling, intuitive iconography, and direct language. Avoid jargon where possible.
  • Consistency: Maintain consistent UI elements, interaction patterns, and terminology across the entire platform. This reduces cognitive load and improves learnability.
  • Feedback & Confirmation: Provide immediate visual feedback for user actions (e.g., loading spinners, success toasts, error messages, button state
gemini Output

Training Course Builder: Design Specifications

This document outlines the detailed design specifications for the "Training Course Builder" platform. The goal is to create an intuitive, powerful, and professional tool that empowers users to effortlessly design, build, and deploy comprehensive training courses.


1. Overall Design Philosophy & Principles

The design of the Training Course Builder will adhere to the following core principles:

  • User-Centric & Intuitive: Prioritize ease of use, clear navigation, and minimal cognitive load for course creators. The interface should guide users naturally through the course creation process.
  • Efficiency & Productivity: Streamline workflows with features like drag-and-drop, templating, and real-time feedback to maximize creator productivity.
  • Professional & Modern Aesthetic: Employ a clean, contemporary visual design that reflects professionalism and trustworthiness, aligning with educational and corporate training standards.
  • Scalability & Flexibility: Design for future enhancements, allowing for new content types, collaboration features, and integration points without requiring significant re-architecture.
  • Consistency: Maintain a consistent visual language, interaction patterns, and terminology across the entire platform.
  • Accessibility First: Ensure the platform is usable by individuals with diverse abilities, adhering to WCAG 2.1 AA standards.

2. High-Level User Flows

A. Course Creation Workflow:

  1. Login/Dashboard Access: User logs in and lands on the "My Courses" dashboard.
  2. Initiate New Course: User clicks "Create New Course."
  3. Basic Course Setup: User inputs Course Title, Description, Category, and selects initial template (optional).
  4. Module & Lesson Structure: User adds modules and lessons, defining the course hierarchy using drag-and-drop.
  5. Content Development: For each lesson, the user selects a content type (Text/Media, Quiz, Hands-on Exercise) and uses the respective builder.
  6. Certification Definition: User configures completion criteria and designs the certificate.
  7. Preview & Review: User previews the entire course from a learner's perspective.
  8. Publishing: User sets publishing options (public/private, pricing, availability) and publishes the course.

B. Course Editing Workflow:

  1. Dashboard Access: User navigates to "My Courses."
  2. Select Course: User selects an existing course from the list/cards.
  3. Enter Editor: User clicks "Edit" to open the Course Editor.
  4. Modify Content: User navigates to specific modules/lessons to edit content, quizzes, exercises, or certification criteria.
  5. Save & Update: Changes are auto-saved or manually saved.
  6. Re-publish (if needed): User can re-publish updates to active courses.

3. Key Features & Functionality (Mapped to UI)

  • Course Management:

* UI: "My Courses" Dashboard.

* Functionality: Create, edit, duplicate, archive, delete courses. View course status (Draft, Published, Archived). Search and filter courses.

  • Module & Lesson Management:

* UI: Left sidebar of the Course Editor (tree view).

* Functionality: Add new modules/lessons. Drag-and-drop reordering of modules and lessons. Rename, duplicate, delete modules/lessons. Set module/lesson prerequisites (future).

  • Rich Content Editor (Lesson Type: Text/Media):

* UI: Main content area of the Lesson Editor.

* Functionality: WYSIWYG editor with standard formatting (headings, bold, italic, lists, links, quotes). Embed images, videos (from URL/upload), audio. Insert code blocks (syntax highlighting). Attach downloadable files.

  • Quiz Builder (Lesson Type: Quiz):

* UI: Main content area of the Quiz Editor.

* Functionality: Create various question types: Multiple Choice (single/multiple answer), True/False, Short Answer, Fill-in-the-Blank. Add question text, options, correct answers, explanations. Set point values per question. Configure quiz settings: pass score, time limit, question randomization, attempt limits, immediate feedback.

  • Hands-on Exercise Builder (Lesson Type: Hands-on Exercise):

* UI: Main content area of the Exercise Editor.

* Functionality: Rich text editor for detailed instructions and descriptions. Fields for "Expected Outcomes" and "Evaluation Criteria." Define submission type: Free text, File upload, Code editor integration (optional, for coding courses). Configure review options: Peer review, Mentor review.

  • Certification Criteria & Design:

* UI: Dedicated "Certification" tab/section within Course Editor.

* Functionality: Define completion rules (e.g., "Complete all lessons," "Achieve X% on all quizzes," "Pass all hands-on exercises"). Select from certificate templates. Customize certificate design (add logo, dynamic fields for learner name, course title, completion date, instructor signature). Preview certificate.

  • Course Preview:

* UI: "Preview" button accessible from any editor screen, leading to a dedicated preview mode.

* Functionality: View the entire course as a learner would, navigating through modules and lessons. Test quizzes and exercises.

  • Publishing & Settings:

* UI: "Publish" button, leading to a "Publish Settings" modal/screen.

* Functionality: Set course status (Draft, Published, Archived). Define target audience, categories, tags. Configure pricing (free/paid). Add course thumbnail.


4. Wireframe Descriptions (Main Screens)

4.1. Dashboard: My Courses

  • Layout:

* Left Sidebar Navigation: Fixed, narrow sidebar with primary navigation icons: Dashboard (active), My Courses, Settings, Help. User profile/logout at the bottom.

* Header: Top bar with platform logo, search bar, "Create New Course" button (primary action).

* Main Content Area:

* Course Cards/List: Dominant display area showing existing courses. Each card/row will include:

* Course Title & Thumbnail

* Status (e.g., "Draft," "Published," "Archived")

* Last Edited Date

* Progress Bar (if applicable, for courses in progress or draft completion)

* Action Buttons: Edit, Preview, Publish/Unpublish, Duplicate, Delete (via ellipsis menu).

* Filters & Sort: Above the course list, provide filters for Status, Category, and a Sort By option.

  • Interactions: Click on a course card/row to view details or Edit to enter the Course Editor.

4.2. Course Editor: Structure & Settings

  • Layout:

* Top Bar: Course Title (editable), Save (auto-save indication), Preview, Publish buttons.

* Left Sidebar (Course Structure):

* Hierarchical tree view of Modules and Lessons.

* Add Module button at the top of the sidebar.

* Each module item: Module Title, Add Lesson button (on hover/click).

* Each lesson item: Lesson Title, Icon indicating content type (Text, Quiz, Exercise).

* Drag-and-drop functionality for reordering modules and lessons.

* Context menu (right-click or ellipsis icon) for Edit, Duplicate, Delete on modules/lessons.

* Main Content Area:

* Initially, a placeholder for "Course Settings" (Course Title, Description, Category, Thumbnail, Pricing options).

* When a module or lesson is selected from the left sidebar, this area will dynamically load the specific editor for that item (e.g., Rich Content Editor, Quiz Builder).

  • Interactions: Selecting an item in the left sidebar populates the main content area with its relevant editor.

4.3. Lesson Editor: Rich Content

  • Layout:

* Top Bar: Lesson Title (editable), Save (auto-save indication), Preview buttons.

* Main Content Area:

* WYSIWYG Editor: Large, central area for content creation.

* Toolbar: Standard rich text editor toolbar (bold, italic, underline, headings, lists, links, clear formatting, undo/redo).

* Media/Embed Tools: Dedicated buttons for Image, Video, Audio, Code Block, File Attachment.

* Right Sidebar (Lesson Settings):

* Fields for Estimated Time to Complete, Tags, Prerequisites (if enabled), Visibility (e.g., public/private within course).

  • Interactions: Standard text editing and media embedding. Drag-and-drop for images directly into the editor.

4.4. Quiz Builder

  • Layout:

* Top Bar: Quiz Title (editable), Save (auto-save indication), Preview buttons.

* Main Content Area:

* Question List: A scrollable list of individual question blocks.

* Add Question button (prominent, at the bottom or top of the list).

* Each Question Block:

* Question Number.

* Dropdown for Question Type (Multiple Choice, True/False, Short Answer, Fill-in-the-Blank).

* Text area for Question Text.

* Input fields/checkboxes for Options/Answers based on question type.

* Correct Answer indicator (radio button, checkbox, text input).

* Explanation field (optional, shown after answer).

* Point Value input.

* Duplicate, Delete icons for the question.

* Drag handle for reordering questions.

* Right Sidebar (Quiz Settings):

* Pass Score (%)

* Time Limit (minutes, optional)

* Number of Attempts

* Randomize Question Order (toggle)

* Show Correct Answers After Submission (toggle)

* Provide Feedback (toggle)

  • Interactions: Adding new questions expands the list. Selecting a question type changes the input fields. Drag-and-drop to reorder questions.

4.5. Hands-on Exercise Builder

  • Layout:

* Top Bar:

gemini Output

This document outlines the detailed design specifications, wireframe descriptions, color palette, and user experience (UX) recommendations for the "Training Course Builder" platform. The goal is to create an intuitive, efficient, and professional tool that empowers course creators to build high-quality training content with ease.

1. Design Philosophy & Goals

Our core philosophy is to simplify complex course creation processes, providing a seamless and enjoyable experience for educators and trainers.

Key Goals:

  • Empowerment: Provide robust tools that give creators full control over their content.
  • Intuitiveness: Design a user interface that is easy to learn and navigate, minimizing cognitive load.
  • Efficiency: Streamline workflows, reduce clicks, and offer intelligent defaults to speed up course development.
  • Professionalism: Ensure the output courses look polished and engaging for learners.
  • Flexibility: Accommodate a wide range of course types, subjects, and instructional designs.

2. Target Audience

The Training Course Builder is designed for:

  • Subject Matter Experts (SMEs): Individuals with deep knowledge in a specific field who want to share their expertise.
  • Educators & Trainers: Professionals creating academic courses, corporate training modules, or workshops.
  • Learning & Development (L&D) Teams: Organizations looking to rapidly develop and deploy internal training programs.
  • HR Professionals: Building onboarding or compliance training.

Users may have varying levels of technical proficiency, so clarity, consistency, and simplicity are paramount.

3. Core Design Principles

  • Clarity: Information is presented in a straightforward, unambiguous manner.
  • Consistency: Predictable interactions, visual elements, and terminology across the platform.
  • Feedback: Users are always informed about the system's status, actions, and potential issues.
  • Control: Users feel in charge of their content and the creation process.
  • Aesthetics: A clean, modern, and inviting visual design that supports usability.

4. Wireframe Descriptions

The following wireframes describe the key screens and their functionalities.

4.1. Dashboard / Course Overview

  • Purpose: The central hub for managing all created courses.
  • Layout:

* Header (Top Bar):

* Left: Product Logo, Global Search Bar.

* Right: User Profile/Avatar (with dropdown for settings, logout), "Create New Course"

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