# raphaelfk/wwdc24 architecture

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

- Interactive diagram: https://gitdiagram.com/raphaelfk/wwdc24
- Repository: https://github.com/raphaelfk/wwdc24

## Overview

##### Main Components (Top Level)
a) Core App Layer (MyApp.swift & ContentView.swift)
b) Game Management Layer (GameManager.swift)
c) Scene Management Layer (SceneManager.swift)
d) User Interface Components
e) 3D Assets/Resources Management

##### Key Architectural Layers

a) Presentation Layer:
- Onboarding Flow
- Dashboard Views
- Level Views (First, Second, Third)
- Code Editor Components
- Use rounded rectangles for view components

b) Game Logic Layer:
- To:
- Level Management
- Progress Tracking
- Code Execution Logic

c) 3D Rendering Layer:
- SceneKitView
- Scene Resources (.scn files)
- 3D Models Management

##### Component Relationships
- Code Editor → Game Logic
- Game Logic → Scene Management
- Scene Management → 3D Rendering
- UI Views ↔ Game State

##### Technical Details
- SwiftUI Views (indicated by .swift files)
- SceneKit Integration
- Asset Management System
- Level Progression System

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Style Definitions
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef game fill:#2ecc71,stroke:#27ae60,color:white
    classDef render fill:#9b59b6,stroke:#8e44ad,color:white
    classDef edu fill:#e67e22,stroke:#d35400,color:white
    classDef asset fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Core App Layer
    subgraph CoreApp["Core App Layer"]
        MyApp["MyApp"]
        ContentView["ContentView"]
    end
    click MyApp "https://github.com/raphaelfk/wwdc24/blob/main/RibbosAdventure.swiftpm/MyApp.swift"
    click ContentView "https://github.com/raphaelfk/wwdc24/blob/main/RibbosAdventure.swiftpm/ContentView.swift"

    %% Game Management
    GameManager["Game Manager"]:::game
    click GameManager "https://github.com/raphaelfk/wwdc24/blob/main/RibbosAdventure.swiftpm/GameManager.swift"

    %% Scene Management
    subgraph SceneManagement["Scene Management Layer"]
        SceneManager["Scene Manager"]:::render
        SceneKitView["SceneKit View"]:::render
    end
    click SceneManager "https://github.com/raphaelfk/wwdc24/blob/main/RibbosAdventure.swiftpm/Levels/SceneManager.swift"
    click SceneKitView "https://github.com/raphaelfk/wwdc24/blob/main/RibbosAdventure.swiftpm/Levels/SceneKitView.swift"

    %% UI Components
    subgraph UIComponents["User Interface Components"]
        %% Onboarding
        Onboarding["Onboarding View"]:::ui
        click Onboarding "https://github.com/raphaelfk/wwdc24/blob/main/RibbosAdventure.swiftpm/OnboardingView.swift"

        %% Dashboard
        subgraph Dashboard["Dashboard"]
            DashboardView["Dashboard View"]:::ui
            MissionControl["Mission Control Terminal"]:::ui
            PlanetsLogs["Planets Logs"]:::ui
        end
        click DashboardView "https://github.com/raphaelfk/wwdc24/blob/main/RibbosAdventure.swiftpm/Dashboard/DashboardView.swift"
        click MissionControl "https://github.com/raphaelfk/wwdc24/blob/main/RibbosAdventure.swiftpm/Dashboard/MissionControlTerminalView.swift"
        click PlanetsLogs "https://github.com/raphaelfk/wwdc24/blob/main/RibbosAdventure.swiftpm/Dashboard/PlanetsLogsView.swift"

        %% Levels
        subgraph LevelViews["Level Views"]
            FirstLevel["First Level View"]:::ui
            SecondLevel["Second Level View"]:::ui
            ThirdLevel["Third Level View"]:::ui
        end
        click FirstLevel "https://github.com/raphaelfk/wwdc24/blob/main/RibbosAdventure.swiftpm/Levels/FirstLevel/FirstLevelView.swift"
        click SecondLevel "https://github.com/raphaelfk/wwdc24/blob/main/RibbosAdventure.swiftpm/Levels/SecondLevel/SecondLevelView.swift"
        click ThirdLevel "https://github.com/raphaelfk/wwdc24/blob/main/RibbosAdventure.swiftpm/Levels/ThirdLevel/ThirdLevelView.swift"

        %% Code Editor
        subgraph CodeEditor["Code Editor"]
            CodeEditorView["Code Editor View"]:::edu
            ForBlock["For Block View"]:::edu
            IfBlock["If Block View"]:::edu
        end
        click CodeEditorView "https://github.com/raphaelfk/wwdc24/blob/main/RibbosAdventure.swiftpm/CodeEditor/CodeEditorView.swift"
        click ForBlock "https://github.com/raphaelfk/wwdc24/blob/main/RibbosAdventure.swiftpm/CodeEditor/ForBlockView.swift"
        click IfBlock "https://github.com/raphaelfk/wwdc24/blob/main/RibbosAdventure.swiftpm/CodeEditor/IfBlockView.swift"
    end

    %% 3D Assets
    subgraph Assets["3D Assets & Resources"]
        FirstScene["First Level Scene"]:::asset
        SecondScene["Second Level Scene"]:::asset
        ThirdScene["Third Level Scene"]:::asset
        RibboModel["Ribbo Model"]:::asset
    end
    click FirstScene "https://github.com/raphaelfk/wwdc24/blob/main/RibbosAdventure.swiftpm/Resources/FirstLevelScene.scn"
    click SecondScene "https://github.com/raphaelfk/wwdc24/blob/main/RibbosAdventure.swiftpm/Resources/SecondLevelScene.scn"
    click ThirdScene "https://github.com/raphaelfk/wwdc24/blob/main/RibbosAdventure.swiftpm/Resources/ThirdLevelScene.scn"
    click RibboModel "https://github.com/raphaelfk/wwdc24/blob/main/RibbosAdventure.swiftpm/Resources/ribbo.scn"

    %% Relationships
    MyApp --> ContentView
    ContentView --> GameManager
    GameManager --> SceneManager
    SceneManager --> SceneKitView
    SceneKitView --> Assets
    GameManager --> UIComponents
    CodeEditor --> GameManager
    Dashboard --> GameManager
    LevelViews --> SceneManager

    %% Legend
    subgraph Legend
        UI["UI Components"]:::ui
        GameLogic["Game Logic"]:::game
        Rendering["3D Rendering"]:::render
        Educational["Educational"]:::edu
        AssetMgmt["Asset Management"]:::asset
    end
```
