Skip to content

[refactor] study 관련 파일 분리#143

Merged
Mimiminz merged 16 commits intodevelopfrom
refactor/study-file-separate
Sep 14, 2025
Merged

[refactor] study 관련 파일 분리#143
Mimiminz merged 16 commits intodevelopfrom
refactor/study-file-separate

Conversation

@Mimiminz
Copy link
Contributor

@Mimiminz Mimiminz commented Sep 4, 2025

☘️ 작업 내용

이전에 말했던 study 관련 파일 분리를 진행했습니다.
파일은 크게 세 가지로 분류됩니다.

interview

  • 오늘의 스터디 상세
  • 면접 준비
  • 면접 완료
  • 인터뷰 후기

participation

  • 스터디 신청
  • 다음주차 스터디 참여 리스트

schedule

  • 캘린더
  • 매칭 결과 리스트
  • 스터디 주간 참여 유무 확인

크게 위와 같이 분류하였습니다.
오늘의 스터디 상세는 interview와 schedule 중 고민하였으나,
interview에서 비교적 많은 빈도로 사용되는 것으로 확인되어 interview 폴더에 두었습니다.
혹시 다른 의견이나 수정해야 할 부분 있다면 코멘트 남겨주시는 대로 반영하겠습니다.

해당 pr에서 코드의 위치, import 구문, 주석 외에 변경된 코드는 없기 때문에 위치만 봐주시면 될 것 같습니다!

🍀 참고사항

긍정/부정 키워드 코드 관련해서 질문이 있습니다.

negativeKeywords.map((keyword) => (
                  <KeywordReview
                    key={keyword.id}
                    content={keyword.content}
                    count={keyword.count}
                  />
                ))

해당 형태의 코드인데, yarn build 시 keyword 부분에서 Parameter 'keyword' implicitly has an 'any' type.이라는 오류가 발생합니다.
오류가 발생하는 파일은 크게 두가지 입니다.

  • @/entity/user/ui/user-profile-modal.tsx
  • app/(my)/my-study-review/page.tsx

일단 저에게만 해당 오류가 발생하는지 여쭤보고,
만약 동일하게 오류가 발생한다면, 이 부분은 담당하신 분이 수아님(@aken-you)이시기에 여쭤보고 수정을 진행하려 합니다.

추가적으로 수아님이 올리신 pr#142에서 widgets/home 파일에서 컨플릭트가 발생하는 부분이 있기 때문에 수아님 pr 이 적용되면 제가 컨플릭트 해결 후 올리려고 합니다.

코드가 바뀐 부분에서 겹치는 것이 widget/home 파일의 import 밖에 없기 때문에 컨플릭트 해결은 어렵지 않을 것 같습니다!

@aken-you
Copy link
Contributor

aken-you commented Sep 4, 2025

우선 오류가 발생하는 부분 원인만 봤어요!

아래 사진에서 타입들이 ./interview-types 파일에 존재해요! 현재 참조하고 있는 파일은 사라졌더라구요

before
스크린샷 2025-09-04 오후 10 54 57

after

스크린샷 2025-09-04 오후 11 03 02

그리고 요 부분도 경로를 수정해야 할 것 같아요!

before
스크린샷 2025-09-04 오후 10 57 56

after
스크린샷 2025-09-04 오후 11 03 22

@Mimiminz
Copy link
Contributor Author

Mimiminz commented Sep 5, 2025

get-review 파일의 경우 파일 경로 수정 완료했습니다!
다만 today-study-card의 경우 경로를 수정해뒀는데, 수아님쪽에서 반영이 안되어있는 것 같습니다..! 한 번 확인 부탁드립니다

  • 수아님 파일의 경로를 보니, 삭제한 파일들이 남아있는 것 같은데
    커밋에 삭제한 파일이 반영이 안된건지 한 번 확인해보고 다시 남기도록 하겠습니다.

Copy link
Contributor

@aken-you aken-you left a comment

Choose a reason for hiding this comment

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

다만 today-study-card의 경우 경로를 수정해뒀는데, 수아님쪽에서 반영이 안되어있는 것 같습니다..!

이 부분은 제 쪽에서 반영이 안됐던 것 같아요! 확인했습니다.

저는 지금 study의 세개의 서브 도메인으로 나눈 기준이 적절하다고 생각합니다!
interview에서 participation 코드를 참고할 때에는 그냥 import해서 사용하면 되는지도 맞춰봐야할 것 같아요

import UserAvatar from '@/shared/ui/avatar';
import Badge from '@/shared/ui/badge';
import { Modal } from '@/shared/ui/modal';
import { useUserPositiveKeywordsQuery } from '@/features/study/interview/model/use-review-query';
Copy link
Contributor

Choose a reason for hiding this comment

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

여기도 entities 레이어에서 features 상위 레이어 코드를 사용하고 있습니다 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

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

저도 이 부분 고민이 됐던 부분입니다....
entity 레이어가 아닌 interview feature로 이동하는 게 좋을까요?

다만 이후 프로필 모달 관련해서 다른 feature로 나뉘는 것들이 들어갈거라 생각되는데 (신고, 경고점수, 스터디 관련 등등)

interview feature로 이동해도, 이후 다른 폴더를 참조할 것 같고 그렇다고 리뷰 관련된 것들을 entity 레이어로 옮기는 것도 맞는지 고민이 되네요..

수아님은 어떻게 생각하시나요?

Copy link
Contributor

Choose a reason for hiding this comment

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

작성한 코멘트가 날라갔었나보네요..

UserProfileModal이 features에 있는 use*Query로 데이터를 fetching하고 있어서 어떤 곳에 둬야할지 애매해진 것 같아요..

저는 entities는 도메인 데이터와 관련된 코드를 두고, features는 특정 기능을 수행할 수 있는 코드를 두는걸로 entities와 features를 나눴습니다.
이 모달은 특정 기능을 수행하는 것보다 도메인 데이터와 더 가까워 entities/user에 이 모달을 두는게 적절하다고 생각했습니다.
근데, 사용자 정보를 보여주는 모달이니까 특정 기능을 수행하는거 아닌가? 라고도 볼 수 있을 것 같아요 😓

우선 이 모달이 하는 역할이 무엇인지에 따라 어떤 레이어에 둘 지 정할 수 있을 것 같습니다.
민주님 생각은 어떠신가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

저도 이 모달이 특정 기능 수행보다는, 도메인 데이터에 더 가깝다고 생각했습니다...
그래서 user entity에 두니 상위 레이어 코드를 사용한다는 문제점이 있네요...🤔

아니면, 위젯 계층으로 이동하는 건 어떨까요?
위젯은 여러 페이지에서 재사용되는 경우에 유용하기도 하고, 프로필 모달은 사용자 플로우가 클릭 정도만 있는 모달이라 오히려 위젯 계층에 맞는 UI인가 싶은 생각이드네요...

Comment on lines 6 to 7
import { useReviewReminder } from '@/features/study/interview/lib/use-reminder-review';
import StudyReviewModal from '@/features/study/interview/ui/study-review-modal';
Copy link
Contributor

Choose a reason for hiding this comment

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

entities 레이어에서 features 상위 레이어 코드를 사용하고 있습니다 👀

{ label: '불참', value: 'ABSENT' },
{ label: '진행중', value: 'IN_PROGRESS' },
{ label: '완료', value: 'COMPLETE' },
];
Copy link
Contributor

Choose a reason for hiding this comment

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

다른 const 관련 파일들 suffix가 다 -const이던데, 혹시 컨벤션인걸까요?!
이미 const 폴더에 있으니 파일 명은 interview.ts로 하는 건 어떨까요?

Copy link
Contributor Author

@Mimiminz Mimiminz Sep 6, 2025

Choose a reason for hiding this comment

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

사실 붙이는 이유가 나중에 전역 검색 시 헷갈릴 것 같아 다 붙여두었습니다.
interview-types.ts, interview-const.ts 처럼요.
하지만 말씀 주신대로 이미 폴더가 나뉘어져있는 상태고 파일명이 중복되어 좀 장황해보일 수 있다는 생각이 듭니다.

다만 고민인 부분은, types나 schema에서는 interview-types. interview.schema와 같이 작성중인데, 이와 맞추기 위해 const도 뒤에 -const를 붙였습니다.

타입이나 스키마도 그렇다면 일치시키는 게 맞다고 생각되는데, 두 경우는 상위 폴더명이 type이나 schema가 아니기 때문에 조금 헷갈릴 수 있다는 생각이 듭니다.

수아님 생각은 어떠신가요? 모두 일치시키는 게 나을지, const만 -const를 제외하고 작성하는 게 좋을지 의견을 여쭙고 싶습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

제 생각에는 상위 폴더가 성격을 말해주는 경우에는 말씀하신대로 interview.ts 만 적고,
파일의 종류만 말해야 하는 경우는 interview-types.ts 말고 types.ts 만 적는 식으로 종류만 파일명으로 적는 건 어떻게 생각하시나요?

Copy link
Contributor

Choose a reason for hiding this comment

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

사실 붙이는 이유가 나중에 전역 검색 시 헷갈릴 것 같아 다 붙여두었습니다.
interview-types.ts, interview-const.ts 처럼요.

이런 히스토리가 있는줄 몰랐습니다! 그렇다면, -const로 통일시키는 게 좋을 것 같아요.

import UserAvatar from '@/shared/ui/avatar';
import Badge from '@/shared/ui/badge';
import { Modal } from '@/shared/ui/modal';
import { useUserPositiveKeywordsQuery } from '@/features/study/interview/model/use-review-query';
Copy link
Contributor

Choose a reason for hiding this comment

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

작성한 코멘트가 날라갔었나보네요..

UserProfileModal이 features에 있는 use*Query로 데이터를 fetching하고 있어서 어떤 곳에 둬야할지 애매해진 것 같아요..

저는 entities는 도메인 데이터와 관련된 코드를 두고, features는 특정 기능을 수행할 수 있는 코드를 두는걸로 entities와 features를 나눴습니다.
이 모달은 특정 기능을 수행하는 것보다 도메인 데이터와 더 가까워 entities/user에 이 모달을 두는게 적절하다고 생각했습니다.
근데, 사용자 정보를 보여주는 모달이니까 특정 기능을 수행하는거 아닌가? 라고도 볼 수 있을 것 같아요 😓

우선 이 모달이 하는 역할이 무엇인지에 따라 어떤 레이어에 둘 지 정할 수 있을 것 같습니다.
민주님 생각은 어떠신가요?

@Mimiminz Mimiminz marked this pull request as ready for review September 14, 2025 07:42
@Mimiminz Mimiminz merged commit e11cf19 into develop Sep 14, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants