Skip to content

Supabase 환경 변수와 API 클라이언트 설정 업데이트#15

Merged
yoouyeon merged 2 commits intohotfix/supabase-mock-apifrom
hotfix/connect-supabase
Jan 13, 2026
Merged

Supabase 환경 변수와 API 클라이언트 설정 업데이트#15
yoouyeon merged 2 commits intohotfix/supabase-mock-apifrom
hotfix/connect-supabase

Conversation

@yoouyeon
Copy link
Contributor

@yoouyeon yoouyeon commented Jan 13, 2026

💻 작업 내용

supabase edge function을 사용하기 위한 변경사항입니다.

  • 환경변수 변경
    • VITE_SERVER_URL : supabase 서버 경로로 변경
    • VITE_SUPABASE_PUBLIC_KEY : 게스트 로그인 요청에서 헤더에 추가하는 public key
  • axios instance 설정 변경
    • 경로 변경 (api -> functions)
    • 게스트 로그인 요청일 때 public key를 헤더에 추가하는 설정

빠르게 배포해야 하는만큼 coderabbit 리뷰만 받고 머지하겠습니다!

Summary by CodeRabbit

릴리스 노트

  • Chores
    • API 엔드포인트 라우팅 경로가 업데이트되었습니다.
    • 인증 관련 요청 처리 메커니즘이 개선되었습니다.
    • 배포 워크플로우의 환경 설정이 최적화되었습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

- api 요청 경로를 api에서 functions로 변경
- 토큰 발급 요청에 apikey 헤더 포함하도록 설정 추가
@yoouyeon yoouyeon self-assigned this Jan 13, 2026
@yoouyeon yoouyeon added ✨ Feature 신규 기능 추가 ⚙️ CI/CD 빌드·배포 파이프라인 🔥 Hotfix 긴급 수정 labels Jan 13, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2026

📝 Walkthrough

Walkthrough

환경 변수 설정과 API 클라이언트 구성을 업데이트했습니다. CI/CD 워크플로우에 Supabase 공개 키를 추가했고, Axios 인스턴스의 기본 URL을 함수 엔드포인트로 변경하며, 게스트 토큰 요청 시 API 키를 자동으로 첨부하는 로직을 구현했습니다.

Changes

집단 / 파일 변경 사항
CI/CD 워크플로우 구성
​.github/workflows/prod-ci-cd.yml
Build 단계에 VITE_SUPABASE_PUBLIC_KEY 환경 변수 추가, CD 워크플로우 조건에서 불필요한 공백 제거
API 클라이언트 구성
src/shared/api/axios.ts
기본 URL 경로를 /api/v1에서 /functions/v1로 변경, user/guest/token 요청에 대한 조건부 분기 추가로 VITE_SUPABASE_PUBLIC_KEY에서 apikey 헤더 자동 첨부

Suggested labels

🧹 Chore

Poem

🐰 Supabase의 열쇠를 들고,
API 경로를 새로 단장하니,
게스트 토큰이 반가워하네!
환경 변수가 춤을 추고,
요청들은 안전한 길로 향한다. ✨

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@yoouyeon yoouyeon marked this pull request as ready for review January 13, 2026 13:19
@github-actions github-actions bot requested a review from ongheong January 13, 2026 13:20
@yoouyeon yoouyeon removed the request for review from ongheong January 13, 2026 13:20
@yoouyeon
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai bot changed the title @coderabbitai 제목 환경 변수와 API 클라이언트 설정 업데이트 Jan 13, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/shared/api/axios.ts (1)

30-36: URL 매칭 방식이 깨지기 쉬울 수 있습니다.

endsWith('user/guest/token')는 URL에 쿼리 파라미터(?foo=bar)나 trailing slash가 붙는 경우 매칭에 실패할 수 있습니다. 현재로서는 문제없을 수 있지만, 향후 확장성을 고려해 더 견고한 매칭 방식을 권장합니다.

♻️ 제안하는 수정 방안
-    else if (newConfig.url?.endsWith('user/guest/token')) {
+    else if (newConfig.url?.includes('user/guest/token')) {

또는 정규식을 사용하여 더 명확하게 매칭할 수 있습니다:

-    else if (newConfig.url?.endsWith('user/guest/token')) {
+    else if (/user\/guest\/token(?:\?|$)/.test(newConfig.url ?? '')) {
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 43ffd5e and 7378662.

📒 Files selected for processing (2)
  • .github/workflows/prod-ci-cd.yml
  • src/shared/api/axios.ts
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-28T04:24:56.857Z
Learnt from: yoouyeon
Repo: moddo-kr/moddo-frontend PR: 12
File: src/pages/login/LoginEntranceView.tsx:13-20
Timestamp: 2025-12-28T04:24:56.857Z
Learning: Guideline: Do not pass raw numbers for spacing props (e.g., gap, padding, margin) to the Flex component. If the design system uses tokenized spacing (theme.unit[...] ), derive spacing from design tokens instead of hard-coded numbers only if the component expects a direct number. In this case, the correct usage is to pass plain numbers (e.g., 16) directly for spacing props used by Flex, rather than theme.unit[16]. Apply this consistently across TSX files where Flex spacing props are used. This improves readability and ensures consistent spacing values align with design tokens.

Applied to files:

  • src/shared/api/axios.ts
🔇 Additional comments (3)
src/shared/api/axios.ts (1)

5-5: LGTM!

Supabase Edge Functions 엔드포인트(/functions/v1)로의 baseURL 변경이 올바르게 적용되었습니다.

.github/workflows/prod-ci-cd.yml (2)

51-51: LGTM!

Supabase 공개 키가 CI/CD 환경 변수에 올바르게 추가되었습니다.

GitHub 저장소 Settings > Secrets에 VITE_SUPABASE_PUBLIC_KEY 시크릿이 설정되어 있는지 확인해 주세요. 설정되지 않은 경우 빌드 시 apikey 헤더가 빈 값으로 설정될 수 있습니다.


62-62: LGTM!

포맷팅 정리 확인했습니다.

@yoouyeon yoouyeon changed the title 환경 변수와 API 클라이언트 설정 업데이트 Supabase 환경 변수와 API 클라이언트 설정 업데이트 Jan 13, 2026
@yoouyeon yoouyeon merged commit 39f8568 into hotfix/supabase-mock-api Jan 13, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚙️ CI/CD 빌드·배포 파이프라인 ✨ Feature 신규 기능 추가 🔥 Hotfix 긴급 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant