Training Course Builder
Run ID: 69cb67a461b1021a29a88bbc2026-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.

Step 1: Research & Design Requirements - Training Course Builder

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 an intuitive, powerful, and engaging platform that allows instructors and administrators to build comprehensive training courses and learners to consume them effectively.


1. Overall Goal & Scope

The primary objective of this step is to lay the foundational design and functional requirements for a robust Training Course Builder. This platform will enable the creation of multi-faceted courses, including structured modules, detailed lesson plans, interactive quizzes, practical hands-on exercises, and clear certification criteria. The design prioritizes ease of use for content creators and an engaging, clear learning experience for students.


2. Detailed Design Specifications

2.1. User Roles & Permissions

  • Administrator/Instructor (Content Creator):

* Create, edit, delete courses, modules, lessons, quizzes, exercises, and certification criteria.

* Manage course settings (enrollment, prerequisites, access).

* Review and grade hands-on exercise submissions.

* Monitor learner progress and performance.

* Issue and manage certifications.

* Manage user accounts (enrollment, roles).

* Access analytics and reporting.

  • Learner (Student):

* Browse and enroll in available courses.

* Access course content (lessons, quizzes, exercises).

* Track personal progress within courses.

* Submit hands-on exercises.

* Attempt quizzes and view results.

* Receive certifications upon completion.

* View course announcements and communicate with instructors.

2.2. Core Functionality Requirements

  • Course Management:

* Create new courses with title, description, cover image, category, and tags.

* Set course pricing, enrollment methods (open, invitation-only, paid).

* Define course prerequisites.

* Publish/unpublish courses.

* Duplicate existing courses.

  • Module & Lesson Builder:

* Drag-and-drop interface for ordering modules and lessons.

* Rich text editor for lesson content (text, images, embedded videos, audio, external links).

* Support for various content types within lessons (PDFs, presentations, code snippets).

* Ability to mark lessons as optional or mandatory.

* Set estimated time for lesson completion.

* Preview functionality for lessons.

  • Quiz Builder:

* Support for multiple question types: Multiple Choice (single/multiple answer), True/False, Short Answer, Matching, Fill-in-the-Blank.

* Ability to add images/media to questions and answers.

* Set point values per question.

* Configure quiz settings: time limits, number of attempts, immediate feedback, answer explanations, question randomization.

* Automated grading for objective questions.

  • Hands-on Exercise Builder:

* Rich text editor for exercise instructions, problem statements, and requirements.

* Ability to attach starter files, templates, or reference materials.

* Define submission requirements (file upload, text input, code repository link).

* Provide grading rubrics or criteria.

* Support for peer review (optional).

* Instructor feedback and grading interface.

  • Certification Criteria & Management:

* Define criteria for certification (e.g., complete all modules, pass all quizzes with 80%, submit all exercises).

* Design customizable certificate templates (logo, learner name, course name, date, instructor signature).

* Automated certificate generation and distribution upon criteria fulfillment.

* Certificate verification mechanism (e.g., unique ID).

  • Progress Tracking:

* Visual progress bars for courses and individual modules/lessons.

* Completion status for each lesson, quiz, and exercise.

* Score tracking for quizzes and graded exercises.

* Detailed progress reports for instructors.

  • Communication & Collaboration:

* Announcement feature for instructors.

* Discussion forums or Q&A sections per course/lesson.

* Direct messaging between learners and instructors (optional).

  • Analytics & Reporting (Instructor/Admin):

* Course enrollment numbers.

* Learner completion rates.

* Average quiz scores.

* Time spent on course content (aggregated).

* Performance metrics for individual learners.

2.3. Non-Functional Requirements

  • Performance: Fast loading times for all pages and content. Efficient handling of media uploads and large numbers of users.
  • Scalability: Architecture designed to accommodate a growing number of courses, learners, and content.
  • Security: Robust user authentication (e.g., OAuth, SSO), data encryption, protection against common web vulnerabilities (XSS, CSRF). Role-based access control.
  • Accessibility: WCAG 2.1 AA compliance (keyboard navigation, screen reader compatibility, sufficient color contrast, alt text for images).
  • Responsiveness: Fully optimized for various devices (desktop, tablet, mobile) with adaptive layouts.
  • Usability: Intuitive interface, clear navigation, consistent design language across the platform.
  • Maintainability: Clean, modular code for easy updates and feature additions.

3. Wireframe Descriptions (Key Screens)

The following descriptions outline the essential elements and layout for critical screens within the platform.

3.1. Instructor/Admin Dashboard

  • Layout: Two-column layout. Left sidebar for primary navigation (Courses, Users, Analytics, Settings). Main content area for overview.
  • Components:

* Header: Logo, User profile (avatar, name, dropdown for logout/settings), "Create New Course" button.

* Sidebar Navigation: Links to "My Courses," "Learners," "Analytics," "Settings," "Help."

* Main Content Area:

* Course Overview Cards: Each card represents a course, showing title, cover image, number of enrolled learners, completion rate, quick links to "Edit Course," "View Learners," "View Analytics."

* Quick Stats: Widgets showing "Total Learners," "Courses Published," "Pending Submissions," "Recent Activity."

* Recent Activity Feed: List of recent learner enrollments, quiz completions, exercise submissions.

3.2. Learner Dashboard

  • Layout: Similar two-column layout. Left sidebar for primary navigation.
  • Components:

* Header: Logo, User profile, Search bar (for courses).

* Sidebar Navigation: Links to "My Courses," "Browse Courses," "Certifications," "Account Settings," "Help."

* Main Content Area:

* "My Courses" Section: Cards for enrolled courses. Each card shows course title, cover image, instructor, prominent progress bar, and a "Continue Learning" button.

* "Recommended Courses" / "New Courses" Section: Carousel or grid of suggested courses based on learner's interests or popular choices.

* "Upcoming Deadlines/Events" Widget: Alerts for quiz due dates, exercise submissions.

3.3. Course Creation/Editing Interface

  • Layout: Multi-step form or tabbed interface. Left sidebar for course structure (Modules, Lessons, Quizzes, Exercises, Certification). Right main area for editing selected component.
  • Components:

* Header: "Course Title," "Save Draft," "Publish Course" buttons, "Preview Course."

* Left Navigation (Course Structure):

* Hierarchical list: Course Title > Module 1 > Lesson 1.1, Quiz 1.2, Exercise 1.3 > Module 2, etc.

* Drag-and-drop handles for reordering.

* Add Module / Add Lesson / Add Quiz / Add Exercise buttons.

* Main Content Area (Contextual Editor):

* Course Settings Tab: Fields for Course Title, Description, Cover Image Upload, Category, Tags, Price, Prerequisites.

* Module Editor: Module Title, Description.

* Lesson Editor: Rich Text Editor (WYSIWYG) for content, media upload options, estimated time field.

* Quiz Builder: Question list. For each question: Question type selector, rich text editor for question, answer options fields (with add/remove), correct answer selection, point value, feedback fields. "Add Question" button.

* Exercise Builder: Rich text editor for instructions, file upload for starter files, submission type selector, rubric/grading criteria editor.

* Certification Editor: Checkbox list for completion criteria, Certificate Template Designer (drag-and-drop elements like logo, text fields for name/course/date).

3.4. Lesson View (Learner)

  • Layout: Two-column layout. Left sidebar for course navigation (Module/Lesson list). Main area for lesson content.
  • Components:

* Header: Course Title, "Back to Course" link, User Profile.

* Left Course Navigation: Collapsible modules, clickable lessons, visual indicator for completed/current lesson.

* Main Content Area:

* Lesson Title: Prominent.

* Lesson Content: Rich text, embedded media (videos, images), downloadable files.

* "Mark as Complete" Button / Auto-complete: At the bottom.

* Navigation Buttons: "Previous Lesson," "Next Lesson."

* Discussion Section (optional): Comment box and previous comments.

3.5. Quiz Attempt (Learner)

  • Layout: Single-column, focused view to minimize distractions.
  • Components:

* Header: Course Title, Quiz Title, Timer (if applicable).

* Question Area: Question number, Question text/media, Answer options (radio buttons/checkboxes/text fields).

* Navigation: "Previous Question," "Next Question," "Review Quiz" button.

* Progress Indicator: Small dots or numbers indicating current question out of total.

* "Submit Quiz" Button: Prominent at the end.


4. Color Palettes

The color palette aims for professionalism, clarity, and an engaging user experience, while ensuring accessibility.

  • Primary Brand Color: #007BFF (A vibrant, professional blue)

Usage:* Buttons (primary actions), active navigation links, progress bars, key icons, brand elements.

Rationale:* Conveys trustworthiness, stability, and intelligence, common in educational and corporate platforms.

  • Secondary Accent Color: #28A745 (A clear, positive green)

Usage:* Success messages, completion indicators, "Enroll" buttons, positive feedback.

Rationale:* Represents success, completion, and positive reinforcement.

  • Tertiary Accent Color: #FFC107 (A warm, inviting yellow/orange)

Usage:* Warning messages, highlights, call-to-action elements for new features or attention.

Rationale:* Adds warmth and can draw attention to important, but not critical, information.

  • Neutral Palette:

* Dark Text / Backgrounds: #343A40 (Dark charcoal grey)

Usage:* Main body text, headings, primary background for some sections.

Rationale:* Excellent readability, professional.

* Light Backgrounds: #F8F9FA (Off-white / Light grey)

Usage:* Main content areas, cards, general page backgrounds.

Rationale:* Provides a clean, spacious feel and good contrast for text.

* Borders / Dividers: #DEE2E6 (Light grey)

Usage:* Separators, card borders, form field outlines.

Rationale:* Subtle separation without being distracting.

  • Status Colors:

* Success: #28A745 (Green - same as secondary accent)

* Warning: #FFC107 (Yellow/Orange - same as tertiary accent)

* Danger/Error: #DC3545 (Red)

* Info: #17A2B8 (Cyan)


5. UX Recommendations

5.1. Intuitive Navigation & Information Architecture

  • Clear Hierarchy: Use breadcrumbs for deep navigation (e.g., Course > Module > Lesson).
  • Consistent Placement: Ensure navigation elements, action buttons, and user profile options are always in predictable locations.
  • Minimizing Clicks: Streamline workflows, especially for content creation, by reducing the number of clicks required to complete common tasks.
  • Search Functionality: Implement a robust search for courses, lessons, and potentially content within lessons.

5.2. Feedback & Guidance

  • Immediate Visual Feedback: Provide instant feedback for actions (e.g., "Saved" message after editing, loading spinners for background processes).
  • Error Handling: Clear, user-friendly error messages that explain the issue and suggest solutions, rather than technical jargon.
  • Onboarding & Tooltips: Offer optional guided tours for new users and contextual tooltips for complex features in the content builder.
  • Progress Indicators: Always show learners where they are in a course and how much they have completed.

5.3. Consistency & Predictability

  • Design System: Adhere strictly to a defined design system (colors, typography, spacing, component styles) to ensure a cohesive experience across the platform.
  • Interaction Patterns: Use consistent interaction patterns for similar actions (e.g., all "Add New" buttons behave similarly).
  • Terminology: Maintain consistent terminology throughout the platform (e.g., always "Module," not sometimes "Section").

5.4. Accessibility (WCAG 2.1 AA)

  • Keyboard Navigation: Ensure all interactive elements are reachable and operable via keyboard.
  • Screen Reader Compatibility: Use proper semantic HTML, ARIA attributes, and provide alt text for all meaningful images.
  • Color Contrast: Maintain sufficient contrast ratios for text and interactive elements against their backgrounds.
  • Resizable Text: Allow users to adjust text size without loss of functionality or content.
  • Focus Indicators: Provide clear visual focus indicators for keyboard users.

5.5. Mobile Responsiveness

  • Fluid Grids & Flexible Images: Design layouts that adapt gracefully to different screen sizes.
  • Touch-Friendly Interfaces: Ensure buttons and interactive elements are large enough for touch targets.
  • Optimized Navigation: Simplify navigation menus for smaller screens (e.g., hamburger menu).

5.6. Engagement & Motivation (Learner Experience)

  • Gamification Elements: Consider badges, points, or leaderboards for course completion or high quiz scores (optional, but highly effective for engagement).
  • Visual Progress: Use engaging progress bars, checklists, and visual indicators to show learners their advancement.
  • Personalization: Allow learners to set preferences, receive personalized course recommendations, and track their performance.
  • Clear Call-to-Actions: Guide learners clearly on what to do next (e.g., "Start Lesson," "Take Quiz," "Submit Exercise").

5.7. Content Creator Efficiency (Instructor Experience)

  • Drag-and-Drop Interfaces: Implement for reordering modules, lessons, and quiz questions to simplify content structuring.
  • Rich Text Editor (WYSIWYG): Provide a powerful yet user-friendly editor for lesson content, quizzes, and exercises.
  • Templating: Allow instructors to create and reuse templates for lessons or exercises to speed up content creation.
  • Bulk Actions: Enable bulk editing, publishing, or deleting of course components where appropriate.

This detailed output forms the blueprint for the next stages of development, ensuring a clear vision and actionable requirements for the "Training Course Builder" platform.

gemini Output

Training Course Builder: Detailed Design Specifications & UX Recommendations

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


1. Detailed Design Specifications

The Training Course Builder will be a web-based application designed for a "Course Creator" or "Instructional Designer" user role. Its core functionality revolves around structuring, populating, and managing educational content for a complete training course.

1.1. Core Workflow Overview

  1. Dashboard: Access existing courses or initiate a new course creation.
  2. Course Settings: Define
gemini Output

Training Course Builder: Final Design Assets & UX Specification

This document provides the comprehensive, detailed, and professional design assets and User Experience (UX) specifications for the "Training Course Builder" platform. This deliverable outlines the visual design, interaction patterns, and user flow recommendations to ensure an intuitive, efficient, and aesthetically pleasing experience for course creators across any subject domain.


1. Introduction & Design Philosophy

The "Training Course Builder" aims to empower educators and content creators to build high-quality, engaging training courses with ease. Our design philosophy centers around clarity, efficiency, flexibility, and accessibility. We prioritize a clean, modern interface that minimizes cognitive load, offers robust functionality, and provides a seamless journey from course conception to publication.

Key Design Principles:

  • User-Centricity: Every design decision is made with the course creator's workflow and needs in mind.
  • Modularity: Components are designed to be reusable and flexible, accommodating diverse course structures.
  • Consistency: A uniform look and feel across the platform ensures predictability and ease of learning.
  • Feedback-Rich: Users receive clear and immediate feedback on their actions.
  • Scalability: The design can accommodate growth in features and content complexity.
  • Accessibility: Adherence to WCAG guidelines to ensure usability for all.

2. Core Wireframe Descriptions & Functional Specifications

Below are detailed descriptions of the key screens and components, outlining their purpose, layout, and essential functionalities.

2.1. Dashboard / Course Overview

  • Purpose: The central hub for course creators to manage all their training courses.
  • Layout:

* Header: Global navigation (Dashboard, Analytics, Settings, Help, User Profile).

* Main Area:

* "Create New Course" Button: Prominently displayed (e.g., primary action button).

* Course Listing: A card-based or table-based view of existing courses. Each card/row includes:

* Course Title, Subject, Status (Draft, Published, Archived), Last Edited Date, Progress (e.g., "5/10 Modules Complete"), Actions (Edit, Preview, Publish/Unpublish, Archive, Delete).

* Search & Filter Bar: For quickly finding specific courses (by title, subject, status).

* Pagination/Infinite Scroll: For managing a large number of courses.

  • Key Functionality:

* Quick access to create new courses.

* Overview of all courses with key metrics.

* Efficient navigation to individual course editing.

2.2. Course Editor - Structure View (Outline Builder)

  • Purpose: To define the overall structure of the course, including modules and lessons.
  • Layout:

* Sidebar Navigation: Contextual navigation for the current course (Course Settings, Modules & Lessons, Quizzes, Exercises, Certification, Preview).

* Main Area:

* Course Title & Description Editor: Rich text editor for high-level course information.

* Module List: A hierarchical, collapsible list of modules.

* Each module displays its title and a summary of contained lessons/items.

* Actions per Module: Add Lesson, Edit Module, Delete Module, Duplicate Module.

* Lesson List (within each Module): Indented list of lessons.

* Each lesson displays its title and type (e.g., Text, Video, Quiz, Exercise).

* Actions per Lesson: Edit Lesson Content, Delete Lesson, Duplicate Lesson.

* "Add Module" Button: At the bottom or top of the module list.

* "Add Lesson" Button: Within each module section.

* Drag-and-Drop Reordering: For modules and lessons within modules.

  • Key Functionality:

* Intuitive creation and organization of course content.

* Visual representation of the course hierarchy.

* Seamless addition and modification of course elements.

2.3. Lesson Content Editor

  • Purpose: To create and manage the detailed content for individual lessons.
  • Layout:

* Lesson Title Input: Text field for the lesson title.

* Lesson Type Selector: Dropdown or radio buttons (e.g., "Text & Media," "Video," "Quiz," "Hands-on Exercise"). This dynamically changes the available input fields.

* Rich Text Editor (for "Text & Media" type):

* Standard formatting options (bold, italic, underline, lists, headings).

* Media embedding tools (images, video, audio - via URL or upload).

* Code block formatting.

* Hyperlink insertion.

* Table creation.

* Media Upload/Embed Fields: Specific fields for video URLs (YouTube, Vimeo, etc.), image uploads, or audio files.

* File Attachment Section: For supplementary materials (PDFs, PPTs, documents).

* Learning Objectives Section: A dedicated area for defining clear learning objectives for the lesson.

* "Save Draft" / "Publish Lesson" / "Preview Lesson" Buttons.

  • Key Functionality:

* Flexible content creation with multimedia support.

* Clear distinction between different lesson types.

* Robust text formatting and media management.

2.4. Quiz Builder

  • Purpose: To create and configure assessments for learners.
  • Layout:

* Quiz Settings Panel:

* Quiz Title, Description.

* Time Limit (optional), Pass Score (%), Number of Attempts.

* Feedback Settings (show correct answers, show explanations).

* Question Randomization (optional).

* Question List: A scrollable list of questions within the quiz.

* Each question displays its type and a snippet of the question text.

* Actions per Question: Edit, Duplicate, Delete, Reorder (drag-and-drop).

* "Add Question" Button: With a dropdown to select question type (Multiple Choice, True/False, Short Answer, Matching, Fill-in-the-Blank).

* Question Editor (Modal or Inline):

* Question Text (rich text editor).

* Specific fields per question type:

Multiple Choice:* List of options, radio button to mark correct answer, optional explanation per option.

True/False:* Radio buttons for True/False, optional explanation.

Short Answer:* Input field for correct answer(s), case sensitivity option.

Matching:* Pairs of items (e.g., Term A - Definition A).

Fill-in-the-Blank:* Text area with placeholder syntax for blanks.

* Points for question.

* Optional image/media for question.

* General Feedback (for correct/incorrect answers).

  • Key Functionality:

* Support for diverse question types.

* Granular control over quiz settings.

* Easy question creation and modification.

2.5. Hands-on Exercise Builder

  • Purpose: To define practical assignments and their submission requirements.
  • Layout:

* Exercise Title & Description: Rich text editor for the exercise prompt.

* Submission Type Selector: Dropdown (e.g., "Text Input," "File Upload," "Code Submission" - if integrated with a coding environment).

* Max File Size / Allowed File Types (for "File Upload").

* Rubric Builder (Optional):

* Add Criterion (e.g., "Code Functionality," "Report Structure," "Presentation").

* Points per criterion, description.

* Due Date (Optional).

* Example Solution Upload (Optional): For instructors.

  • Key Functionality:

* Clear definition of practical tasks.

* Flexible submission options.

* Structured grading through rubrics.

2.6. Certification Criteria Builder

  • Purpose: To define the conditions learners must meet to complete the course and earn a certificate.
  • Layout:

* Checklist of Requirements:

* "All modules completed" (checkbox, default checked).

* "All quizzes passed" (checkbox, with an option to specify minimum pass score if not already set per quiz).

* "All hands-on exercises submitted" (checkbox).

* "Minimum overall course score" (input field for percentage).

* "Custom criteria" (add text input for additional, specific requirements).

* Certificate Template Selection: A gallery of pre-designed certificate templates.

* Certificate Customization Options:

* Upload Logo.

* Custom Text Fields (e.g., "Issued By," "Instructor Name").

* Signature Upload (for digital signature).

  • Key Functionality:

* Clear definition of course completion requirements.

* Professional certificate generation.

* Basic branding capabilities for certificates.


3. Detailed Design Specifications

3.1. Typography

  • Primary Font (Headings & UI Elements): Inter (or a similar modern, sans-serif font like Lato, Open Sans).

Rationale:* Highly readable, clean, and professional.

* Sizes:

* H1: 2.5rem (40px) - Course Title

* H2: 2rem (32px) - Section Titles

* H3: 1.5rem (24px) - Module Titles

* H4: 1.25rem (20px) - Lesson Titles

* Body Text: 1rem (16px)

* Small Text/Captions: 0.875rem (14px)

* Buttons/Navigation: 1rem (16px)

* Weights: Regular (400), Medium (500), Semi-Bold (600), Bold (700).

  • Secondary Font (Body Text, Long-form Content): Roboto (or a similar highly legible sans-serif font like Source Sans Pro).

Rationale:* Excellent readability for extended reading, complements Inter well.

* Sizes: Same as primary font for consistency, adjusted for readability if needed.

* Weights: Regular (400), Light (300).

3.2. Iconography

  • Style: Clean, modern, line-based icons with a consistent stroke weight. Filled icons can be used for active states or primary actions.
  • Library: Material Design Icons, Font Awesome Pro, or a custom set.
  • Common Icons:

* + (Add), Edit (Pencil), Delete (Trash Can), Duplicate, Settings (Gear), Preview (Eye), Publish/Unpublish, Save, Drag Handle, Up/Down arrows, Checkmark, Warning, Error, Info, Home (Dashboard), Analytics, User Profile, Help, File Upload, Video, Image, Quiz, Exercise, Certificate.

3.3. Spacing & Layout

  • Grid System: 8pt base grid system for consistent spacing and alignment.
  • Padding:

* Small: 8px (e.g., inside buttons, small inputs)

* Medium: 16px (e.g., card padding, component spacing)

* Large: 24px-32px (e.g., section padding, main content area margins)

  • Margins: Consistent application of 8pt multiples for vertical and horizontal spacing between elements.
  • Content Width: Max content width of 1200-1440px for optimal readability on large screens, centered.

3.4. Component States

  • Default: Standard appearance.
  • Hover: Slight background color change, subtle shadow, or border highlight for interactive elements.
  • Focus: Clear outline (e.g., 2px blue border) for accessibility (keyboard navigation).
  • Active/Pressed: Darker background or pressed effect.
  • Disabled: Reduced opacity (e.g., 50%) and non-interactive.
  • Selected: Distinct background color or border for selected items (e.g., in lists, tabs).

3.5. Responsiveness

  • Mobile-First Approach: Design components to scale down gracefully to mobile devices.
  • Breakpoints: Standard breakpoints (e.g., 600px, 900px, 1200px, 1440px).
  • Layout Adaptations:

* Sidebar navigation collapses into a hamburger menu on smaller screens.

* Card layouts stack vertically.

* Tables convert to scrollable or simplified views.

* Input fields and buttons adjust to full width for touch targets.


4. Color Palette

The chosen color palette is professional, modern, and accessible, ensuring good contrast and a pleasant visual experience.

  • Primary Brand Color: #007bff (A vibrant, professional blue)

Usage:* Primary action buttons, active navigation items, progress indicators, branding elements.

  • Secondary Accent Color: #28a745 (A supportive green)

Usage:* Success messages, positive indicators, secondary calls to action.

  • Neutral Palette:

* Dark Text/Primary Text: #212529 (Near black for high readability)

* Secondary Text/Icons: #6c757d (Dark gray for less emphasis)

* Light Gray (Borders/Dividers): #ced4da

* Lighter Gray (Backgrounds/Hover): #f8f9fa

* White: #ffffff (Main

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