# nexters/tidify-ios architecture

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

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

## Overview

##### Project type and purpose
- tidify-iOS is a mobile client application for the Tidify bookmark service, built with Clean Architecture (Presentation, Domain, Data, Core), ReactorKit, Coordinators, RxSwift/RxCocoa, RxMoya for networking, and Tuist for modular project generation.

##### File structure
- Top-level modules under “Tidify/Targets”:
– Tidify (UIApplication target + Share Extension)
– TidifyCore (utilities, DI container, extension, storage)
– TidifyData (network layer, DTO→Domain mapping, repositories)
– TidifyDomain (entities, repository interfaces, use cases)
– TidifyPresentation (UI: Coordinators, ViewControllers, ViewModels)
- Plugins: Tuist plugin to scaffold new modules or targets (“tidify-my-cli”)
- Config files: xcconfig per build configuration; Tuist Project.swift and Dependencies.swift
- Resources: Assets.xcassets, storyboards, Lottie, share extension storyboard

##### README for additional insights
- Architecture: Clean + ReactorKit + Coordinator
- Networking: Moya + RxMoya
- Reactive programming: RxSwift/RxCocoa
- UI Layout: SnapKit + Then
- Tuist modularization

##### Main components & their relationships
a. Presentation Layer
– Coordinators orchestrate flows (MainCoordinator → TabBar, Onboarding, SignIn, Home, Folder, Search, BookmarkCreation, Setting, ShareExtension)
– ViewControllers + ViewModels use RxSwift to handle UI events and bind to Domain use cases
b. Domain Layer
– Entities: Bookmark, Folder, UserToken, Onboarding
– Repository Interfaces (BookmarkRepository, FolderRepository, etc.)
– Use Cases implement business rules (FetchFolderUseCase, CreateBookmarkUseCase, SearchUseCase, etc.)
c. Data Layer
– NetworkProvider (Moya + plugins, HTTPMethod, error handling)
– Endpoints (BookmarkEndpoint, FolderEndpoint, UserEndpoint)
– DTOs & mappers map APIResponse → Domain Entities
– Default repositories implement Domain interfaces, call NetworkProvider or local storage
d. Core Layer
– DIContainer wires Presentation→Domain→Data dependencies
– AppProperties, UserDefaultsStorage, KeyChain for local persistence
– Extensions & helpers
e. External Services
– RESTful API server (Bookmark/Folder/User endpoints)
– OAuth providers (Google, Apple, Kakao)

##### Architectural patterns & design principles
- Clean Architecture layered separation
- Dependency Inversion: Domain defines interfaces; Data implements
- Single Responsibility: Each Coordinator, ViewModel, UseCase, Repository class has one concern
- Reactive Streams: RxSwift flows from View → ViewModel → UseCase → Repository → Network → back
- Modularization via Tuist: each layer is a separate framework target

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Presentation Layer
    subgraph "Presentation Layer" 
        direction TB
        MC["MainCoordinator\n(ReactorKit, RxSwift)"]:::presentation
        HC["HomeCoordinator"]:::presentation
        FC["Feature Coordinators\n(Onboarding, Folder, Search, BookmarkCreation, Setting)"]:::presentation
        VC["ViewControllers\n(SnapKit, Then)"]:::presentation
        VM["ViewModels\n(ReactorKit, RxSwift)"]:::presentation
    end

    %% Domain Layer
    subgraph "Domain Layer"
        direction TB
        DE["Entities\n(Bookmark, Folder, UserToken, Onboarding)"]:::domain
        DI["Repository Interfaces"]:::domain
        UC["Use Cases\n(FetchFolder, CreateBookmark, Search)"]:::domain
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        NP["NetworkProvider\n(RxMoya, Moya)"]:::data
        EP["Endpoints\n(Bookmark, Folder, User)"]:::data
        DM["DTOs & Mappers"]:::data
        DR["Default Repository Implementations"]:::data
    end

    %% Core Layer
    subgraph "Core Layer"
        direction TB
        DIC["DIContainer\n(Tuist, Swift Extensions)"]:::core
        US["UserDefaultsStorage\nKeyChain"]:::core
        AP["AppProperties\nUserProperties"]:::core
        EH["Extensions & Helpers"]:::core
    end

    %% External Services
    subgraph "External Services & Storage"
        direction TB
        API["REST API Server"]:::external
        OAuth["OAuth Providers\n(Google, Apple, Kakao)"]:::external
        Local["Local Storage\n(if any)"]:::external
    end

    %% Tuist & Config
    subgraph "Tuist & Config"
        direction TB
        Plugin["Tuist Plugin\n(module scaffolding)"]:::tuist
        Project["Project.swift"]:::tuist
        Deps["Dependencies.swift"]:::tuist
        Debug["Debug.xcconfig"]:::tuist
        Release["Release.xcconfig"]:::tuist
    end

    %% Data Flow Connections
    VC -->|"binds to"| VM
    MC -->|"navigates"| VC
    HC --> VC
    MC --> HC
    VM -->|"calls"| UC
    UC -->|"invokes"| DI
    DI -->|"implemented by"| DR
    DR -->|"uses"| NP
    NP -->|"calls"| API
    DR -->|"uses local"| US
    DIC -->|"injects into"| MC
    DIC --> VM
    DIC --> DE
    Plugin --> Project
    Project --> Deps
    Project --> Debug
    Project --> Release

    %% Click Events
    click MC "https://github.com/nexters/tidify-ios/blob/refactor/Tidify/Targets/TidifyPresentation/Sources/Common/Base/MainCoordinator.swift"
    click HC "https://github.com/nexters/tidify-ios/blob/refactor/Tidify/Targets/TidifyPresentation/Sources/Home/HomeCoordinator.swift"
    click Plugin "https://github.com/nexters/tidify-ios/tree/refactor/Tidify/Plugins/Tidify"
    click VC "https://github.com/nexters/tidify-ios/tree/refactor/Tidify/Targets/TidifyPresentation"
    click VM "https://github.com/nexters/tidify-ios/tree/refactor/Tidify/Targets/TidifyPresentation"
    click DE "https://github.com/nexters/tidify-ios/tree/refactor/Tidify/Targets/TidifyDomain"
    click DI "https://github.com/nexters/tidify-ios/tree/refactor/Tidify/Targets/TidifyDomain/Sources/Interfaces"
    click UC "https://github.com/nexters/tidify-ios/tree/refactor/Tidify/Targets/TidifyDomain/Sources/UseCases"
    click NP "https://github.com/nexters/tidify-ios/blob/refactor/Tidify/Targets/TidifyData/Sources/Services/Network/NetworkProvider.swift"
    click EP "https://github.com/nexters/tidify-ios/tree/refactor/Tidify/Targets/TidifyData/Sources/Services/Endpoint"
    click DM "https://github.com/nexters/tidify-ios/tree/refactor/Tidify/Targets/TidifyData/Sources/Response"
    click DR "https://github.com/nexters/tidify-ios/tree/refactor/Tidify/Targets/TidifyData/Sources/Repositories"
    click DIC "https://github.com/nexters/tidify-ios/blob/refactor/Tidify/Targets/TidifyCore/Sources/DIContainer.swift"
    click US "https://github.com/nexters/tidify-ios/blob/refactor/Tidify/Targets/TidifyCore/Sources/UserDefaultsStorage.swift"
    click AP "https://github.com/nexters/tidify-ios/blob/refactor/Tidify/Targets/TidifyCore/Sources/AppProperties.swift"
    click EH "https://github.com/nexters/tidify-ios/tree/refactor/Tidify/Targets/TidifyCore/Sources/Extension"
    click Project "https://github.com/nexters/tidify-ios/blob/refactor/Tidify/Project.swift"
    click Deps "https://github.com/nexters/tidify-ios/blob/refactor/Tidify/Tuist/Dependencies.swift"
    click Debug "https://github.com/nexters/tidify-ios/blob/refactor/Tidify/Targets/Tidify/Config/Debug.xcconfig"
    click Release "https://github.com/nexters/tidify-ios/blob/refactor/Tidify/Targets/Tidify/Config/Release.xcconfig"

    %% Styles
    classDef presentation fill:#cce5ff,stroke:#0066cc,stroke-width:1px
    classDef domain fill:#d4edda,stroke:#28a745,stroke-width:1px
    classDef data fill:#fff3cd,stroke:#ffc107,stroke-width:1px
    classDef core fill:#e2e3e5,stroke:#6c757d,stroke-width:1px
    classDef external fill:#f8d7da,stroke:#dc3545,stroke-width:1px
    classDef tuist fill:#e2f0d9,stroke:#2f6f44,stroke-width:1px
```
