# captures-2024/soongan_ios architecture

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

- Interactive diagram: https://gitdiagram.com/captures-2024/soongan_ios
- Repository: https://github.com/captures-2024/soongan_ios

## Overview

##### Project Type and Purpose
- This is a modular iOS application (“순간”) built with Swift, orchestrated via Tuist.
- It uses Swift Package targets for:
- AuthFeature & HomeFeature – each encapsulates feature logic (Composable Architecture reducers) and SwiftUI views
- Shared – common extensions/enums between features
- Soongan (App target) – composes all feature modules into the running app
- Third-party libs: Composable Architecture (state/side-effects), Alamofire (REST client), KakaoSDK (social login).

##### File-Structure Analysis
- Top-level:
- Soongan/Tuist.swift & mise.toml – Tuist build configuration
- Soongan/Project.swift – root app target definition
- Package modules under Soongan/…:
- DesignSystem/Project.swift
- Feature/AuthFeature/Project.swift
- Feature/HomeFeature/Project.swift
- Shared/Project.swift
- Resource/Project.swift
- Soongan/Soongan – the actual iOS app target with App entry point, views, and tests.

##### Key Architectural Patterns
- Modular decomposition via Swift packages (Tuist)
- Unidirectional data flow using Composable Architecture (Store → Reducers → Effects → View)
- Dependency injection of network layer (Alamofire + endpoint definitions) and social login (KakaoSDK)

##### Main Components
- App Shell (SoonganApp)
- Feature Modules
- AuthFeature (LoginView, SignupView, SignupSuccessView + LoginFeature/SignupFeature/…)
- HomeFeature (HomeView, PostPictureView + HomeFeature/PostPictureFeature…)
- Shared Utilities (String & UIApplication extensions, AuthType enum)
- Network Layer (Alamofire wrapper + Endpoint definitions)
- External Services
- Backend REST API
- Kakao Social Login API

##### Relationships & Data Flow
- SoonganApp instantiates the main Store and injects feature stores into MainTabView
- Feature Views dispatch Actions → passed to Reducers → may invoke Effects
- Effects call Network Layer → Alamofire → Backend API or KakaoSDK → return data → new state → View updates
- All UI elements pulled from DesignSystem & Resource
- Shared provides common enums/extensions imported by multiple modules

## Diagram (Mermaid)

```mermaid
graph TB
  %% App Shell
  subgraph "App Target" 
    direction TB
    SoonganApp["SoonganApp"]:::app
    MainTabView["MainTabView"]:::app
    MainTabFeature["MainTabFeature"]:::app
  end

  %% Feature Modules
  subgraph "AuthFeature Module" 
    direction TB
    AuthFeatureProj["AuthFeature"]:::feature
    LoginView["LoginView"]:::feature
    SignupView["SignupView"]:::feature
    SignupSuccessView["SignupSuccessView"]:::feature
    LoginFeature["LoginFeature"]:::feature
    SignupFeature["SignupFeature"]:::feature
    SignupSuccessFeature["SignupSuccessFeature"]:::feature
  end

  subgraph "HomeFeature Module"
    direction TB
    HomeFeatureProj["HomeFeature"]:::feature
    HomeView["HomeView"]:::feature
    PostPictureView["PostPictureView"]:::feature
    HomeFeature["HomeFeature"]:::feature
    PostPictureFeature["PostPictureFeature"]:::feature
  end

  %% Shared, DesignSystem, Resource, Network
  DesignSystem["DesignSystem"]:::design
  Shared["Shared Utilities"]:::shared
  Resource["Resource Assets"]:::resource
  NetworkLayer["Network Layer\n(Alamofire & KakaoSDK)"]:::network

  %% External Services
  subgraph "External Services"
    direction TB
    BackendAPI["Backend REST API"]:::external
    KakaoAPI["Kakao Social Login API"]:::external
  end

  %% Dependencies & Data Flow
  SoonganApp -->|"renders"| MainTabView
  MainTabView -->|"uses"| MainTabFeature

  MainTabFeature -->|"depends on"| AuthFeatureProj
  MainTabFeature -->|"depends on"| HomeFeatureProj

  %% AuthFeature flow
  LoginView -->|"dispatches Action"| LoginFeature
  SignupView -->|"dispatches Action"| SignupFeature
  SignupSuccessView -->|"dispatches Action"| SignupSuccessFeature
  LoginFeature -->|"invokes Effects"| NetworkLayer
  SignupFeature -->|"invokes Effects"| NetworkLayer
  SignupSuccessFeature -->|"reads Resources"| Resource

  %% HomeFeature flow
  HomeView -->|"dispatches Action"| HomeFeature
  PostPictureView -->|"dispatches Action"| PostPictureFeature
  HomeFeature -->|"invokes Effects"| NetworkLayer
  PostPictureFeature -->|"invokes Effects"| NetworkLayer

  %% Feature dependencies
  AuthFeatureProj -->|"uses UI components"| DesignSystem
  HomeFeatureProj -->|"uses UI components"| DesignSystem
  AuthFeatureProj -->|"uses shared enums/extensions"| Shared
  HomeFeatureProj -->|"uses shared enums/extensions"| Shared

  %% Network to External
  NetworkLayer -->|"calls"| BackendAPI
  NetworkLayer -->|"calls"| KakaoAPI
  BackendAPI -->|"response"| NetworkLayer
  KakaoAPI -->|"response"| NetworkLayer

  %% DesignSystem & Resource
  DesignSystem -->|"sources assets"| Resource

  %% App depends on modules
  SoonganApp -->|"depends on"| AuthFeatureProj
  SoonganApp -->|"depends on"| HomeFeatureProj
  SoonganApp -->|"depends on"| DesignSystem
  SoonganApp -->|"depends on"| Shared
  SoonganApp -->|"depends on"| Resource
  SoonganApp -->|"depends on"| NetworkLayer

  %% Click Events
  click SoonganApp "https://github.com/captures-2024/soongan_ios/blob/develop/Soongan/Soongan/Sources/SoonganApp.swift"
  click MainTabView "https://github.com/captures-2024/soongan_ios/blob/develop/Soongan/Soongan/Sources/MainTabView.swift"
  click MainTabFeature "https://github.com/captures-2024/soongan_ios/blob/develop/Soongan/Soongan/Sources/MainTabFeature.swift"
  click AuthFeatureProj "https://github.com/captures-2024/soongan_ios/blob/develop/Soongan/Feature/AuthFeature/Project.swift"
  click LoginFeature "https://github.com/captures-2024/soongan_ios/blob/develop/Soongan/Feature/AuthFeature/Sources/Logic/LoginFeature.swift"
  click SignupFeature "https://github.com/captures-2024/soongan_ios/blob/develop/Soongan/Feature/AuthFeature/Sources/Logic/SignupFeature.swift"
  click SignupSuccessFeature "https://github.com/captures-2024/soongan_ios/blob/develop/Soongan/Feature/AuthFeature/Sources/Logic/SignupSuccessFeature.swift"
  click LoginView "https://github.com/captures-2024/soongan_ios/blob/develop/Soongan/Feature/AuthFeature/Sources/View/LoginView.swift"
  click SignupView "https://github.com/captures-2024/soongan_ios/blob/develop/Soongan/Feature/AuthFeature/Sources/View/SignupView.swift"
  click SignupSuccessView "https://github.com/captures-2024/soongan_ios/blob/develop/Soongan/Feature/AuthFeature/Sources/View/SignupSuccessView.swift"
  click HomeFeatureProj "https://github.com/captures-2024/soongan_ios/blob/develop/Soongan/Feature/HomeFeature/Project.swift"
  click HomeFeature "https://github.com/captures-2024/soongan_ios/blob/develop/Soongan/Feature/HomeFeature/Sources/Logic/HomeFeature.swift"
  click PostPictureFeature "https://github.com/captures-2024/soongan_ios/blob/develop/Soongan/Feature/HomeFeature/Sources/Logic/PostPictureFeature.swift"
  click HomeView "https://github.com/captures-2024/soongan_ios/blob/develop/Soongan/Feature/HomeFeature/Sources/View/HomeView.swift"
  click PostPictureView "https://github.com/captures-2024/soongan_ios/blob/develop/Soongan/Feature/HomeFeature/Sources/View/PostPictureView.swift"
  click DesignSystem "https://github.com/captures-2024/soongan_ios/blob/develop/Soongan/DesignSystem/Project.swift"
  click Shared "https://github.com/captures-2024/soongan_ios/blob/develop/Soongan/Shared/Project.swift"
  click Resource "https://github.com/captures-2024/soongan_ios/blob/develop/Soongan/Resource/Project.swift"

  %% Styles
  classDef app fill:#0A2540,stroke:#000,color:#fff;
  classDef feature fill:#63B3ED,stroke:#000,color:#000;
  classDef design fill:#319795,stroke:#000,color:#fff;
  classDef shared fill:#A0AEC0,stroke:#000,color:#000;
  classDef resource fill:#D69E2E,stroke:#000,color:#000;
  classDef network fill:#ED8936,stroke:#000,color:#000;
  classDef external fill:#E53E3E,stroke:#000,color:#fff;
```
