# amannji/mindmorph architecture

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

- Interactive diagram: https://gitdiagram.com/amannji/mindmorph
- Repository: https://github.com/amannji/mindmorph

## Overview

##### Main Components Identification

The system should be divided into these primary components:

a) Presentation Layer
- Views (SwiftUI-based)
- View Models
- Components (Reusable UI elements)

b) Core Features
- Brain Visualization (SceneKit)
- Experiment System
- Anatomy Information

c) Data Model
- Brain State Management
- Action Processing
- Neurotransmitter System

**┌─ Views Layer ─────────────────────┐**
- WelcomeView   ContentView         │
- AnatomyView   ExperimentView      │
- InfoView      ResultView          │
- ┬────────────────────┘
- ↓
**┌─ Components Layer ─────────────────┐**
- CardView     CodeActionTab        │
- CodeBlockCell ProgressView        │
- SelectedBlockCell                 │
- ┬────────────────────┘
- ↓

**┌─ View Models ──────────────────────┐**
- CodeViewModel                      │
- SceneConfigurator                  │
- ┬────────────────────┘
- ↓
**┌─ Models ────────────────────────────┐**
- Brain        Action                │
- Anatomy      Levels                │
- Amount       ExperimentResult      │
- NeuroTrasmitterInfo               │
- ┬────────────────────┘

**┌─ Resources ──────────────────────────┐**
- 3D Models (.scn)                    │
- Images                              │
- ┘

##### Important Elements

- Blue: UI Components
- Green: Business Logic
- Yellow: Data Models
- Gray: Resources

- Specific notations for:
- SwiftUI views (⚛️)
- SceneKit components (🎮)
- Data models (📦)

##### Technical Stack Indicators

- SwiftUI
- SceneKit
- Swift Package Manager
- Apple Frameworks used

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "User Interface"
        VL["Views Layer"]
        CL["Components Layer"]
        
        subgraph "Views"
            CV["ContentView"]:::view
            WV["WelcomeView"]:::view
            AV["AnatomyView"]:::view
            EV["ExperimentView"]:::view
            IV["InfoView"]:::view
            RV["ResultView"]:::view
            BMV["BrainModelView"]:::view
        end
        
        subgraph "Components"
            CaV["CardView"]:::component
            CAT["CodeActionTab"]:::component
            CBC["CodeBlockCell"]:::component
            PV["ProgressView"]:::component
            SBC["SelectedBlockCell"]:::component
        end
    end
    
    subgraph "Business Logic"
        subgraph "View Models"
            CVM["CodeViewModel"]:::viewmodel
            SC["SceneConfigurator"]:::viewmodel
        end
        
        subgraph "Models"
            BR["Brain"]:::model
            AC["Action"]:::model
            AN["Anatomy"]:::model
            LV["Levels"]:::model
            ER["ExperimentResult"]:::model
            NI["NeuroTrasmitterInfo"]:::model
        end
        
        CDS["CodeDataSource"]:::datasource
    end
    
    subgraph "Resources"
        BM["Brain.scn"]:::resource
        BI["Brain Images"]:::resource
        AI["Anatomy Images"]:::resource
    end
    
    %% Relationships
    VL --> CL
    CL --> CVM
    CVM --> CDS
    CVM --> BR
    SC --> BM
    BR --> AC
    BR --> AN
    BR --> NI
    AC --> ER
    LV --> ER
    
    %% Click Events
    click CV "https://github.com/Amannji/MindMorph/blob/main/ContentView.swift"
    click WV "https://github.com/Amannji/MindMorph/blob/main/WelcomeView.swift"
    click AV "https://github.com/Amannji/MindMorph/blob/main/AnatomyView.swift"
    click EV "https://github.com/Amannji/MindMorph/blob/main/ExperimentView.swift"
    click IV "https://github.com/Amannji/MindMorph/blob/main/InfoView.swift"
    click RV "https://github.com/Amannji/MindMorph/blob/main/ResultView.swift"
    click BMV "https://github.com/Amannji/MindMorph/blob/main/BrainModelView.swift"
    click CaV "https://github.com/Amannji/MindMorph/blob/main/Components/CardView.swift"
    click CAT "https://github.com/Amannji/MindMorph/blob/main/Components/CodeActionTab.swift"
    click CBC "https://github.com/Amannji/MindMorph/blob/main/Components/CodeBlockCell.swift"
    click PV "https://github.com/Amannji/MindMorph/blob/main/Components/ProgressView.swift"
    click SBC "https://github.com/Amannji/MindMorph/blob/main/Components/SelectedBlockCell.swift"
    click CVM "https://github.com/Amannji/MindMorph/blob/main/CodeViewModel.swift"
    click SC "https://github.com/Amannji/MindMorph/blob/main/SceneConfigurator.swift"
    click BR "https://github.com/Amannji/MindMorph/blob/main/Model/Brain.swift"
    click AC "https://github.com/Amannji/MindMorph/blob/main/Model/Action.swift"
    click AN "https://github.com/Amannji/MindMorph/blob/main/Model/Anatomy.swift"
    click LV "https://github.com/Amannji/MindMorph/blob/main/Model/Levels.swift"
    click ER "https://github.com/Amannji/MindMorph/blob/main/Model/ExperimentResult.swift"
    click NI "https://github.com/Amannji/MindMorph/blob/main/Model/NeuroTrasmitterInfo.swift"
    click BM "https://github.com/Amannji/MindMorph/blob/main/Resources/Brain.scn"
    click BI "https://github.com/Amannji/MindMorph/blob/main/Resources/Assets.xcassets/Brain.dataset"
    click AI "https://github.com/Amannji/MindMorph/blob/main/Resources/Assets.xcassets/Anatomy.imageset"
    click CDS "https://github.com/Amannji/MindMorph/blob/main/CodeDataSource.swift"
    
    %% Styles
    classDef view fill:#2196F3,stroke:#1565C0,color:white
    classDef component fill:#42A5F5,stroke:#1565C0,color:white
    classDef viewmodel fill:#4CAF50,stroke:#2E7D32,color:white
    classDef model fill:#FFC107,stroke:#FFA000,color:black
    classDef resource fill:#9E9E9E,stroke:#616161,color:white
    classDef datasource fill:#FF5722,stroke:#E64A19,color:white
    
    %% Legend
    subgraph Legend
        L1["View"]:::view
        L2["Component"]:::component
        L3["ViewModel"]:::viewmodel
        L4["Model"]:::model
        L5["Resource"]:::resource
        L6["Data Source"]:::datasource
    end
```
