# aonghasmackay/planetarysystemgenerator architecture

> Architecture diagram of the GitHub repository aonghasmackay/planetarysystemgenerator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aonghasmackay/planetarysystemgenerator
- Repository: https://github.com/aonghasmackay/planetarysystemgenerator

## Overview

**[Configuration Layer] (Top)**
- ↓
**[Generation Engine] (Middle)**
- ↓
**[Presentation Layer] (Bottom)**

##### Detailed Component Breakdown

A. Configuration Layer
- Into logical categories (celestial objects, naming conventions, planetary attributes)

B. Generation Engine (Core)
- Supporting modules around it:
- Planet Name Generator (planetNames.js)
- Global Utilities (globalFunctions.js)
- Debug System (debugFunctions.js)

C. Presentation Layer
- UI Components:
- Filtering System (filteringHandler.js)
- Disabled Elements Handler (disabledElementsHandler.js)
- SCSS/CSS structure:
- Hierarchy of SCSS files (variables → mixins → elements → modular → main.scss)

##### Data Flow Representation

**Configuration Files → System Generator**
**System Generator → UI Components**
**UI Components → User Interface (HTML/CSS)**

##### Technical Stack Indicators

- HTML5
- CSS3/SCSS
- Vanilla JavaScript

##### Render to UI

- The modular nature of the configuration system
- The central role of the generation engine
- The separation of concerns between generation and presentation
- The SCSS architecture

This approach will give other developers a clear understanding of how the system works, from configuration loading through generation to final presentation, while maintaining a good balance between detail and clarity.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Config ["Configuration Layer"]
        direction TB
        ConfigStore["Configuration Store"]
        StarConfig["Star Configuration"]
        PlanetClimate["Planet Climate Config"]
        PlanetIndustries["Planet Industries Config"]
        PlanetResources["Planet Resources Config"]
        PlanetSizes["Planet Sizes Config"]
        SystemNames["System Names Config"]
        
        ConfigStore --> StarConfig
        ConfigStore --> PlanetClimate
        ConfigStore --> PlanetIndustries
        ConfigStore --> PlanetResources
        ConfigStore --> PlanetSizes
        ConfigStore --> SystemNames
    end

    subgraph Process ["Processing Layer"]
        direction TB
        GenEngine["Generation Engine"]
        PlanetNameGen["Planet Name Generator"]
        GlobalFuncs["Global Functions"]
        DebugFuncs["Debug Functions"]
        FilterHandler["Filtering Handler"]
        DisabledHandler["Disabled Elements Handler"]
        
        GenEngine --> PlanetNameGen
        GenEngine --> GlobalFuncs
        GenEngine --> DebugFuncs
        GenEngine --> FilterHandler
        GenEngine --> DisabledHandler
    end

    subgraph Present ["Presentation Layer"]
        direction TB
        HTML["HTML Structure"]
        CSSMain["CSS Main Styling"]
        CSSElements["CSS Elements"]
        CSSMixins["CSS Mixins"]
        CSSVars["CSS Variables"]
        CSSModular["CSS Modular Components"]
        CSSSetup["CSS Setup"]
        
        CSSMain --> CSSElements
        CSSMain --> CSSMixins
        CSSMain --> CSSVars
        CSSMain --> CSSModular
        CSSMain --> CSSSetup
    end

    Config --> Process
    Process --> Present

    %% Click events for component mapping
    click ConfigStore "https://github.com/AonghasMackay/PlanetarySystemGenerator/tree/main/js/config/"
    click StarConfig "https://github.com/AonghasMackay/PlanetarySystemGenerator/blob/main/js/config/stars.json"
    click PlanetClimate "https://github.com/AonghasMackay/PlanetarySystemGenerator/blob/main/js/config/planetClimates.json"
    click PlanetIndustries "https://github.com/AonghasMackay/PlanetarySystemGenerator/blob/main/js/config/planetIndustries.json"
    click PlanetResources "https://github.com/AonghasMackay/PlanetarySystemGenerator/blob/main/js/config/planetResources.json"
    click PlanetSizes "https://github.com/AonghasMackay/PlanetarySystemGenerator/blob/main/js/config/planetSizes.json"
    click SystemNames "https://github.com/AonghasMackay/PlanetarySystemGenerator/blob/main/js/config/systemPrefixs.json"
    click GenEngine "https://github.com/AonghasMackay/PlanetarySystemGenerator/blob/main/js/generateSystem.js"
    click PlanetNameGen "https://github.com/AonghasMackay/PlanetarySystemGenerator/blob/main/js/modules/planetNames.js"
    click GlobalFuncs "https://github.com/AonghasMackay/PlanetarySystemGenerator/blob/main/js/modules/globalFunctions.js"
    click DebugFuncs "https://github.com/AonghasMackay/PlanetarySystemGenerator/blob/main/js/modules/debugFunctions.js"
    click FilterHandler "https://github.com/AonghasMackay/PlanetarySystemGenerator/blob/main/js/modules/filteringHandler.js"
    click DisabledHandler "https://github.com/AonghasMackay/PlanetarySystemGenerator/blob/main/js/modules/disabledElementsHandler.js"
    click HTML "https://github.com/AonghasMackay/PlanetarySystemGenerator/blob/main/index.html"
    click CSSMain "https://github.com/AonghasMackay/PlanetarySystemGenerator/blob/main/css/main.scss"
    click CSSElements "https://github.com/AonghasMackay/PlanetarySystemGenerator/blob/main/css/inc/elements.scss"
    click CSSMixins "https://github.com/AonghasMackay/PlanetarySystemGenerator/blob/main/css/inc/mixins.scss"
    click CSSVars "https://github.com/AonghasMackay/PlanetarySystemGenerator/blob/main/css/inc/variables.scss"
    click CSSModular "https://github.com/AonghasMackay/PlanetarySystemGenerator/blob/main/css/inc/modular.scss"
    click CSSSetup "https://github.com/AonghasMackay/PlanetarySystemGenerator/blob/main/css/inc/setup.scss"

    %% Styling
    classDef config fill:#a8d1f0
    classDef process fill:#a8f0c6
    classDef present fill:#d7a8f0
    
    class ConfigStore,StarConfig,PlanetClimate,PlanetIndustries,PlanetResources,PlanetSizes,SystemNames config
    class GenEngine,PlanetNameGen,GlobalFuncs,DebugFuncs,FilterHandler,DisabledHandler process
    class HTML,CSSMain,CSSElements,CSSMixins,CSSVars,CSSModular,CSSSetup present
```
