Skip to content

Commit 03026c7

Browse files
authored
Merge pull request #334 from manNomi/feat/bruno-sync
feat : bruno sync
2 parents bad109a + 8078dc1 commit 03026c7

234 files changed

Lines changed: 3888 additions & 2345 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/api-migration-prd.md

Lines changed: 328 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,328 @@
1+
# API 마이그레이션 PRD
2+
3+
> `src/api``src/apis` 완전 마이그레이션 ✅ **완료**
4+
5+
---
6+
7+
## 1. 개요
8+
9+
### 1.1 목표
10+
11+
`src/api` 폴더를 완전히 제거하고 `src/apis` 폴더로 통합하여 API 레이어를 단일화한다.
12+
13+
### 1.2 현황
14+
15+
| 폴더 | 상태 | 파일 수 | 설명 |
16+
| ---------- | ----------- | ------- | ---------------------------- |
17+
| `src/api` | ✅ 삭제됨 | 0개 | 완전 제거 완료 |
18+
| `src/apis` | ✅ 통합완료 | 70+개 | Bruno 기반 자동생성 + 커스텀 |
19+
20+
---
21+
22+
## 2. 마이그레이션 대상
23+
24+
### 2.1 도메인별 현황
25+
26+
| # | 도메인 | api 파일 | apis 존재 | 상태 | 비고 |
27+
| --- | ------------ | -------- | --------- | ------- | ----------------------- |
28+
| 1 | auth | 8 || ✅ 완료 | |
29+
| 2 | community | 9 || ✅ 완료 | postList SSR 추가 |
30+
| 3 | mentor | 7 || ✅ 완료 | mentee/mentors 통합 |
31+
| 4 | mentee | 4 || ✅ 완료 | mentor 폴더로 통합 |
32+
| 5 | mentors | 3 || ✅ 완료 | mentor 폴더로 통합 |
33+
| 6 | chat | 5 || ✅ 완료 | |
34+
| 7 | news | 7 || ✅ 완료 | optimistic updates 적용 |
35+
| 8 | score | 5 || ✅ 완료 | Scores 폴더로 통합 |
36+
| 9 | my | 4 || ✅ 완료 | MyPage 폴더로 통합 |
37+
| 10 | applications | 4 || ✅ 완료 | |
38+
| 11 | boards | 3 || ✅ 완료 | community로 통합 |
39+
| 12 | file | 1 || ✅ 완료 | image-upload로 통합 |
40+
| 13 | reports | 1 || ✅ 완료 | |
41+
42+
**총계**: 63개 파일 → 0개 (완전 제거) ✅
43+
44+
### 2.2 상세 파일 목록
45+
46+
#### auth (8개)
47+
48+
```
49+
src/api/auth/
50+
├── server/
51+
│ └── postReissueToken.ts # 서버사이드 유지 필요
52+
├── client/
53+
│ ├── usePostKakaoAuth.ts
54+
│ ├── usePostAppleAuth.ts
55+
│ ├── usePostEmailAuth.ts
56+
│ ├── usePostSignUp.ts
57+
│ ├── usePostEmailSignUp.ts
58+
│ ├── usePostLogout.ts
59+
│ └── useDeleteUserAccount.ts
60+
└── useLogin.ts
61+
```
62+
63+
#### community (9개)
64+
65+
```
66+
src/api/community/client/
67+
├── queryKey.ts
68+
├── useGetPostDetail.ts
69+
├── useCreatePost.ts
70+
├── useUpdatePost.ts
71+
├── useDeletePost.ts
72+
├── useCreateComment.ts
73+
├── useDeleteComment.ts
74+
├── usePostLike.ts
75+
└── useDeleteLike.ts
76+
```
77+
78+
#### mentor (7개)
79+
80+
```
81+
src/api/mentor/client/
82+
├── queryKey.ts
83+
├── useGetMentorMyProfile.ts
84+
├── usePutMyMentorProfile.ts
85+
├── usePostMentorApplication.ts
86+
├── useGetMentoringList.ts
87+
├── useGetMentoringUncheckedCount.ts
88+
├── usePatchMentorCheckMentorings.ts
89+
└── usePatchApprovalStatus.ts
90+
```
91+
92+
#### mentee (4개)
93+
94+
```
95+
src/api/mentee/client/
96+
├── queryKey.ts
97+
├── useGetApplyMentoringList.ts
98+
├── usePostApplyMentoring.ts
99+
└── usePatchMenteeCheckMentorings.ts
100+
```
101+
102+
#### mentors (3개)
103+
104+
```
105+
src/api/mentors/client/
106+
├── queryKey.ts
107+
├── useGetMentorList.ts
108+
└── useGetMentorDetail.ts
109+
```
110+
111+
#### chat (5개)
112+
113+
```
114+
src/api/chat/clients/
115+
├── queryKey.ts
116+
├── useGetChatRooms.ts
117+
├── useGetChatHistories.ts
118+
├── useGetPartnerInfo.ts
119+
└── usePutChatRead.ts
120+
```
121+
122+
#### news (7개)
123+
124+
```
125+
src/api/news/client/
126+
├── queryKey.ts
127+
├── useGetArticleList.ts
128+
├── usePostAddArticle.ts
129+
├── usePutModifyArticle.ts
130+
├── useDeleteArticle.ts
131+
├── usePostArticleLike.ts
132+
└── useDeleteArticleLike.ts
133+
```
134+
135+
#### score (5개)
136+
137+
```
138+
src/api/score/client/
139+
├── queryKey.ts
140+
├── useGetMyGpaScore.ts
141+
├── usePostGpaScore.ts
142+
├── useGetMyLanguageTestScore.ts
143+
└── usePostLanguageTestScore.ts
144+
```
145+
146+
#### my (4개)
147+
148+
```
149+
src/api/my/client/
150+
├── queryKey.ts
151+
├── useGetMyInfo.ts
152+
├── usePatchMyInfo.ts
153+
└── usePatchMyPassword.ts
154+
```
155+
156+
#### applications (4개)
157+
158+
```
159+
src/api/applications/client/
160+
├── queryKeys.ts
161+
├── useGetApplicationsList.ts
162+
├── usePostSubmitApplication.ts
163+
└── useGetCompetitorsApplicationList.ts
164+
```
165+
166+
#### boards (3개)
167+
168+
```
169+
src/api/boards/
170+
├── clients/
171+
│ ├── QueryKeys.ts
172+
│ └── useGetPostList.ts
173+
└── server/
174+
└── getPostList.ts
175+
```
176+
177+
#### file (1개)
178+
179+
```
180+
src/api/file/client/
181+
└── useUploadProfileImagePublic.ts
182+
```
183+
184+
#### reports (1개)
185+
186+
```
187+
src/api/reports/client/
188+
└── usePostReport.ts
189+
```
190+
191+
---
192+
193+
## 3. 마이그레이션 규칙
194+
195+
### 3.1 네이밍 컨벤션
196+
197+
| 항목 | Before (api) | After (apis) |
198+
| -------- | ------------------------ | ------------------------- |
199+
| Query 훅 | `useGetXxx.ts` | `useGetXxx.ts` (동일) |
200+
| Mutation | `usePostXxx.ts` | `usePostXxx.ts` (동일) |
201+
| QueryKey | `queryKey.ts` (도메인별) | `queryKeys.ts` (중앙집중) |
202+
| API 함수 | 훅 내부 정의 | `api.ts` 에서 export |
203+
| Import | `@/api/{domain}/client/` | `@/apis/{domain}/` |
204+
205+
### 3.2 QueryKey 통합
206+
207+
**Before** (각 도메인별 분산):
208+
209+
```typescript
210+
// src/api/community/client/queryKey.ts
211+
export enum QueryKeys {
212+
postDetail = "postDetail",
213+
postList = "postList",
214+
}
215+
```
216+
217+
**After** (중앙 집중):
218+
219+
```typescript
220+
// src/apis/queryKeys.ts
221+
export const QueryKeys = {
222+
community: {
223+
postDetail: "community.postDetail",
224+
postList: "community.postList",
225+
},
226+
// ...
227+
};
228+
```
229+
230+
### 3.3 비즈니스 로직 보존
231+
232+
마이그레이션 시 다음 로직은 **반드시** 보존:
233+
234+
- [ ] `router.push()` / `router.replace()` 리다이렉트
235+
- [ ] `toast.success()` / `toast.error()` 알림
236+
- [ ] `useAuthStore` 상태 관리
237+
- [ ] `queryClient.invalidateQueries()` 캐시 무효화
238+
- [ ] `onSuccess` / `onError` 콜백 로직
239+
240+
---
241+
242+
## 4. 작업 체크리스트
243+
244+
### 4.1 도메인별 체크리스트 템플릿
245+
246+
```markdown
247+
#### [도메인명] 마이그레이션
248+
249+
- [ ] api.ts URL/메서드 확인 및 수정
250+
- [ ] 훅 마이그레이션 (비즈니스 로직 보존)
251+
- [ ] QueryKey 통합
252+
- [ ] 컴포넌트 import 경로 변경
253+
- [ ] 서버사이드 API 처리 (해당시)
254+
- [ ] TypeScript 에러 확인
255+
- [ ] 기능 테스트
256+
- [ ] 레거시 파일 삭제
257+
```
258+
259+
### 4.2 전체 진행 상황
260+
261+
| 도메인 | 분석 | 마이그레이션 | 테스트 | 삭제 | 완료 |
262+
| ------------ | ---- | ------------ | ------ | ---- | ---- |
263+
| auth ||||||
264+
| community ||||||
265+
| mentor ||||||
266+
| mentee ||||||
267+
| mentors ||||||
268+
| chat ||||||
269+
| news ||||||
270+
| score ||||||
271+
| my ||||||
272+
| applications ||||||
273+
| boards ||||||
274+
| file ||||||
275+
| reports ||||||
276+
277+
**범례**: ⬜ 대기 | 🔄 진행중 | ✅ 완료
278+
279+
---
280+
281+
## 5. 우선순위
282+
283+
### 5.1 권장 순서
284+
285+
1. **auth** - 인증 로직, 가장 중요
286+
2. **my** - 내 정보, auth와 연관
287+
3. **community** - 커뮤니티 기능
288+
4. **mentor/mentee/mentors** - 멘토링 기능 (함께 진행)
289+
5. **chat** - 채팅 기능
290+
6. **news** - 뉴스/아티클
291+
7. **score** - 성적 관리
292+
8. **applications** - 지원 관리
293+
9. **boards** - 게시판
294+
10. **file** - 파일 업로드
295+
11. **reports** - 신고 기능
296+
297+
### 5.2 의존성 주의사항
298+
299+
- `auth/server/postReissueToken.ts` → axios interceptor에서 사용
300+
- `mentor/mentee` → QueryKey 공유 가능성 확인
301+
- `boards/community` → 유사 기능, 통합 검토
302+
303+
---
304+
305+
## 6. 완료 조건
306+
307+
- [x] `src/api` 폴더 완전 삭제
308+
- [x] 모든 import가 `@/apis/` 경로 사용
309+
- [ ] TypeScript 에러 0개 (일부 타입 추론 이슈 남음)
310+
- [ ] ESLint 에러 0개
311+
- [x] 빌드 성공
312+
- [x] 모든 기능 정상 동작
313+
314+
---
315+
316+
## 7. 커밋 컨벤션
317+
318+
```
319+
refactor: migrate {domain} from api to apis
320+
321+
- Migrate {N} hooks to apis/{domain}
322+
- Update component imports
323+
- Remove legacy api/{domain} folder
324+
```
325+
326+
---
327+
328+
**최종 수정일**: 2025-12-28

src/api/applications/client/queryKeys.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/api/applications/client/useGetApplicationsList.ts

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)