Skip to content

모듈 구성

Tuist 기반 멀티 모듈 구조

truloop iOS는 Tuist를 사용하여 프로젝트 모듈 구조를 관리합니다. Workspace.swift에서 전체 모듈을 정의하고, 각 모듈의 Project.swift에서 개별 설정을 관리합니다.

모듈 의존성 다이어그램

모듈 상세

App 모듈

앱의 진입점이자 최상위 모듈입니다.

항목설명
Product.app
Bundle IDcom.butbeautifulco.truloop
Deployment TargetiOS 17.2
주요 역할CompositionRoot, MainTabBar, App Lifecycle

의존성 목록:

  • Feature: Home, OnBoard
  • Domain, Repository, Cores, Utils
  • WrappedThirdParty
  • External: Swinject, Pulse, PulseUI, Branch SDK, Localize-Swift, Kakao SDK, StoreKit

Feature 모듈

모듈역할주요 외부 의존성
Home메인 홈 화면, 룹 목록/상세, 채팅 채널, 프로필, 리캡, 알림 등Kingfisher, GooglePlaces, PhoneNumberKit, QRCode
OnBoard온보딩 흐름 (스플래시, 인트로, 전화번호 인증, 프로필 설정, 연락처, 이미지 권한, 푸시 권한 등)Kingfisher, PhoneNumberKit
OnBoardInterfaceFeature 간 통신을 위한 Builder 프로토콜 정의 모듈

정보

OnBoardInterface는 Home과 OnBoard 간의 순환 의존성을 방지하기 위한 인터페이스 모듈입니다. SplashBuildable, IntroBuildable, ContactBuildable, AddPhotosForLoopBuildable, CreateLoopAlbumBuildable, SecretariesBuildable 프로토콜을 정의합니다. Domain, Cores, DesignSystem에 의존합니다.

Home Feature 내부 구조:

Home/Sources/
  Assembly/        -- HomeAssembly.swift (DI 등록)
  PresentationSources/
    HomeViewModel.swift
    LoopMainViewModel.swift
    LoopDetailViewModel.swift
    CreateNewLoopViewModel.swift
    CreateAppointmentViewModel.swift
    CreateLoopAlbumViewModel.swift
    CreateLoopAlbumForShareViewModel.swift
    CreateStoryViewModel.swift
    AddPhotosForLoopViewModel.swift
    LoopInformationModifyViewModel.swift
    PosterSelectViewModel.swift
    StoryDetailViewModel.swift
    ReelsViewModel.swift
    Managers/      -- InstagramSharingHelper, LoopSharingManager, LoopCommentManager,
                      LoopETAActivityHelper, LoopMediaSorter
    Model/         -- HomeCardModel, LoopMainModel, AppointmentModel
  Protocols/       -- Scrollable 등
  UISources/
    Home/          -- HomeView, LoopDetail, LoopMain, FriendSearch, Notification, ArrangementList
    Channel/       -- ChannelView, ChannelInputView
    ChannelList/   -- ChannelListView, DirectMessageTargetSearch
    CreateLoop/    -- CreateNewLoopView, CreateLoopAlbumView
    CreateAppointment/
    Profile/       -- ProfileView, ProfileEdit, Account, Paywall, Secretaries,
                      AddFriend, BlockedUsers, DeleteAccount, InAppPurchase, DebugLogs
    Reels/         -- ReelsViewController (UIKit), ReelsCollectionViewCell

OnBoard Feature 내부 구조:

OnBoard/Sources/
  Assembly/        -- OnboardAssembly.swift (DI 등록)
  Views/
    Splash/        -- SplashBuilder, SplashView, SplashViewModel
    Intro/         -- IntroBuilder, IntroView
    PhoneNumber/   -- PhoneNumberBuilder, PhoneNumberView, PhoneNumberViewModel
    VerificationCode/
    UserName/
    UserID/
    ProfileImage/  -- ProfileImageBuilder, ProfileImageView, CameraPicker
    Contact/       -- ContactBuilder, ContactView, ContactViewModel
    ImagePermission/
    PushPermission/
    CreateNewLoop/ -- CreateNewLoopBuilder, CreateNewLoopView, CreateNewLoopViewModel

Domain 모듈

항목설명
Product.framework
의존성Extensions, Swinject, Google Places

구성:

  • Entities/: 41개 비즈니스 모델 (User, Loop, Channel, Mission, Story, Secretary, AppointmentDetail 등)
  • Repository/: 10개의 Repository 프로토콜 (Auth, Home, Contact, Friend, Channel, ChannelList, Notification, Device, Purchase, LiveActivityToken)
  • UseCase/: AccountUseCase, HomeUseCase, SecretaryUseCase, MissionManager, ContactManager, FCMManager, LiveActivityTokenManager, FetchPlaceUseCase, LoopShareUseCase, RootSceneRouteUseCase, ChatConfigUseCase, GooglePlaceConfigUseCase 등
  • UseCase/AppScheme/: 앱 내부 URL Scheme 처리 관련 로직

Repository 모듈

항목설명
Product.framework
의존성Domain, Networking, WrappedThirdParty, Swinject, SendbirdChatSDK, RevenueCat, Google Places

구성:

  • DataSource/: Repository 프로토콜 구현 (16개의 DataSource 파일)
  • Requests/: 24개의 Request DTO
  • Responses/: 46개의 Response DTO

Networking 모듈

항목설명
Product.framework
의존성Utils, Cores, Swinject, Moya

API Target, 네트워크 추상화, 인증 인터셉터를 제공합니다. 자세한 내용은 네트워크 레이어 문서를 참조하세요.

DesignSystem 모듈

항목설명
Product.framework
의존성Utils, Lottie

구성:

  • Color/: FoundationColor, SemanticColor, Color+ext, UIColor+ext
  • Image/: Image+ext
  • Views/: 공통 UI 컴포넌트
    • TruloopPopup, ToastView, PinCodeView, SearchBar, StrokeText
    • ProgressLottieView, DateTimePickerView, SearchableTimeZonePicker
    • BaseNavigationController, FlowLayout, RoundedCorners
    • TruloopTextField/: TruloopTextField, TruloopTextFieldState, TruloopTextFieldStyle
    • Modifiers/: SwiftUI ViewModifier (PullToRefresh, DismissKeyboard, ScrollOffset, LiquidGlassStyle, HeaderScroll, PHAssetPicker, LongPressGestureWithHaptic 등)

Cores 모듈

항목설명
Product.framework
의존성Localize-Swift, Segment Analytics

구성:

  • Constants.swift: 앱 전역 상수 (서버 URL 등)
  • AppLog.swift: 로깅 유틸리티
  • AppTracker.swift: Analytics 트래킹
  • ActiveChatManager.swift: 채팅 상태 관리
  • ComponentBuilder.swift: 공통 Builder 프로토콜

Utils 모듈

항목설명
Product.framework
서브 모듈Extensions, DateUtil

Extensions 서브 모듈 (의존성: Swinject, Kingfisher):

  • Swift/UIKit/SwiftUI 확장: String+ext, Date+ext, UIImage+ext, Collection+ext, URL+ext, UIApplication+ext, UIDevice+ext, AttributedString+ext, SwiftUIExtension, NotificationCenter+ext
  • KFImage+ext: Kingfisher 이미지 뷰 확장
  • KeychainStore / KeychainAESKeyStore: 보안 저장소
  • Resolver+ext: Swinject Resolver 편의 확장
  • OrientationManager: 화면 방향 관리
  • Synchronized: 스레드 안전 유틸리티
  • LoopETAActivityUpdatePayload: Live Activity 데이터 모델
  • ExtensionsAssembly: DI 등록

DateUtil 서브 모듈:

  • DateUtil.swift: 날짜 유틸리티
  • DateFormatUtil.swift: 날짜 포맷 유틸리티

WrappedThirdParty 모듈

항목설명
Product.framework
의존성FirebaseCore, FirebaseAnalytics, FirebaseCrashlytics, FirebaseMessaging

Firebase SDK를 하나의 모듈로 래핑하여 다른 모듈에서 직접 Firebase에 의존하지 않도록 격리합니다. 내부적으로 @_exported import를 통해 Firebase 모듈을 re-export합니다.

Shared 모듈

주의

Shared 모듈은 디렉토리가 존재하지만 소스 코드가 없으며, Workspace.swift에도 포함되어 있지 않습니다. 현재 사용되지 않는 빈 모듈입니다.

App Extensions

Extension역할의존성
TruloopShare사진 공유 Extension (최대 39장 이미지, 동영상 제외)Utils, Networking, Domain, Repository, Home, Swinject
TruloopLiveActivityExtensionLive Activity Widget (WidgetKit)SwiftUI, WidgetKit, Utils, Domain, DesignSystem, Localize-Swift
TruloopNotificationService푸시 알림 가공 ExtensionUserNotifications, Intents

정보

모든 App Extension은 App/Project.swift에서 정의되며 별도의 Project.swift를 갖지 않습니다. 소스 코드는 각각의 최상위 디렉토리(TruloopShare/, TruloopLiveActivityExtension/, TruloopNotificationService/)에 위치합니다.

변경 이력

날짜변경 내용
2026-03-10소스 코드 기반 검증: 의존성 다이어그램에 OnBoardInterface 의존성 추가, OnBoard Feature 내부 구조 추가, Domain UseCase/Entity 목록 갱신, Response DTO 수 보정(47→46), DesignSystem/Extensions 구성 요소 보완, Shared 모듈 미사용 상태 명시, App Extension 설명 보강