-
Notifications
You must be signed in to change notification settings - Fork 0
[♻️ Refactor] user 코드 개선 - ("use client" 버전) #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aahreum
wants to merge
17
commits into
ahreum
Choose a base branch
from
ahreum-refactor
base: ahreum
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
looks32
reviewed
Dec 10, 2025
Contributor
looks32
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
어떻게든 리뷰해보려고 몇번을 읽어보았는데
변화하는 것들이 너무 많고 기존의 것을 가져오시다보니
이전의 히스토리도 엮여있는 게 있고
구체적으로 어떤것이 변화하였는지 표기로도 알 수 없어서
흐름이 이해가 가지 않아서 리뷰하기 어려울 것 같습니다.
내일 자세한 얘기를 들으면 더 좋을 것 같습니다!
고생 많으셨습니다!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
👀 작업 개요
🔥 주요 변경 사항
1. 레이어 구조 분리 (Clean Architecture)
아래와 같이 user 도메인을 application / domain / infrastructure / ui로 재구성했습니다.
2. Infrastructure Layer 분리
✔ user.api.ts
기존 페이지 안에 있던 API 호출을 인프라 계층으로 이동
✔ user.dto.ts
서버 응답 모델(DTO)을 별도 파일로 분리
✔ tokenStorage.ts
localStorage 직접 접근을 UI에서 제거하고 인프라 계층으로 이동
3. Application Layer 생성 (Use Case)
application layer의 역할을 아직 잘 이해를 못 한 것 같긴 합니다..
UI가 applicationLayer만 호출해야해서 연결하는 역할로 getUserData 함수를 실행하는 함수를 추가했습니다.
4. UI Layer에서 데이터 패칭 로직 제거
useUserProfile 훅을 만들어 UI 레이어에서 데이터 패칭을 담당하던 로직을 이 훅에서 관리하도록 변경했습니다.
테스트 결과
accessToken 없을 때 (/not-found로 이동)
accessToken 있을 때