-
Notifications
You must be signed in to change notification settings - Fork 3
[Dev 77] Axios, Zustand 초기 세팅 #88
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
Conversation
Walkthrough이번 PR은 Changes
Sequence Diagram(s)sequenceDiagram
participant C as Client
participant A as apiClient (Axios)
participant S as Server
C->>A: API 요청 (엔드포인트 사용)
A->>S: HTTP 요청 전송
S-->>A: 응답 반환
A-->>C: 응답 전달
Suggested reviewers
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/services/endPoint.ts (1)
1-12
: API 엔드포인트 구조가 잘 정리되어 있습니다!전반적인 구조가 기능별로 잘 구분되어 있어 관리하기 좋습니다.
다만 몇 가지 개선사항을 제안드립니다:
- API 버전 관리를 위해 경로에 버전을 추가하는 것이 좋습니다.
- 엔드포인트 경로의 명명 규칙을 일관되게 유지하는 것이 좋습니다.
다음과 같이 수정하는 것을 고려해보세요:
export const apiEndPoint = { auth: { - login: "/auth/login", - signUp: "/auth/signup", + login: "/v1/auth/login", + signUp: "/v1/auth/sign-up", }, goal: { - getGoals: "/goals", + getGoals: "/v1/goals", }, todo: { - getTodos: "/todos", + getTodos: "/v1/todos", }, };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (3)
package.json
(3 hunks)src/lib/axios.ts
(1 hunks)src/services/endPoint.ts
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- src/lib/axios.ts
🔇 Additional comments (1)
package.json (1)
76-78
: TypeScript 관련 패키지들이 적절하게 추가되었습니다.
ts-jest
,ts-node
,typescript
패키지들이devDependencies
에 올바르게 추가되었습니다.
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.
고생하셨습니다
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.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/services/endpoint.ts (2)
2-5
: API 버전 관리 도입을 고려해보세요.현재 엔드포인트에 버전 정보가 없습니다. API 버전 관리를 위해 다음과 같은 구조를 제안드립니다:
AUTH: { - LOGIN: "/api/login", - SIGNUP: "/api/signup", + LOGIN: "/api/v1/login", + SIGNUP: "/api/v1/signup", },
6-12
: ID 타입 안전성 강화를 제안드립니다.목표(goal) ID의 타입이
number
로 지정되어 있습니다. 더 명확한 타입 정의를 위해 다음과 같은 개선을 고려해보세요:type GoalId = number; // 사용 예시: GET_BY_ID: (id: GoalId) => `/api/goals/${id}`,이렇게 하면:
- ID의 의미가 더 명확해집니다
- 추후 ID 형식 변경 시 용이합니다
- 타입 재사용이 가능합니다
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/services/endpoint.ts
(1 hunks)
🔇 Additional comments (1)
src/services/endpoint.ts (1)
1-1
: 타입 안전성이 잘 보장된 구조입니다!
as const
사용으로 타입 안전성이 보장되며, 계층적 구조가 명확합니다.Also applies to: 17-17
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.
수고하셨습니다!
📑 작업 개요
✨ 작업 이유
📌 작업 내용
.env.local
에NEXT_PUBLIC_SERVER_ADDRESS
로 서버 주소용 변수 만들어서 사용해주시면 됩니다.store
디렉토리 생성해두었습니다.🤝🏻 해당 부분을 중점적으로 리뷰해주세요!
services/endpoint.ts
에서 서버로 보낼 요청들의 엔드포인트를 모아서 관리하면 어떨까요? 현재 만들어둔 파일이 예시입니다!혹시 더 좋은 방법이 있다면 알려주세요🙂
🎟️ 관련 이슈
close: #87
Summary by CodeRabbit
새로운 기능
코드 정비
@tanstack/react-query-devtools
및zustand
패키지가 추가되었습니다.