# wolftein/aurora architecture

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

- Interactive diagram: https://gitdiagram.com/wolftein/aurora
- Repository: https://github.com/wolftein/aurora

## Overview

##### Project’s Purpose and Type
- The README tells us it’s a “Simple and efficient C++ Game Engine.”
- The file structure supports this: the “Foundation” directory contains the core engine modules while the “Example” directory shows a sample application demonstrating engine usage.

##### Break Down the File Structure into Main Components
- Foundation – This is clearly the core engine. It is organized into several subsystems under namespaces like Aurora:
- Aurora.Base: Provides core utilities such as containers, logging, IO (including TOML parsing), and subsystem management.
- Aurora.Engine: Contains the Kernel, Device, and core engine properties that manage overall runtime behavior.
- Aurora.Audio: Implements audio functionalities including decoders, drivers, listeners, and emitters.
- Aurora.Content: Manages resource loading for fonts, models, shaders, textures, and sounds (with support for multiple formats like MP3 and WAV).
- Aurora.Graphic: Wraps multiple graphics API implementations (for example, D3D11 and GLES3) along with supporting components like cameras, pipelines, renderers, and shader management.
- Aurora.Input: Handles various input devices such as keyboards, mice, and generic polling services.
- Aurora.Network: Provides networking capabilities using Asio with client/server implementations as well as packet and protocol handling.
- Aurora.Render and Aurora.Scene: Likely manage the rendering pipeline and scene management (entities, observers, proxies) respectively.

- Example – This directory offers an example application using the engine:
- The “Private/Application.cpp/.hpp” files imply an application layer built on top of the core engine.
- The “Experimental” folder inside Example indicates additional or prototype gameplay elements such as sprites and text systems.
- The “Resources” directory includes assets like fonts, textures, and pipeline definitions (effects and shaders), hinting at how the engine loads and applies these resources at runtime.

##### Relationships and Interactions
- The Core Engine (Aurora.Engine) is the central hub that initializes and coordinates between the various subsystems.
- Each subsystem (Audio, Content, Graphic, Input, Network) acts as a service that the kernel calls upon:
- For instance, Aurora.Content works closely with resource pipelines (both under Foundation and in Example/Resources) to load game assets.
- Aurora.Graphic is built to support different APIs (Direct3D11 and GLES3) – this indicates an abstraction layer that chooses the appropriate driver at runtime.
- Aurora.Network (using Asio) interacts with game or engine-level networking functions.
- The “Example” application ties into these components by invoking the engine’s kernel and using its systems to drive the application’s runtime.
- Configuration and build integration (via CMakeLists.txt and .github workflows) are also integral though more “infrastructure” than runtime architecture.

##### Architectural Patterns and Technologies
- The system shows a modular design pattern, separating concerns by segregating functionalities into distinct subsystems (audio, content, graphics, input, network, etc.).
- The “Public” and “Private” separation in the “Foundation” directory implies a clean API boundary: public interfaces for engine users and private implementations.
- Multiple implementations for graphics (D3D11 and GLES3) indicate usage of the abstraction layer pattern.
- A service-based or subsystem pattern is used by Aurora.Base and Aurora.Engine to coordinate various services.
- Relevant technologies include standard C++ (with CMake as the build system), potential external libraries for networking (Asio), audio (e.g., FAudio), and multi-platform graphics APIs.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Foundation - Core Engine Subgraph
    subgraph "Foundation - Core Engine"
        AuroraEngine["Aurora.Engine"]:::engine
        AuroraBase["Aurora.Base"]:::subsystem
        AuroraAudio["Aurora.Audio"]:::subsystem
        AuroraContent["Aurora.Content"]:::subsystem
        AuroraGraphic["Aurora.Graphic"]:::subsystem
        AuroraInput["Aurora.Input"]:::subsystem
        AuroraNetwork["Aurora.Network"]:::subsystem
        AuroraRender["Aurora.Render"]:::subsystem
        AuroraScene["Aurora.Scene"]:::subsystem
        
        %% Graphics Drivers Subgraph
        subgraph "Graphics Drivers"
            D3D11Driver["D3D11 Driver"]:::subsystem
            GLES3Driver["GLES3 Driver"]:::subsystem
        end

        %% Network Implementation Subgraph
        subgraph "Network Implementation"
            Asio["Asio"]:::subsystem
        end
    end

    %% Example Application Subgraph
    subgraph "Example Application"
        ExampleApp["Example Application"]:::external
        Experimental["Experimental Gameplay Elements"]:::external
    end

    %% Asset Management Subgraph
    subgraph "Asset Management"
        ResourceMgmt["Resources/Asset Management"]:::resource
    end

    %% Build/Configuration Subgraph
    subgraph "Build/Configuration"
        BuildConfig["Build/Configuration"]:::build
    end

    %% Relationships and Data Flows
    AuroraEngine -->|"initializes"| AuroraBase
    AuroraEngine -->|"initializes"| AuroraAudio
    AuroraEngine -->|"coordinates"| AuroraContent
    AuroraEngine -->|"manages"| AuroraGraphic
    AuroraEngine -->|"integrates"| AuroraInput
    AuroraEngine -->|"manages"| AuroraNetwork
    AuroraEngine -->|"manages"| AuroraRender
    AuroraEngine -->|"manages"| AuroraScene

    AuroraGraphic -->|"selects"| D3D11Driver
    AuroraGraphic -->|"selects"| GLES3Driver

    AuroraNetwork -->|"implements"| Asio

    ExampleApp -->|"invokes"| AuroraEngine
    ExampleApp -->|"includes"| Experimental

    AuroraContent -->|"loads_from"| ResourceMgmt
    AuroraGraphic -->|"loads_from"| ResourceMgmt

    BuildConfig ---|"configures"| AuroraEngine
    BuildConfig ---|"builds"| ExampleApp

    %% Styles and Color Definitions
    classDef engine fill:#ffd700,stroke:#333,stroke-width:2px;
    classDef subsystem fill:#add8e6,stroke:#333,stroke-width:2px;
    classDef external fill:#90ee90,stroke:#333,stroke-width:2px;
    classDef resource fill:#ffa07a,stroke:#333,stroke-width:2px;
    classDef build fill:#D3D3D3,stroke:#333,stroke-width:2px;

    %% Click Events
    click AuroraBase "https://github.com/wolftein/aurora/blob/main/Foundation/Public/Aurora.Base"
    click AuroraEngine "https://github.com/wolftein/aurora/blob/main/Foundation/Public/Aurora.Engine"
    click AuroraAudio "https://github.com/wolftein/aurora/blob/main/Foundation/Public/Aurora.Audio"
    click AuroraContent "https://github.com/wolftein/aurora/blob/main/Foundation/Public/Aurora.Content"
    click AuroraGraphic "https://github.com/wolftein/aurora/blob/main/Foundation/Public/Aurora.Graphic"
    click D3D11Driver "https://github.com/wolftein/aurora/tree/main/Foundation/Private/Aurora.Graphic/D3D11"
    click GLES3Driver "https://github.com/wolftein/aurora/tree/main/Foundation/Private/Aurora.Graphic/GLES3"
    click AuroraInput "https://github.com/wolftein/aurora/blob/main/Foundation/Public/Aurora.Input"
    click AuroraNetwork "https://github.com/wolftein/aurora/blob/main/Foundation/Public/Aurora.Network"
    click Asio "https://github.com/wolftein/aurora/tree/main/Foundation/Private/Aurora.Network/Asio"
    click AuroraRender "https://github.com/wolftein/aurora/blob/main/Foundation/Public/Aurora.Render"
    click AuroraScene "https://github.com/wolftein/aurora/blob/main/Foundation/Public/Aurora.Scene"
    click ExampleApp "https://github.com/wolftein/aurora/blob/main/Example/Private/Application.cpp"
    click Experimental "https://github.com/wolftein/aurora/tree/main/Example/Private/Experimental"
    click ResourceMgmt "https://github.com/wolftein/aurora/tree/main/Example/Resources"
    click BuildConfig "https://github.com/wolftein/aurora/blob/main/CMakeLists.txt"
```
