# daviddoswell/sesh architecture

> Architecture diagram of the GitHub repository daviddoswell/sesh, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/daviddoswell/sesh
- Repository: https://github.com/daviddoswell/sesh

## Overview

##### Main Components Identification
The system consists of these primary components:

a. Client-Side (iOS App)
- Presentation Layer (Views)
- Business Logic Layer (ViewModels)
- Data Layer (Models)
- Utilities
- Assets (Audio & Visual)

b. Backend Services
- Firebase Services
- Firestore (Database)
- Analytics
- App Check (Security)

##### Component Relationships

- Data flow between Views and ViewModels
- Communication between ViewModels and Firebase services
- Asset usage (audio files, images)
- Dependencies between components

##### Specific Elements

a. UI Layer:
**[LaunchView] → [ContentView] → [HomeView]**
- ↓
- [MeditationView]
- ↓
- [SessionListView]

b. Business Logic:
**[SessionViewModel] ← → [Firebase Services]**
- ↑
- [Session Model]

c. Utilities:
**[AudioPlayer] → [Audio Files]**
**[HeartShape] → [HeartShapeView]**

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "User Interface Layer"
        LV["LaunchView"]
        CV["ContentView"]
        HV["HomeView"]
        MV["MeditationView"]
        SLV["SessionListView"]
        
        CGV["CircleGroupView"]
        HSV["HeartShapeView"]
    end

    subgraph "Business Logic Layer"
        SVM["SessionViewModel"]
        AP["AudioPlayer"]
        HS["HeartShape"]
    end

    subgraph "Data Layer"
        SM["Session Model"]
    end

    subgraph "Firebase Services"
        FS["Firestore DB"]
        AN["Analytics"]
        AC["App Check"]
    end

    subgraph "Assets"
        AA["Audio Assets"]
        VA["Visual Assets"]
        CA["Character Assets"]
        COA["Color Assets"]
    end

    %% Relationships
    LV --> CV
    CV --> HV
    CV --> MV
    CV --> SLV
    
    MV --> CGV
    MV --> HSV
    HSV --> HS
    
    HV --> SVM
    MV --> SVM
    SLV --> SVM
    
    SVM --> SM
    SVM <--> FS
    SVM --> AN
    
    MV --> AP
    AP --> AA
    
    HV --> VA
    HV --> CA
    HV --> COA
    
    AC --> FS
    AC --> AN

    %% Click Events
    click LV "https://github.com/daviddoswell/sesh/blob/main/Sesh/Views/LaunchView.swift"
    click CV "https://github.com/daviddoswell/sesh/blob/main/Sesh/Views/ContentView.swift"
    click HV "https://github.com/daviddoswell/sesh/blob/main/Sesh/Views/HomeView.swift"
    click MV "https://github.com/daviddoswell/sesh/blob/main/Sesh/Views/MeditationView.swift"
    click SLV "https://github.com/daviddoswell/sesh/blob/main/Sesh/Views/SessionListView.swift"
    click CGV "https://github.com/daviddoswell/sesh/blob/main/Sesh/CustomViews/CircleGroupView.swift"
    click HSV "https://github.com/daviddoswell/sesh/blob/main/Sesh/CustomViews/HeartShapeView.swift"
    click SVM "https://github.com/daviddoswell/sesh/blob/main/Sesh/ViewModels/SessionViewModel.swift"
    click AP "https://github.com/daviddoswell/sesh/blob/main/Sesh/Utilities/AudioPlayer.swift"
    click HS "https://github.com/daviddoswell/sesh/blob/main/Sesh/Utilities/HeartShape.swift"
    click SM "https://github.com/daviddoswell/sesh/blob/main/Sesh/Model/Session.swift"
    click AA "https://github.com/daviddoswell/sesh/tree/main/Sesh/Audio"
    click VA "https://github.com/daviddoswell/sesh/blob/main/Sesh/Assets.xcassets"
    click CA "https://github.com/daviddoswell/sesh/tree/main/Sesh/Assets.xcassets/Characters"
    click COA "https://github.com/daviddoswell/sesh/tree/main/Sesh/Assets.xcassets/Colors"

    %% Styling
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef logic fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#f1c40f,stroke:#f39c12,color:black
    classDef firebase fill:#e74c3c,stroke:#c0392b,color:white
    classDef utility fill:#9b59b6,stroke:#8e44ad,color:white
    classDef assets fill:#95a5a6,stroke:#7f8c8d,color:white

    class LV,CV,HV,MV,SLV,CGV,HSV ui
    class SVM,AP,HS logic
    class SM data
    class FS,AN,AC firebase
    class AA,VA,CA,COA assets
```
