# jibber-inc/jibber-ios architecture

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

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

## Overview

##### Project Type & Purpose
- This is an iOS mobile application built with Xcode.
- It is highly modular and leverages multiple targets and extensions (such as AppClip, Intents Extension, Notification Content/Service) indicating that the app is designed to support varied functionality and user experiences.
- The project also clearly splits a large part of its logic into shared components that handle API interactions, coordinators, flows, UI elements, and models. It is also supported by external dependencies managed through CocoaPods and Swift Packages.

##### Analyzing the File Structure
- Major top-level directories include:
– Jibber.xcodeproj and its workspace, indicating the main project configuration.
– Targets for AppClip, Intents Extension (and its UI), Notification Content, and Notification Service – each representing a discrete module or extension of the core app.
– The Shared folder: Contains common code (e.g., API, Coordinators, Extensions, Flows, Managers, Models, UI) used across the main application and its extensions.
– The iOS folder: Contains application-specific code such as UI flows, view controllers, managers, and models for iOS.
– Packages folder: Includes independent Swift packages (Coordinator, KeyboardManager, Localization, Transitions) which help modularize and reuse code.
– Pods folder and associated configuration directories: Manage third-party dependencies such as Parse, Starscream, Bolts, and others.
- Many of the directories are organized around features or “flows” (Conversation, Home, Profile, People, etc.) which suggests the use of design patterns such as the Coordinator pattern for navigation and separation of concerns between UI flows.

##### Key Components
a. Core Application Components:
- Main iOS Application: Representing the primary launching module.
- AppClip: A lightweight alternative version for quick interactions.
- Extensions: Intents Extension for Siri/shortcuts, and Notification Service/Content for handling rich notifications.
b. Shared Modules & Dependencies:
- Shared folder: Encompassing common modules for API calls, coordinators, UI, and models.
- Packages: Independent libraries (e.g., Coordinator, KeyboardManager, Localization, Transitions) that encapsulate cross-cutting functionalities.
c. External Dependencies:
- CocoaPods libraries (Parse, Starscream, Bolts, etc.) which add networking, data management, and utility functionalities.
d. iOS-Specific Flows:
- The “Flows” directories inside both Shared and iOS folders showing distinct UI flows (conversations, onboarding, media, home, profile, etc.) used for navigation and presentation.
- UI layers including view controllers, custom views, and extensions making up the presentation layer.

##### Architectural Patterns and Design Principles
- The organization into “Shared,” “Packages,” and various “Flows” indicates a layered architecture where:
- The presentation layer (UI elements, view controllers, and coordinators) is cleanly separated from business logic.
- Cross-functional concerns (like API connectivity, navigational coordination, and extensions) are modularized.
- The usage of coordinators (from both the Shared/Coordinator and the Coordinator package) strongly suggests adoption of the Coordinator (or similar navigation) pattern to manage flow logic.
- The existence of multiple modular targets (AppClip, Extensions) indicates an approach where components are decoupled to support different contexts (main app vs. app clip vs. notifications).

## Diagram (Mermaid)

```mermaid
graph TD
    %% App Targets
    subgraph "App Targets"
        mainApp["Main iOS Application"]:::target
        appClip["AppClip"]:::target
        intentsExt["Intents Extension"]:::target
        intentsUI["Intents Extension UI"]:::target
        notifContent["Notification Content"]:::target
        notifService["Notification Service"]:::target
    end

    %% Shared Modules
    subgraph "Shared Modules"
        shared["Shared Modules"]:::shared
    end

    %% Swift Packages
    subgraph "Swift Packages"
        coordinatorPkg["Coordinator Package"]:::package
        keyboardPkg["KeyboardManager Package"]:::package
        localizationPkg["Localization Package"]:::package
        transitionsPkg["Transitions Package"]:::package
    end

    %% External Dependencies
    external["CocoaPods Dependencies"]:::external

    %% Connections from App Targets to Shared Modules
    mainApp -->|"uses"| shared
    appClip -->|"uses"| shared
    intentsExt -->|"uses"| shared
    intentsUI -->|"uses"| shared
    notifContent -->|"uses"| shared
    notifService -->|"uses"| shared

    %% Connections from Shared Modules to Swift Packages
    shared -->|"integrates"| coordinatorPkg
    shared -->|"integrates"| keyboardPkg
    shared -->|"integrates"| localizationPkg
    shared -->|"integrates"| transitionsPkg

    %% Connection from Shared Modules to External Dependencies
    shared -->|"connects"| external

    %% Additional Connection: Main Application utilizes Swift Packages directly
    mainApp -->|"utilizes"| coordinatorPkg

    %% Click Events
    click mainApp "https://github.com/jibber-inc/jibber-ios/tree/develop/iOS/"
    click appClip "https://github.com/jibber-inc/jibber-ios/tree/develop/AppClip/"
    click intentsExt "https://github.com/jibber-inc/jibber-ios/tree/develop/Intents Extension/"
    click intentsUI "https://github.com/jibber-inc/jibber-ios/tree/develop/Intents ExtensionUI/"
    click notifContent "https://github.com/jibber-inc/jibber-ios/tree/develop/Notification Content/"
    click notifService "https://github.com/jibber-inc/jibber-ios/tree/develop/Notification Service/"
    click shared "https://github.com/jibber-inc/jibber-ios/tree/develop/Shared/"
    click coordinatorPkg "https://github.com/jibber-inc/jibber-ios/tree/develop/Packages/Coordinator"
    click keyboardPkg "https://github.com/jibber-inc/jibber-ios/tree/develop/Packages/KeyboardManager"
    click localizationPkg "https://github.com/jibber-inc/jibber-ios/tree/develop/Packages/Localization"
    click transitionsPkg "https://github.com/jibber-inc/jibber-ios/tree/develop/Packages/Transitions"
    click external "https://github.com/jibber-inc/jibber-ios/tree/develop/Pods/"

    %% Styles
    classDef target fill:#AED581,stroke:#558B2F,stroke-width:2px;
    classDef shared fill:#81D4FA,stroke:#0277BD,stroke-width:2px;
    classDef package fill:#FFAB91,stroke:#D84315,stroke-width:2px;
    classDef external fill:#CE93D8,stroke:#8E24AA,stroke-width:2px;
```
