training-academy/src
dilgenfritz ee3a7e701e Add Enhanced Progress Bar Debugging - Added DOM element detection logging - Enhanced progress update logging with style info - Check if elements exist in DOM vs found by selector - Will help identify if issue is element detection or CSS visibility 2025-10-31 20:35:37 -05:00
..
core Fix Porn Cinema video loading bug and cleanup debug logs 2025-10-31 15:01:31 -05:00
data bug fixes 2025-10-30 16:23:33 -05:00
features Add Enhanced Progress Bar Debugging - Added DOM element detection logging - Enhanced progress update logging with style info - Check if elements exist in DOM vs found by selector - Will help identify if issue is element detection or CSS visibility 2025-10-31 20:35:37 -05:00
styles Implement Comprehensive Player Statistics System 2025-10-31 15:58:57 -05:00
utils Fix Porn Cinema video loading bug and cleanup debug logs 2025-10-31 15:01:31 -05:00
README.md Save current state: Fixed text readability in scenarios and interactive tasks 2025-10-29 17:04:42 -05:00

README.md

Source Code Structure

This directory contains the organized source code for the Gooner Training Academy application, structured by feature and responsibility.

📁 Directory Organization

/core - Core Game Engine

  • game.js - Main game logic, state management, and flow control
  • gameModeManager.js - Game mode selection and scenario management
  • main.js - Electron main process (desktop application entry point)
  • preload.js - Electron preload script for secure IPC communication

/features - Feature Modules

Organized by functional area, each feature is self-contained:

/features/webcam - Photography System

  • webcamManager.js - Camera access, photo capture, progress tracking, and photo galleries

/features/tasks - Task Management

  • interactiveTaskManager.js - Task execution, photography integration, and scenario handling
  • aiTaskManager.js - AI-powered task generation using local Ollama models

/features/audio - Audio System

  • audioManager.js - Background music, sound effects, and audio controls

/features/images - Image Management

  • popupImageManager.js - Consequence image popups and display management
  • image-discovery-fix.js - Image loading and scanning utilities

/features/ui - User Interface

  • flashMessageManager.js - Motivational flash messages and UI feedback

/data - Game Data & Configuration

  • gameData.js - Task definitions, game content, and configuration data

/styles - CSS Stylesheets

  • styles.css - Main application styles
  • styles-dark-edgy.css - Dark theme variant
  • styles-gaming.css - Gaming theme variant
  • styles-original-backup.css - Original styles backup

/utils - Utility Functions

  • desktop-file-manager.js - File system operations and desktop integration

🎯 Design Principles

Feature-Based Organization

  • Each feature directory is self-contained
  • Clear separation of concerns
  • Easy to locate and modify specific functionality

Core vs Features

  • Core: Essential game engine and platform code
  • Features: Modular functionality that can be developed independently

Data Separation

  • Game content separated from logic
  • Styles organized by theme
  • Configuration centralized

🔄 Dependencies

Inter-Feature Communication

Features communicate through:

  • Global event system
  • Shared game state (managed by core)
  • Well-defined APIs

Loading Order

Scripts are loaded in dependency order in index.html:

  1. Data layer (gameData.js)
  2. UI components (flashMessageManager.js, etc.)
  3. Feature modules (tasks, audio, images, webcam)
  4. Core game engine (game.js)

🚀 Benefits

  • Maintainability: Easy to find and modify specific features
  • Scalability: New features can be added without affecting existing code
  • Testing: Features can be tested in isolation
  • Collaboration: Team members can work on different features simultaneously
  • Debugging: Issues are easier to locate and fix

📝 Adding New Features

  1. Create a new directory under /features/[feature-name]
  2. Add your feature files to the directory
  3. Update index.html to include your scripts in the correct order
  4. Document your feature in this README
  5. Ensure proper error handling and cleanup

🔧 Build Process

The build process includes all src/ files thanks to the updated package.json configuration. No additional build steps are required for the new structure.