# jasonette/jasonette-ios architecture

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

- Interactive diagram: https://gitdiagram.com/jasonette/jasonette-ios
- Repository: https://github.com/jasonette/jasonette-ios

## Overview

##### Main Components

a. Core Engine Layer
- Jason Core (Jason.h/m)
- JasonParser (JasonParser.h/m)
- JasonViewController (JasonViewController.h/m)

b. Action System
- JasonAction (base class)
- Various Action Handlers (Network, Cache, Audio, Vision, etc.)
- Action Protocol (JasonActionProtocol.h)

c. Component System
- JasonComponent (base class)
- Component Factory (JasonComponentFactory.h/m)
- Various UI Components (Button, Label, Image, etc.)

d. Services Layer
- Agent Service (JasonAgentService)
- Push Service (JasonPushService)
- Vision Service (JasonVisionService)
- WebSocket Service (JasonWebsocketService)

e. External Dependencies
- Networking (AFNetworking)
- Image Handling (SDWebImage)
- Audio (FreeStreamer)
- UI Components (Various Pod dependencies)

**[JSON Input Layer]**
- ↓
**[Core Engine Layer]**
- ↓
**[Services Layer] ←→ [Action System]**
- ↓
**[Component System]**
- ↓
**[UI Layer]**

##### Connection Types

- Double lines: Data flow

##### Key Relationships to Highlight

- JSON input processing through JasonParser
- Action dispatch system from core to various action handlers
- Component creation and management through ComponentFactory
- Service integration with external systems
- Memory and cache management

##### Implementation Details

- Component name
- Key responsibilities
- Main interfaces

b. Interaction flows:
- JSON interpretation path
- Action execution flow
- UI update mechanism
- Service communication paths

##### Additional Elements

- Notes for key architectural patterns
- Extension points
- Integration points with iOS system

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef core fill:#b3d9ff,stroke:#333,stroke-width:2px
    classDef service fill:#90EE90,stroke:#333,stroke-width:2px
    classDef action fill:#FFB366,stroke:#333,stroke-width:2px
    classDef component fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef external fill:#D3D3D3,stroke:#333,stroke-width:2px

    %% JSON Input Layer
    JSON[JSON Input]

    %% Core Engine Layer
    subgraph CoreEngine
        Jason[Jason Core]
        Parser[JSON Parser]
        ViewController[View Controller]
    end

    %% Services Layer
    subgraph Services
        AgentService[Agent Service]
        PushService[Push Service]
        VisionService[Vision Service]
        WebSocketService[WebSocket Service]
    end

    %% Action System
    subgraph Actions
        BaseAction[Base Action]
        ActionProtocol[Action Protocol]
        subgraph ActionHandlers
            NetworkAction[Network Action]
            CacheAction[Cache Action]
            AudioAction[Audio Action]
            VisionAction[Vision Action]
        end
    end

    %% Component System
    subgraph Components
        BaseComponent[Base Component]
        ComponentFactory[Component Factory]
        subgraph UIComponents
            ButtonComponent[Button Component]
            LabelComponent[Label Component]
            ImageComponent[Image Component]
        end
    end

    %% External Dependencies
    subgraph External
        AFNetworking[AFNetworking]
        SDWebImage[SDWebImage]
        FreeStreamer[FreeStreamer]
    end

    %% Relationships
    JSON --> Parser
    Parser --> Jason
    Jason --> ViewController
    ViewController --> BaseAction
    BaseAction --> ActionProtocol
    BaseAction --> ActionHandlers
    Jason --> Services
    Services --> External
    Jason --> ComponentFactory
    ComponentFactory --> BaseComponent
    BaseComponent --> UIComponents

    %% Click Events
    click Jason "https://github.com/Jasonette/JASONETTE-iOS/blob/develop/app/Jasonette/Jason.h"
    click Parser "https://github.com/Jasonette/JASONETTE-iOS/blob/develop/app/Jasonette/JasonParser.h"
    click ViewController "https://github.com/Jasonette/JASONETTE-iOS/blob/develop/app/Jasonette/JasonViewController.h"
    click BaseAction "https://github.com/Jasonette/JASONETTE-iOS/blob/develop/app/Jasonette/JasonAction.h"
    click ActionProtocol "https://github.com/Jasonette/JASONETTE-iOS/blob/develop/app/Jasonette/JasonActionProtocol.h"
    click NetworkAction "https://github.com/Jasonette/JASONETTE-iOS/blob/develop/app/Jasonette/JasonNetworkAction.h"
    click CacheAction "https://github.com/Jasonette/JASONETTE-iOS/blob/develop/app/Jasonette/JasonCacheAction.h"
    click AudioAction "https://github.com/Jasonette/JASONETTE-iOS/blob/develop/app/Jasonette/JasonAudioAction.h"
    click VisionAction "https://github.com/Jasonette/JASONETTE-iOS/blob/develop/app/Jasonette/JasonVisionAction.h"
    click BaseComponent "https://github.com/Jasonette/JASONETTE-iOS/blob/develop/app/Jasonette/JasonComponent.h"
    click ComponentFactory "https://github.com/Jasonette/JASONETTE-iOS/blob/develop/app/Jasonette/JasonComponentFactory.h"
    click ButtonComponent "https://github.com/Jasonette/JASONETTE-iOS/blob/develop/app/Jasonette/JasonButtonComponent.h"
    click LabelComponent "https://github.com/Jasonette/JASONETTE-iOS/blob/develop/app/Jasonette/JasonLabelComponent.h"
    click ImageComponent "https://github.com/Jasonette/JASONETTE-iOS/blob/develop/app/Jasonette/JasonImageComponent.h"
    click AgentService "https://github.com/Jasonette/JASONETTE-iOS/blob/develop/app/Jasonette/JasonAgentService.h"
    click PushService "https://github.com/Jasonette/JASONETTE-iOS/blob/develop/app/Jasonette/JasonPushService.h"
    click VisionService "https://github.com/Jasonette/JASONETTE-iOS/blob/develop/app/Jasonette/JasonVisionService.h"
    click WebSocketService "https://github.com/Jasonette/JASONETTE-iOS/blob/develop/app/Jasonette/JasonWebsocketService.h"
    click AFNetworking "https://github.com/Jasonette/JASONETTE-iOS/tree/develop/app/Pods/AFNetworking"
    click SDWebImage "https://github.com/Jasonette/JASONETTE-iOS/tree/develop/app/Pods/SDWebImage"
    click FreeStreamer "https://github.com/Jasonette/JASONETTE-iOS/tree/develop/app/Pods/FreeStreamer"

    %% Style Applications
    class Jason,Parser,ViewController core
    class AgentService,PushService,VisionService,WebSocketService service
    class BaseAction,ActionProtocol,NetworkAction,CacheAction,AudioAction,VisionAction action
    class BaseComponent,ComponentFactory,ButtonComponent,LabelComponent,ImageComponent component
    class AFNetworking,SDWebImage,FreeStreamer external
```
