Skip to content

[Work 60] 폴더 구조를 정리했습니다. - #33

Merged
sangYuLv merged 4 commits into
developfrom
WORK-60
Oct 13, 2026
Merged

sangYuLv merged 4 commits into
developfrom
WORK-60

Conversation

@sangYuLv

@sangYuLv sangYuLv commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

JIRA

📝 작업 내용

📌 요약

  • Data 폴더를 외부 서비스별(Firebase / Kakao / System)로 나누고, Mock을 별도 폴더로 분리
  • UseCase 폴더를 기능 단위로 분리
  • Core·DI 폴더 정리 및 Info.plist·entitlements를 SupportingFiles로 이동
  • 여러 계층이 직접 사용하는 엔티티 7개를 Core/Entity로 이동
  • 사용하지 않는 템플릿 ViewController 삭제

🔍 상세

[0] 전체 폴더 구조
★는 이번 PR에서 새로 만들었거나 구성이 바뀐 폴더입니다. 괄호 안 숫자는 폴더 바로 아래의 파일 수입니다.

WhereAreYou/
├── WhereAreYou/                      앱 타깃
│   ├── Core/
│   │   ├── App/ ★ (2)                AppDelegate, SceneDelegate
│   │   ├── Coordinator/
│   │   │   ├── Implementation/ (7)
│   │   │   └── Protocol/ (13)
│   │   ├── DI/
│   │   │   ├── Implementation/ (2)   DIContainer, AppDIContainer+Register
│   │   │   │   └── ScreenFactory/ ★ (13)
│   │   │   └── Protocol/ (7)
│   │   └── Entity/ ★ (7)             여러 계층이 직접 쓰는 엔티티
│   │
│   ├── Data/
│   │   ├── Firebase/ ★ (1)           FirebaseErrorMapper
│   │   │   ├── DTO/ (1)
│   │   │   └── Repository/ (5)
│   │   ├── Kakao/ ★ (2)              KakaoLocalEndpoint, KakaoCategoryGroupCode
│   │   │   ├── Repository/ (3)
│   │   │   └── Response/ (2)
│   │   ├── System/ ★ (4)             CoreLocation, ActivityKit, Apple 로그인
│   │   ├── Mock/ ★ (9)
│   │   └── Network/ ★ (4)            공통 네트워크 코드만 남김
│   │
│   ├── Domain/
│   │   ├── Entity/ ★ (14)            Core로 옮긴 엔티티 제외
│   │   ├── Repository/ (18)
│   │   ├── Service/ (8)
│   │   └── UseCase/ ★
│   │       ├── Appointment/ (5)
│   │       ├── Auth/ (2)
│   │       ├── Chat/ (6)
│   │       ├── Location/ (2)
│   │       ├── Permission/ (2)
│   │       ├── Place/ (2)
│   │       └── Route/ (1)
│   │
│   ├── Presentation/
│   │   ├── AppointmentCreation/
│   │   ├── AppointmentList/
│   │   ├── Chat/                     AppointmentInfo/, SharedPlace/, SubComponent/
│   │   ├── Component/                AppointmentFieldsBox/, SearchPlaceCard/
│   │   ├── Extension/ ★ (19)         Date+Format 추가
│   │   ├── Home/
│   │   ├── Login/
│   │   ├── Map/                      AppointmentRoute/, LocationPreview/, PlaceSelection/
│   │   ├── MyPage/
│   │   ├── PresentationModel/
│   │   └── RouteSearch/
│   │
│   ├── DebugLiveActivity/ (5)
│   ├── Resource/                     Assets.xcassets, Base.lproj
│   ├── SupportingFiles/ ★ (3)        Info.plist, entitlements 2개
│   ├── Config.xcconfig               (gitignore, 위치 유지)
│   └── GoogleService-Info.plist      (gitignore, 위치 유지)
│
├── Shared/                           앱·위젯 공용
└── WhereAreYouWidget/                위젯 타깃

[1] Data 폴더 구조

  • Firebase/: Repository(Auth, Firestore, Storage), DTO(UserDTO), FirebaseErrorMapper
  • Kakao/: Repository(장소 검색, 주변 장소, 역지오코딩), Response, KakaoLocalEndpoint, KakaoCategoryGroupCode
    • 기존 Network/Kakao/에 있던 응답 타입과 엔드포인트를 Repository와 같은 폴더로 모았습니다.
  • System/: CoreLocation, ActivityKit, Apple 로그인 등 Apple 프레임워크 기반 구현
  • Mock/: Mock Repository 9개
  • Network/: 공통 네트워크 코드(APIClient, Endpoint, NetworkError, APIKey)만 남김

[2] Domain/UseCase 기능별 분리

  • Appointment(5), Chat(6), Location(2), Place(2), Permission(2), Route(1), Auth(2)
  • 공유 장소 관련 UseCase(FetchSharedPlaces, VotePlace, SharePlace)는 화면이 Presentation/Chat/SharedPlace에 있어서 Chat에 두었습니다.

[3] Core·DI 정리

  • Core/App/: AppDelegate, SceneDelegate
  • Core/DI/Implementation/ScreenFactory/: ScreenFactory와 확장 12개
  • SupportingFiles/: Info.plist, WhereAreYou.entitlements, WhereAreYouRelease.entitlements
    • Build Settings의 INFOPLIST_FILE, CODE_SIGN_ENTITLEMENTS 경로와 Info.plist의 타깃 멤버십 예외 경로를 함께 수정했습니다.
  • Date+Format은 Presentation에서만 쓰여서 Presentation/Extension/으로 옮겼습니다.

[4] 여러 계층이 직접 사용하는 엔티티 Core/Entity로 이동
Coordinate, Coordinate+Distance, Place, PlaceType, TransportType, AppAsset, AppError

엔티티 Domain Data Presentation · Core에서 직접 사용하는 곳
Coordinate ChatContentType·RouteStep 필드, Location·NearbyPlace·ReverseGeocoding Repository와 UseCase CoreLocationRepository, Kakao 응답 매핑 지도 View 3종(PlaceSelectionMapView, LocationPreviewMapView, AppointmentRouteMapView), ChatBubbleBase 지도 버튼, PresentationModel 필드(ChatBubbleItem, AppointmentLocation, PlaceInfo, AppointmentRouteParticipant), Coordinator와 ScreenFactory 파라미터
Place Appointment·SharedPlace 필드, 장소 검색·약속 생성·수정·경로 검색 Repository와 UseCase Kakao 응답 매핑 SearchPlaceCardViewController·PlaceSelectionViewController 콜백, RouteSearchViewController init, Coordinator 5곳(Home, Chat, AppointmentList, RouteSearch 등), RouteSearchScreenFactory로 화면 사이에 전달
PlaceType Place 필드 KakaoPlaceResponse 카테고리 매핑 FilterTagBox, SearchPlaceCard 필터 UI, PlaceType+ 표시용 확장
TransportType User·RouteStep·RouteProgressSegment 필드, SearchRoutesUseCase UserDTO, ActivityKitRouteLiveActivityRepository TransportTypeSelectionBox, RouteSearchViewModel, TransportType+ 표시용 확장
AppAsset AppAssetRepository StorageAppAssetRepository UIImageView+AppAsset, AppAssetImageLoader
AppError DefaultSessionValidationService FirebaseErrorMapper, NetworkError, AppleSignInProvider LoginViewController.showLoginError, LoginViewModel, SearchPlaceCardViewModel

Coordinate+Distance는 PlaceSelectionViewModel의 거리 표시와 Mock Repository에서 쓰고 있어서 Coordinate와 함께 옮겼습니다.

[5] 삭제

  • Presentation/ViewController.swift: 프로젝트 생성 시 만들어진 빈 클래스이며, 참조하는 곳이 없습니다.

💬 리뷰 노트

엔티티를 Core로 옮기는 기준

"여러 계층에서 사용한다"는 것을 해당 계층이 엔티티를 변환하지 않고 그대로 다루는 경우로 정했습니다.

  • 사용으로 보지 않는 경우 (변환)
    • Data의 DTO ↔ 엔티티 매핑, Repository 구현이 엔티티를 반환하는 것
    • Presentation의 PresentationModel.init(엔티티:) 같은 변환 코드
    • ViewModel이 UseCase 결과를 변환하기 전까지 들고 있는 것
  • 사용으로 보는 경우
    • View나 ViewController가 엔티티를 직접 받는 것
    • 화면 사이에 엔티티를 그대로 넘기는 것(Coordinator, ScreenFactory 파라미터)
    • PresentationModel의 필드 타입으로 쓰는 것

이 기준으로 보면 Appointment, Chat, Route, RouteStep, SharedPlace, User, LocationSharingScope, 권한 상태 2종은 Presentation에서 변환 코드에만 등장해서 Domain에 남겼습니다. ChatContentType과 RouteCheckpoint 계열은 Domain과 Data에서만 쓰입니다.
Core로 옮긴 엔티티끼리만 서로 참조하도록 맞췄습니다. 예를 들어 Place의 필드인 Coordinate와 PlaceType도 Core에 있어서, Core/Entity에서 Domain을 참조하는 곳은 없습니다.

@sangYuLv
sangYuLv requested a review from snughnu October 9, 2026 10:54
@sangYuLv sangYuLv self-assigned this Oct 9, 2026
@sangYuLv
sangYuLv added this pull request to stack #35 October 12, 2026 10:58

@snughnu snughnu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다~~ 🙊

@sangYuLv
sangYuLv merged commit af66b6b into develop Oct 13, 2026
5 checks passed
@sangYuLv
sangYuLv deleted the WORK-60 branch October 13, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants