# gocarrot/teak-ios architecture

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

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

## Overview

##### Main Components

a. Core SDK Components:
- Core Module (TeakCore)
- Configuration System
- Event System
- Notification Handling System
- Store Integration
- User Profile Management

b. Extension Components:
- Notification Service Extension
- Notification Content Extension

c. Third-Party Integrations:
- LibTomMath Integration
- Urban Airship Integration (for provisioning profile checks)

##### Architecture Layers

**┌─────────────────────────────────────────┐**
- Host Application             │
- ┤
- Teak SDK                  │
- ┬───────────┬────────────────┤
- Core    │  Events   │  Configuration │
- Services │  System   │    System      │
- ┴───────────┴────────────────┤
- Extension Framework             │
- ┬──────────────────┤
- Notification       │   Notification    │
- Service Extension  │ Content Extension │
- ┴──────────────────┘

##### Specific Implementation Details

- TeakNotification handling
- Push notification flow
- Store integration points
- User profile management

##### Integration Points

External interfaces:
- Host app integration points
- Push notification system integration
- Store integration
- Debug/Development tools integration

##### Key Features to Emphasize

Create sections showing:
- Notification category management
- Deep linking support
- Debug/logging system
- Configuration management

- Component types
- Integration points

This will create a comprehensive visualization of the SDK's architecture while highlighting its key components and their interactions.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and classes
    classDef core fill:#a8d1f0,stroke:#333
    classDef config fill:#ffe599,stroke:#333
    classDef events fill:#b6d7a8,stroke:#333
    classDef notification fill:#ea9999,stroke:#333
    classDef store fill:#d5a6bd,stroke:#333
    classDef profile fill:#9fc5e8,stroke:#333
    classDef extension fill:#b4a7d6,stroke:#333
    classDef thirdparty fill:#cccccc,stroke:#333
    classDef debug fill:#f9cb9c,stroke:#333

    subgraph Host["Host Application Layer"]
        HostApp["iOS Application"]
    end

    subgraph SDK["Teak SDK Layer"]
        Core["Core Module"]:::core
        Config["Configuration System"]:::config
        Events["Event System"]:::events
        NotificationHandler["Notification Handling"]:::notification
        Store["Store Integration"]:::store
        UserProfile["User Profile Management"]:::profile
        Debug["Debug/Development Tools"]:::debug
    end

    subgraph Extensions["Extension Framework Layer"]
        NotificationService["Notification Service Extension"]:::extension
        NotificationContent["Notification Content Extension"]:::extension
    end

    subgraph ThirdParty["Third-Party Integrations"]
        LibTomMath["LibTomMath"]:::thirdparty
        UrbanAirship["Urban Airship"]:::thirdparty
    end

    %% Relationships
    HostApp --> Core
    Core --> Config
    Core --> Events
    Core --> NotificationHandler
    Core --> UserProfile
    Core --> Store
    Config --> NotificationHandler
    Config --> Store
    Events --> NotificationHandler
    NotificationHandler --> NotificationService
    NotificationService --> NotificationContent
    Core --> LibTomMath
    NotificationHandler --> UrbanAirship
    Debug --> Core

    %% Click events
    click Core "https://github.com/GoCarrot/teak-ios/blob/develop/Teak/Core/TeakCore.h"
    click Config "https://github.com/GoCarrot/teak-ios/blob/develop/Teak/Configuration/TeakConfiguration.h"
    click Events "https://github.com/GoCarrot/teak-ios/tree/develop/Teak/Events/"
    click NotificationHandler "https://github.com/GoCarrot/teak-ios/blob/develop/Teak/TeakNotification.h"
    click Store "https://github.com/GoCarrot/teak-ios/blob/develop/Teak/Store/SKPaymentObserver.h"
    click UserProfile "https://github.com/GoCarrot/teak-ios/blob/develop/Teak/Core/TeakUserProfile.h"
    click NotificationService "https://github.com/GoCarrot/teak-ios/blob/develop/TeakExtensions/TeakNotificationService/TeakNotificationService.h"
    click NotificationContent "https://github.com/GoCarrot/teak-ios/blob/develop/TeakExtensions/TeakNotificationContent/TeakNotificationViewController.h"
    click LibTomMath "https://github.com/GoCarrot/teak-ios/tree/develop/Teak/3rdParty/libtommath/"
    click Debug "https://github.com/GoCarrot/teak-ios/blob/develop/Teak/TeakLog.h"

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Configuration"]:::config
        L3["Events"]:::events
        L4["Notifications"]:::notification
        L5["Store"]:::store
        L6["User Profile"]:::profile
        L7["Extensions"]:::extension
        L8["Third Party"]:::thirdparty
        L9["Debug Tools"]:::debug
    end
```
