[#20] Refactor API to use Prisma for matches, players, seasons, stats, and teams #21
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.
개요
Supabase 클라이언트를 직접 사용하는 기존 API 레이어를 Prisma 기반 Next.js API Routes로 완전히 마이그레이션하여 타입 안전성과 성능을 개선했습니다.
🔄 변경사항 요약
✨ 주요 개선사항
any
타입 제거 및 Prisma 타입 추론 활용🗂️ 파일 변경사항
📁 새로 생성된 파일들
src/app/api/matches/[id]/goals/route.ts
- 매치 골 조회 APIsrc/app/api/matches/[id]/lineups/route.ts
- 매치 라인업 조회 APIsrc/app/api/seasons/[id]/summary/route.ts
- 시즌 요약 조회 APIsrc/app/api/stats/standings/route.ts
- 순위표 조회 APIsrc/app/api/stats/player-season/route.ts
- 선수 시즌 통계 조회 APIsrc/app/api/players/route.ts
- 선수 조회 APIsrc/app/api/seasons/route.ts
- 시즌 조회 API🗑️ 삭제된 파일들
src/features/matches/api.ts
- Supabase 기반 매치 APIsrc/features/stats/api.ts
- Supabase 기반 통계 APIsrc/features/players/api.ts
- Supabase 기반 선수 APIsrc/features/seasons/api.ts
- Supabase 기반 시즌 APIsrc/features/teams/api.ts
- Supabase 기반 팀 API🔧 수정된 파일들
prisma/schema.prisma
- 참조 무결성 규칙 수정src/features/matches/components/SeasonSummaryTable.tsx
- API 참조 변경src/features/stats/components/StandingsTable.tsx
- 타입 안전성 개선🛠️ 기술적 세부사항
Prisma 스키마 수정
타입 안전성 개선
조건부 쿼리 패턴 도입
개선 효과
✅ 타입 안전성
✅ 성능 최적화
✅ 유지보수성
테스트 체크리스트
성능 개선
🔍 코드 리뷰 포인트
any
타입이 제거되었는지 확인