Skip to content

[refactor] 모노레포 구조 개선 및 기능 추가#7

Merged
toris-dev merged 32 commits intomainfrom
refactor/monorepo-fsd-cdd
Dec 18, 2025
Merged

[refactor] 모노레포 구조 개선 및 기능 추가#7
toris-dev merged 32 commits intomainfrom
refactor/monorepo-fsd-cdd

Conversation

@toris-dev
Copy link
Owner

@toris-dev toris-dev commented Dec 18, 2025

📌 변경 사항

이 PR은 모노레포 구조 개선 및 주요 기능 추가를 포함합니다.

문서 및 가이드

  • PR 규칙 및 커밋 컨벤션 가이드 추가 (한글)
  • README.md에 페이지별 역할 및 Mermaid 플로우도 추가
  • 프로젝트 문서 구조 재정리

모노레포 구조 개선

  • 크롤러 패키지 제거 및 구조 정리
  • 공유 패키지 구조 개선 (API, Shared, UI, User, Planner, Recommendation)
  • 모노레포 패키지 의존성 업데이트
  • 프로젝트 설정 파일 개선

웹 애플리케이션 개선

  • 페이지 컴포넌트 구조 개선
  • 코스 탐색 및 상세 페이지 기능 개선
  • 모바일 반응형 UI/UX 개선
  • 여행 계획 관리 기능 개선
  • 프로필 및 캘린더 기능 개선

새로운 기능 모듈

  • 지출 관리 API 및 컴포넌트
  • 구독 관리 API 및 컴포넌트
  • 즐겨찾기 기능
  • 게이미피케이션 패키지
  • 여행 계획 상세 API 엔드포인트

🔗 관련 이슈

이 PR은 모노레포 구조 개선 작업의 일부입니다.

🧪 테스트

  • 단위 테스트 통과
  • 통합 테스트 통과
  • 수동 테스트 완료
  • 모바일 환경 테스트 완료

✅ 체크리스트

  • 코드 리뷰 요청 전 자체 검토 완료
  • 린트 오류 없음 (pnpm lint)
  • 타입 오류 없음 (pnpm type-check)
  • 테스트 통과 (pnpm test)
  • 문서 업데이트 완료
  • 브레이킹 체인지 없음

📝 커밋 내역

  • docs(cursor): PR 규칙 및 커밋 컨벤션 가이드 추가
  • docs(readme): 페이지별 역할 및 플로우도 추가
  • chore: 프로젝트 설정 및 문서 구조 개선
  • refactor(monorepo): 크롤러 패키지 제거 및 admin 패키지 정리
  • chore(deps): 모노레포 패키지 의존성 업데이트
  • refactor(packages): 공유 패키지 구조 개선
  • chore(web): 웹 앱 설정 파일 업데이트
  • feat(web): 웹 애플리케이션 기능 개선 및 UI/UX 향상
  • feat(web): 새로운 기능 모듈 추가

Note

Introduce a new @lovetrip/user package with auth & profile UIs, a shared @lovetrip/ui component library, extensive web feature pages and API routes (auth, places, travel plans), update utilities (including a new calculateTotal API), add tests, Storybook, and modernize tooling (Next 16/React 19, ESLint) and repo scaffolding.

  • feat(user): new user/auth and profile package

    • Add packages/user with typed models (AuthFormData, AuthMode) and full auth UI: AuthForm, OAuthButtons, AuthModeToggle, login page and callback route.
    • New profile area: ProfilePage plus ProfileHeader, ProfileCard, ProfileStats, SettingsSection, and hooks (use-profile, use-email-change, use-password-change).
    • Add couple-connection component integrating @lovetrip/couple services and Supabase client.
    • Export user modules via packages/user/index.ts; add packages/user/eslint.config.mjs; add tests and mocks.
  • feat(ui): introduce reusable UI kit

    • New @lovetrip/ui package with components: Button, Card, Alert, Avatar, Dialog, Dropdown, MenuBar, Input, Textarea, Tabs, Table, Accordion, Carousel, HoverCard, Pagination, Select, Slider, Chart, Toast, Sidebar, AspectRatio, etc.
    • Add Storybook config (.storybook/main.ts, preview.ts) and example stories for Button, Card.
    • Shared design tokens under packages/ui/tokens and styles/.
  • apps/web: new features & pages

    • Add profile area (/profile, /profile/date) with client components and hooks; profile stats, settings, couple connection UI.
    • Implement travel planner feature (packages/planner/*), travel pages/components (travel-page-client, travel-sidebar, course-info-overlay, use-travel-courses, use-recommended-places).
    • Add favorites and courses pages/components; Naver Map integration (naver-map-view components), PWA install banner, header.
    • Add API routes under apps/web/src/app/api: auth notifications, geocode, places (find/create/list/favorite), travel plans (CRUD, days, expenses, settlement), user profile endpoints.
    • Add calendar feature components/hooks and tests; Cypress e2e specs (home.cy.ts, button.cy.ts).
  • chore/build & tooling

    • Create packages/utils with cn, formatDate, formatCurrency, and a new calculateTotal returning {planned, actual}; export via packages/utils/index.ts.
    • Update root and per-package ESLint configs; add @eslint/js, typescript-eslint, globals; bump next to 16.0.7, react to 19.2.1, @supreme/supabase-js to 2.87.x, and add Storybook, Vite, Cypress.
    • Add @lovetrip/api, @lovetrash/couple, @lovetrip/gamification packages and server/SSR clients; update pnpm-lock.yaml.
    • Add .cursor development helper prompts and PR guidelines; update README.md and add docs (SMTP_SETUP, SUPABASE_TABLES, project-plan).

Written by Cursor Bugbot for commit 2935ff5. This will update automatically on new commits. Configure here.

- 커플 관련 기능을 packages/couple로 분리
- 여행 계획 관련 기능을 packages/planner로 분리
- 추천 시스템을 packages/recommendation로 분리
- 사용자 관련 기능을 packages/user로 분리
- API 클라이언트를 packages/api로 분리
- 유틸리티 함수를 packages/utils로 분리
- UI 컴포넌트를 packages/ui/components로 이동
- 스타일 시스템을 packages/ui/styles로 이동
- 디자인 토큰을 packages/ui/tokens로 이동
- 기존 apps/web/src/components/ui 파일 삭제
- 데이터베이스 타입을 packages/shared/types/database.ts로 이동
- 공통 타입을 packages/shared/types/index.ts로 통합
- 유틸리티 함수를 packages/shared/utils로 이동
- 기존 apps/web/src/lib/types, utils 파일 삭제
- 기능별 컴포넌트를 apps/web/src/components/features로 이동
- 레이아웃 컴포넌트를 apps/web/src/components/layout로 이동
- 공유 컴포넌트를 apps/web/src/components/shared로 이동
- 기존 컴포넌트 파일들을 새로운 구조에 맞게 재배치
- 모든 페이지에서 새로운 패키지 import 경로로 변경
- @lovetrip/ui, @lovetrip/planner, @lovetrip/couple 등 패키지 사용
- 기존 lib/services, lib/supabase 경로를 packages로 변경
- 컴포넌트 import 경로를 새로운 FSD 구조에 맞게 수정
- package.json에 새로운 패키지 의존성 추가
- tsconfig.json에 패키지 경로 매핑 추가
- next.config.mjs에 패키지 트랜스파일 설정 추가
- eslint.config.mjs를 새로운 구조에 맞게 업데이트
- pnpm-lock.yaml 업데이트
- 각 패키지에 package.json, tsconfig.json, eslint.config.mjs 추가
- 패키지 간 의존성 설정
- TypeScript 경로 매핑 설정
- ARCHITECTURE.md: 아키텍처 문서 추가
- REFACTORING_PLAN.md: 리팩토링 계획 문서 추가
- DEPLOYMENT.md: 배포 가이드 추가
- TESTING.md: 테스트 가이드 추가
- README.md 업데이트: 새로운 패키지 구조 반영
- 테스트 파일의 import 경로를 새로운 패키지 구조에 맞게 수정
- Service Worker 스크립트 업데이트
- globals.css를 새로운 구조에 맞게 수정
- .gitignore 업데이트
- Cypress E2E 테스트 설정 추가
- Storybook 설정 추가
- Tailwind CSS 설정 파일 추가
- 디자인 시스템 구조 추가
- 프록시 설정 추가
- 루트 ESLint 설정 추가
- apps/web/src/components/ui 파일들 삭제 (packages/ui로 이동)
- apps/web/src/lib/services 파일들 삭제 (packages로 이동)
- apps/web/src/lib/supabase 파일들 삭제 (packages/api로 이동)
- apps/web/src/lib/types 파일 삭제 (packages/shared로 이동)
- 기존 컴포넌트 파일들 삭제 (새로운 구조로 재배치)
- apps/web/.eslintrc.json 삭제 (eslint.config.mjs로 대체)
- .env.production 파일을 .gitignore에 추가하여 배포 환경 설정을 무시하도록 업데이트
- 캘린더 그리드 및 이벤트 리스트 모바일 반응형 개선
- 사이드바 모바일에서 drawer 형태로 변경
- 이벤트 클릭 시 상세보기 다이얼로그 표시
- 상세보기 다이얼로그에서 이벤트 삭제 기능 통합
- Button 컴포넌트 import 추가
- 여행 계획 생성 시 '여행 일정' 캘린더에 자동으로 이벤트 추가
- 여행 계획의 시작일과 종료일을 기반으로 이벤트 생성
- 데이트 코스와 여행 코스를 단일 페이지로 통합
- 쿼리 파라미터로 코스 타입 전환 (type=date, type=travel)
- 지도 우측 상단에 코스 타입 전환 버튼 추가
- 코스 만들기 버튼 색상을 purple-pink gradient로 변경하여 구분
- 사이드바 top-[64px] 제거하여 전체 높이 사용
- Footer에서 지원 섹션 삭제
- 내 프로필, 내 여행 링크 제거
- 그리드 레이아웃 조정
- /profile, /calendar, /my-trips 경로 인증 보호
- 로그인한 사용자가 /login 접근 시 리다이렉트
- proxy.ts 제거 (middleware.ts로 통합)
- page.tsx를 Server Component로 전환
- 프로필 통계 및 데이터 서버 사이드에서 페칭
- 클라이언트 로직을 ProfilePageClient로 분리
- 'AI가 추천하는 맞춤형 데이트 코스' 텍스트 제거
GitHub PR 규칙과 Google Commit Convention 가이드를 한글로 작성하여 .cursor/rules에 추가했습니다.

주요 내용:
- PR 작성 가이드라인 및 템플릿
- 커밋 메시지 형식 및 예시
- 브랜치 전략 및 리뷰 프로세스
README.md에 페이지별 역할 설명과 Mermaid 플로우도를 추가했습니다.

주요 내용:
- 페이지별 역할 및 주요 기능 상세 설명
- 전체 사용자 플로우 다이어그램
- 코스 공개 및 보상 플로우 시퀀스 다이어그램
- 여행 계획 및 예산 관리 플로우 다이어그램
프로젝트 설정 파일과 문서 구조를 개선했습니다.

주요 변경사항:
- .gitignore 업데이트
- GitHub Actions 워크플로우 추가
- 문서 구조 재정리 (docs/ 폴더)
- 스크립트 파일 추가 및 정리
- 루트 tsconfig.json 추가
모노레포 구조에 맞게 패키지 의존성을 업데이트했습니다.

주요 변경사항:
- 루트 및 각 패키지의 package.json 업데이트
- pnpm workspace 의존성 정리
- TypeScript 설정 파일 업데이트
모노레포 공유 패키지들의 구조를 개선했습니다.

주요 변경사항:
- API 패키지: Supabase 클라이언트 구조 개선
- Shared 패키지: 타입 정의 및 상수 정리
- UI 패키지: 컴포넌트 구조 개선
- User 패키지: 인증 관련 코드 정리
- Planner 패키지: 여행 서비스 로직 개선
- Recommendation 패키지: 추천 서비스 구조 개선
Next.js 웹 애플리케이션의 설정 파일을 업데이트했습니다.

주요 변경사항:
- Next.js 설정 업데이트
- Tailwind CSS 설정 개선
- Vitest 테스트 설정 업데이트
- 테스트 파일 구조 개선
웹 애플리케이션의 주요 기능을 개선하고 UI/UX를 향상시켰습니다.

주요 변경사항:
- 페이지 컴포넌트 구조 개선
- 코스 탐색 및 상세 페이지 기능 개선
- 모바일 반응형 UI/UX 개선
- 여행 계획 관리 기능 개선
- 프로필 및 캘린더 기능 개선
- PWA 서비스 워커 업데이트
- 공유 컴포넌트 개선 (지도, PWA 설치 등)
새로운 기능 모듈을 추가했습니다.

주요 추가 기능:
- 지출 관리 API 및 컴포넌트
- 구독 관리 API 및 컴포넌트
- 즐겨찾기 기능
- 게이미피케이션 패키지
- 여행 계획 상세 API 엔드포인트
크롤러 패키지를 제거하고 admin 패키지를 정리했습니다.

주요 변경사항:
- packages/crawler 패키지 완전 제거
- admin 패키지의 크롤러 관련 코드 제거
- admin 패키지 구조 개선
@vercel
Copy link

vercel bot commented Dec 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
love-trip Ready Ready Preview, Comment Dec 18, 2025 10:56am

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

// 정확히 일치하는 것이 없으면 첫 번째 결과 사용
if (!placeId && existingPlaces.length > 0) {
placeId = existingPlaces[0].id
}
Copy link

Choose a reason for hiding this comment

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

Bug: Fallback place matching ignores coordinates

When no exact name match with nearby coordinates is found, the code falls back to using the first result from a partial name search (ilike("name", "%${name}%")) without validating the coordinates. This means searching for a place like "서울타워" (Seoul Tower) could incorrectly return "부산 서울타워호텔" (a hotel in Busan) if that entry appears first in the query results, associating a completely unrelated place in a different city with the user's trip.

Fix in Cursor Fix in Web

Copy link

Choose a reason for hiding this comment

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

Bug: Expense split delete error not checked before insert

The delete operation for existing expense splits does not check for errors before proceeding to insert new splits. If the delete fails (due to RLS policies, constraints, or database issues), the code continues to insert new split records anyway. This could result in duplicate expense splits in the database, causing the total split amounts to exceed the actual expense amount and corrupting financial data integrity.

Fix in Cursor Fix in Web

PR 리뷰 피드백 반영:
- 장소 검색 시 부분 매치 결과들에 대한 좌표 검증 로직 개선
- 사용하지 않는 region 파라미터 제거
- 지출 분할 삭제 시 에러 처리 추가
.cursor 폴더 구조를 개선하고 개발 가이드를 추가했습니다.

주요 변경사항:
- COMMIT_CONVENTION.md와 PR_GUIDELINES.md를 commands 폴더로 이동
- Supabase, 에러 처리, 보안 관련 규칙 추가
- 패키지 생성 및 Supabase 설정 가이드 추가
- index.txt 업데이트로 새로운 규칙 파일 참조 추가
.cursor/rules에서 commands로 파일 이동으로 인해 삭제된 파일들을 처리했습니다.
이미 이전 커밋에서 새 위치로 이동되었습니다.
Copy link

Choose a reason for hiding this comment

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

Bug: XP threshold calculation off-by-one error

The xpToNextLevel calculation uses (gamification.level + 1) * xpPerLevel, but the reward service in packages/gamification/services/reward-service.ts uses level * xpPerLevel. This creates an off-by-one error where users see incorrect XP thresholds. For example, a level 1 user would see they need 2000 XP to reach level 2, when the actual threshold is 1000 XP. The formula here differs from the authoritative level calculation in the gamification package.

Fix in Cursor Fix in Web

- xpToNextLevel 계산의 off-by-one 오류 수정 (level + 1 → level)
- gamification 필드의 null 타입 오류 수정 (기본값 제공)
- getUserCourses 반환 타입 변환 및 기본값 처리

주요 변경사항:
- reward-service.ts와 일치하도록 xpToNextLevel 계산 수정
- level, currentXP, totalXP, points, streak 필드에 null 체크 추가
- course_type 타입 단언 및 created_at 기본값 처리
@toris-dev toris-dev merged commit edea216 into main Dec 18, 2025
3 checks passed
@toris-dev toris-dev deleted the refactor/monorepo-fsd-cdd branch December 18, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments