refactor: 폴더 구조 재편 (Phase 1)
- api/: common/, pc/common/, pc/public/, pc/admin/ 구조로 변경 - components/: pc/public/, pc/admin/ 구조로 변경 - hooks/: common/, pc/admin/ 구조로 변경 - pages/: pc/public/, mobile/ 구조로 변경 - confetti.js를 utils/로 이동 - 모든 import 경로 업데이트 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
58f359adfa
commit
67a41d78ea
67 changed files with 105 additions and 133 deletions
|
|
@ -6,33 +6,34 @@ import { BrowserView, MobileView } from 'react-device-detect';
|
|||
import { ScrollToTop } from '@/components/common';
|
||||
|
||||
// PC 레이아웃
|
||||
import { Layout as PCLayout } from '@/components/pc';
|
||||
import { Layout as PCLayout } from '@/components/pc/public';
|
||||
|
||||
// Mobile 레이아웃
|
||||
import { Layout as MobileLayout } from '@/components/mobile';
|
||||
|
||||
// 페이지
|
||||
import { PCHome, MobileHome } from '@/pages/home';
|
||||
import { PCMembers, MobileMembers } from '@/pages/members';
|
||||
import {
|
||||
PCSchedule,
|
||||
MobileSchedule,
|
||||
PCScheduleDetail,
|
||||
MobileScheduleDetail,
|
||||
PCBirthday,
|
||||
MobileBirthday,
|
||||
} from '@/pages/schedule';
|
||||
import {
|
||||
PCAlbum,
|
||||
MobileAlbum,
|
||||
PCAlbumDetail,
|
||||
MobileAlbumDetail,
|
||||
PCTrackDetail,
|
||||
MobileTrackDetail,
|
||||
PCAlbumGallery,
|
||||
MobileAlbumGallery,
|
||||
} from '@/pages/album';
|
||||
import { PCNotFound, MobileNotFound } from '@/pages/common';
|
||||
// PC 페이지
|
||||
import PCHome from '@/pages/pc/public/home/Home';
|
||||
import PCMembers from '@/pages/pc/public/members/Members';
|
||||
import PCSchedule from '@/pages/pc/public/schedule/Schedule';
|
||||
import PCScheduleDetail from '@/pages/pc/public/schedule/ScheduleDetail';
|
||||
import PCBirthday from '@/pages/pc/public/schedule/Birthday';
|
||||
import PCAlbum from '@/pages/pc/public/album/Album';
|
||||
import PCAlbumDetail from '@/pages/pc/public/album/AlbumDetail';
|
||||
import PCTrackDetail from '@/pages/pc/public/album/TrackDetail';
|
||||
import PCAlbumGallery from '@/pages/pc/public/album/AlbumGallery';
|
||||
import PCNotFound from '@/pages/pc/public/common/NotFound';
|
||||
|
||||
// Mobile 페이지
|
||||
import MobileHome from '@/pages/mobile/home/Home';
|
||||
import MobileMembers from '@/pages/mobile/members/Members';
|
||||
import MobileSchedule from '@/pages/mobile/schedule/Schedule';
|
||||
import MobileScheduleDetail from '@/pages/mobile/schedule/ScheduleDetail';
|
||||
import MobileBirthday from '@/pages/mobile/schedule/Birthday';
|
||||
import MobileAlbum from '@/pages/mobile/album/Album';
|
||||
import MobileAlbumDetail from '@/pages/mobile/album/AlbumDetail';
|
||||
import MobileTrackDetail from '@/pages/mobile/album/TrackDetail';
|
||||
import MobileAlbumGallery from '@/pages/mobile/album/AlbumGallery';
|
||||
import MobileNotFound from '@/pages/mobile/common/NotFound';
|
||||
|
||||
/**
|
||||
* PC 환경에서 body에 클래스 추가하는 래퍼
|
||||
|
|
|
|||
1
frontend-temp/src/api/common/index.js
Normal file
1
frontend-temp/src/api/common/index.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from './client';
|
||||
|
|
@ -2,30 +2,19 @@
|
|||
* API 통합 export
|
||||
*/
|
||||
|
||||
// 클라이언트
|
||||
export {
|
||||
fetchApi,
|
||||
fetchAuthApi,
|
||||
fetchFormData,
|
||||
ApiError,
|
||||
get,
|
||||
authGet,
|
||||
post,
|
||||
authPost,
|
||||
put,
|
||||
authPut,
|
||||
del,
|
||||
authDel,
|
||||
} from './client';
|
||||
// 공통 유틸리티
|
||||
export * from './common/client';
|
||||
|
||||
// 인증
|
||||
export * as authApi from './auth';
|
||||
// 공개 API
|
||||
export * as scheduleApi from './pc/public/schedules';
|
||||
export * as albumApi from './pc/public/albums';
|
||||
export * as memberApi from './pc/common/members';
|
||||
|
||||
// 스케줄
|
||||
export * as scheduleApi from './schedules';
|
||||
// 관리자 API
|
||||
export * as authApi from './pc/admin/auth';
|
||||
|
||||
// 앨범
|
||||
export * as albumApi from './albums';
|
||||
|
||||
// 멤버
|
||||
export * as memberApi from './members';
|
||||
// 개별 함수도 export (하위 호환성)
|
||||
export * from './pc/public/schedules';
|
||||
export * from './pc/public/albums';
|
||||
export * from './pc/common/members';
|
||||
export * from './pc/admin/auth';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* 인증 API
|
||||
* 관리자 인증 API
|
||||
*/
|
||||
import { fetchApi, fetchAuthApi } from './client';
|
||||
import { fetchApi, fetchAuthApi } from '@/api/common/client';
|
||||
|
||||
/**
|
||||
* 로그인
|
||||
1
frontend-temp/src/api/pc/admin/index.js
Normal file
1
frontend-temp/src/api/pc/admin/index.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from './auth';
|
||||
1
frontend-temp/src/api/pc/common/index.js
Normal file
1
frontend-temp/src/api/pc/common/index.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from './members';
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* 멤버 API
|
||||
*/
|
||||
import { fetchApi, fetchAuthApi, fetchFormData } from './client';
|
||||
import { fetchApi, fetchAuthApi, fetchFormData } from '@/api/common/client';
|
||||
|
||||
// ==================== 공개 API ====================
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* 앨범 API
|
||||
*/
|
||||
import { fetchApi, fetchAuthApi, fetchFormData } from './client';
|
||||
import { fetchApi, fetchAuthApi, fetchFormData } from '@/api/common/client';
|
||||
|
||||
// ==================== 공개 API ====================
|
||||
|
||||
2
frontend-temp/src/api/pc/public/index.js
Normal file
2
frontend-temp/src/api/pc/public/index.js
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
export * from './schedules';
|
||||
export * from './albums';
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* 스케줄 API
|
||||
*/
|
||||
import { fetchApi, fetchAuthApi, fetchFormData } from './client';
|
||||
import { fetchApi, fetchAuthApi, fetchFormData } from '@/api/common/client';
|
||||
import { getTodayKST, dayjs } from '@/utils';
|
||||
|
||||
/**
|
||||
|
|
@ -1,11 +1,8 @@
|
|||
// 공통 컴포넌트 (디바이스 무관)
|
||||
export * from './common';
|
||||
|
||||
// 스케줄 컴포넌트
|
||||
export * from './schedule';
|
||||
|
||||
// PC 컴포넌트
|
||||
export * as PC from './pc';
|
||||
export * as PC from './pc/public';
|
||||
|
||||
// Mobile 컴포넌트
|
||||
export * as Mobile from './mobile';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,2 @@
|
|||
// 공용 함수
|
||||
export { fireBirthdayConfetti } from './confetti';
|
||||
|
||||
// 관리자 컴포넌트
|
||||
export { default as AdminScheduleCard } from './AdminScheduleCard';
|
||||
28
frontend-temp/src/hooks/common/index.js
Normal file
28
frontend-temp/src/hooks/common/index.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// 미디어 쿼리
|
||||
export { useMediaQuery, useIsMobile, useIsDesktop, useIsTablet } from './useMediaQuery';
|
||||
|
||||
// 멤버 데이터
|
||||
export { useMembers, useMemberDetail } from './useMemberData';
|
||||
|
||||
// 앨범 데이터
|
||||
export { useAlbums, useAlbumDetail, useAlbumGallery } from './useAlbumData';
|
||||
|
||||
// 스케줄 데이터
|
||||
export {
|
||||
useScheduleData,
|
||||
useScheduleDetail,
|
||||
useUpcomingSchedules,
|
||||
useCategories,
|
||||
} from './useScheduleData';
|
||||
|
||||
// 스케줄 검색
|
||||
export { useScheduleSearch } from './useScheduleSearch';
|
||||
|
||||
// 스케줄 필터링
|
||||
export { useScheduleFiltering, useCategoryCounts } from './useScheduleFiltering';
|
||||
|
||||
// 캘린더
|
||||
export { useCalendar } from './useCalendar';
|
||||
|
||||
// 라이트박스
|
||||
export { useLightbox } from './useLightbox';
|
||||
|
|
@ -2,31 +2,8 @@
|
|||
* 훅 통합 export
|
||||
*/
|
||||
|
||||
// 미디어 쿼리
|
||||
export { useMediaQuery, useIsMobile, useIsDesktop, useIsTablet } from './useMediaQuery';
|
||||
// 공통 훅
|
||||
export * from './common';
|
||||
|
||||
// 멤버 데이터
|
||||
export { useMembers, useMemberDetail } from './useMemberData';
|
||||
|
||||
// 앨범 데이터
|
||||
export { useAlbums, useAlbumDetail, useAlbumGallery } from './useAlbumData';
|
||||
|
||||
// 스케줄 데이터
|
||||
export {
|
||||
useScheduleData,
|
||||
useScheduleDetail,
|
||||
useUpcomingSchedules,
|
||||
useCategories,
|
||||
} from './useScheduleData';
|
||||
|
||||
// 스케줄 검색
|
||||
export { useScheduleSearch } from './useScheduleSearch';
|
||||
|
||||
// 스케줄 필터링
|
||||
export { useScheduleFiltering, useCategoryCounts } from './useScheduleFiltering';
|
||||
|
||||
// 캘린더
|
||||
export { useCalendar } from './useCalendar';
|
||||
|
||||
// 인증
|
||||
export { useAdminAuth, useRedirectIfAuthenticated } from './useAdminAuth';
|
||||
// 관리자 훅
|
||||
export * from './pc/admin';
|
||||
|
|
|
|||
2
frontend-temp/src/hooks/pc/admin/index.js
Normal file
2
frontend-temp/src/hooks/pc/admin/index.js
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
// 관리자 인증
|
||||
export { useAdminAuth, useRedirectIfAuthenticated } from './useAdminAuth';
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
export { default as PCAlbum } from './pc/Album';
|
||||
export { default as MobileAlbum } from './mobile/Album';
|
||||
export { default as PCAlbumDetail } from './pc/AlbumDetail';
|
||||
export { default as MobileAlbumDetail } from './mobile/AlbumDetail';
|
||||
export { default as PCTrackDetail } from './pc/TrackDetail';
|
||||
export { default as MobileTrackDetail } from './mobile/TrackDetail';
|
||||
export { default as PCAlbumGallery } from './pc/AlbumGallery';
|
||||
export { default as MobileAlbumGallery } from './mobile/AlbumGallery';
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
// PC
|
||||
export { default as PCNotFound } from './pc/NotFound';
|
||||
|
||||
// Mobile
|
||||
export { default as MobileNotFound } from './mobile/NotFound';
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
export { default as PCHome } from './pc/Home';
|
||||
export { default as MobileHome } from './mobile/Home';
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
// 홈 페이지
|
||||
export * from './home';
|
||||
|
||||
// 멤버 페이지
|
||||
export * from './members';
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
export { default as PCMembers } from './pc/Members';
|
||||
export { default as MobileMembers } from './mobile/Members';
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import { motion } from 'framer-motion';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { getAlbums } from '@/api/albums';
|
||||
import { getAlbums } from '@/api';
|
||||
|
||||
/**
|
||||
* Mobile 앨범 목록 페이지
|
||||
|
|
@ -13,7 +13,7 @@ import {
|
|||
FileText,
|
||||
ChevronRight,
|
||||
} from 'lucide-react';
|
||||
import { getAlbumByName } from '@/api/albums';
|
||||
import { getAlbumByName } from '@/api';
|
||||
import { formatDate, calculateTotalDuration } from '@/utils';
|
||||
import { MobileLightbox } from '@/components/common';
|
||||
|
||||
|
|
@ -3,7 +3,7 @@ import { useParams, useNavigate } from 'react-router-dom';
|
|||
import { useQuery } from '@tanstack/react-query';
|
||||
import { ChevronRight } from 'lucide-react';
|
||||
import { motion } from 'framer-motion';
|
||||
import { getAlbumByName } from '@/api/albums';
|
||||
import { getAlbumByName } from '@/api';
|
||||
import { MobileLightbox } from '@/components/common';
|
||||
|
||||
/**
|
||||
|
|
@ -3,7 +3,7 @@ import { useParams, useNavigate, Link } from 'react-router-dom';
|
|||
import { useQuery } from '@tanstack/react-query';
|
||||
import { motion } from 'framer-motion';
|
||||
import { Clock, User, Music, Mic2, ChevronDown, ChevronUp } from 'lucide-react';
|
||||
import { getTrack } from '@/api/albums';
|
||||
import { getTrack } from '@/api';
|
||||
import { getYoutubeVideoId, parseCredits } from '@/utils';
|
||||
|
||||
/**
|
||||
|
|
@ -2,7 +2,7 @@ import { useParams, Link } from 'react-router-dom';
|
|||
import { useQuery } from '@tanstack/react-query';
|
||||
import { motion } from 'framer-motion';
|
||||
import { ChevronLeft } from 'lucide-react';
|
||||
import { fetchApi } from '@/api/client';
|
||||
import { fetchApi } from '@/api';
|
||||
|
||||
/**
|
||||
* Mobile 생일 페이지
|
||||
|
|
@ -7,7 +7,7 @@ import { useInView } from 'react-intersection-observer';
|
|||
import { useVirtualizer } from '@tanstack/react-virtual';
|
||||
|
||||
import { getTodayKST, getCategoryInfo } from '@/utils';
|
||||
import { getSchedules, searchSchedules } from '@/api/schedules';
|
||||
import { getSchedules, searchSchedules } from '@/api';
|
||||
import { useScheduleStore } from '@/stores';
|
||||
import { MIN_YEAR, SEARCH_LIMIT } from '@/constants';
|
||||
import {
|
||||
|
|
@ -16,7 +16,7 @@ import {
|
|||
ScheduleSearchCard as MobileScheduleSearchCard,
|
||||
BirthdayCard as MobileBirthdayCard,
|
||||
} from '@/components/mobile';
|
||||
import { fireBirthdayConfetti } from '@/components/schedule';
|
||||
import { fireBirthdayConfetti } from '@/utils';
|
||||
|
||||
/**
|
||||
* 모바일 일정 페이지
|
||||
|
|
@ -4,8 +4,9 @@ import { useEffect, useState, useRef } from 'react';
|
|||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { Calendar, Clock, ChevronLeft, Link2, X, ChevronRight } from 'lucide-react';
|
||||
import Linkify from 'react-linkify';
|
||||
import { getSchedule } from '@/api/schedules';
|
||||
import { CATEGORY_ID, decodeHtmlEntities, formatFullDate, formatTime, formatXDateTime } from '../sections/utils';
|
||||
import { getSchedule } from '@/api';
|
||||
import { CATEGORY_ID } from '@/constants';
|
||||
import { decodeHtmlEntities, formatFullDate, formatTime, formatXDateTime } from '@/utils';
|
||||
|
||||
/**
|
||||
* 전체화면 시 자동 가로 회전 훅 (숏츠가 아닐 때만)
|
||||
|
|
@ -2,7 +2,7 @@ import { useQuery } from '@tanstack/react-query';
|
|||
import { useNavigate } from 'react-router-dom';
|
||||
import { motion } from 'framer-motion';
|
||||
import { Calendar, Music } from 'lucide-react';
|
||||
import { getAlbums } from '@/api/albums';
|
||||
import { getAlbums } from '@/api';
|
||||
import { formatDate } from '@/utils';
|
||||
|
||||
/**
|
||||
|
|
@ -3,7 +3,7 @@ import { useParams, useNavigate } from 'react-router-dom';
|
|||
import { useQuery } from '@tanstack/react-query';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { Calendar, Music2, Clock, X, MoreVertical, FileText } from 'lucide-react';
|
||||
import { getAlbumByName } from '@/api/albums';
|
||||
import { getAlbumByName } from '@/api';
|
||||
import { formatDate, calculateTotalDuration } from '@/utils';
|
||||
import { Lightbox } from '@/components/common';
|
||||
|
||||
|
|
@ -5,7 +5,7 @@ import { motion, AnimatePresence } from 'framer-motion';
|
|||
import { X, ChevronLeft, ChevronRight, Download } from 'lucide-react';
|
||||
import { RowsPhotoAlbum } from 'react-photo-album';
|
||||
import 'react-photo-album/rows.css';
|
||||
import { getAlbumByName } from '@/api/albums';
|
||||
import { getAlbumByName } from '@/api';
|
||||
import { LightboxIndicator } from '@/components/common';
|
||||
|
||||
// 갤러리 CSS 스타일
|
||||
|
|
@ -3,7 +3,7 @@ import { useParams, useNavigate, Link } from 'react-router-dom';
|
|||
import { useQuery } from '@tanstack/react-query';
|
||||
import { motion } from 'framer-motion';
|
||||
import { Clock, User, Music, Mic2, ChevronRight } from 'lucide-react';
|
||||
import { getTrack } from '@/api/albums';
|
||||
import { getTrack } from '@/api';
|
||||
import { getYoutubeVideoId, parseCredits } from '@/utils';
|
||||
|
||||
/**
|
||||
|
|
@ -3,7 +3,7 @@ import { motion } from 'framer-motion';
|
|||
import { Link } from 'react-router-dom';
|
||||
import { Calendar, ArrowRight, Music } from 'lucide-react';
|
||||
import { useMembers, useAlbums, useUpcomingSchedules } from '@/hooks';
|
||||
import { ScheduleCard } from '@/components/pc';
|
||||
import { ScheduleCard } from '@/components/pc/public';
|
||||
import { GROUP_INFO } from '@/constants';
|
||||
|
||||
/**
|
||||
|
|
@ -2,7 +2,7 @@ import { useParams, Link } from 'react-router-dom';
|
|||
import { useQuery } from '@tanstack/react-query';
|
||||
import { motion } from 'framer-motion';
|
||||
import { ChevronRight } from 'lucide-react';
|
||||
import { fetchApi } from '@/api/client';
|
||||
import { fetchApi } from '@/api';
|
||||
|
||||
/**
|
||||
* PC 생일 페이지
|
||||
|
|
@ -11,9 +11,9 @@ import {
|
|||
CategoryFilter,
|
||||
ScheduleCard,
|
||||
BirthdayCard,
|
||||
} from '@/components/pc';
|
||||
import { fireBirthdayConfetti } from '@/components/schedule';
|
||||
import { getSchedules, searchSchedules } from '@/api/schedules';
|
||||
} from '@/components/pc/public';
|
||||
import { fireBirthdayConfetti } from '@/utils';
|
||||
import { getSchedules, searchSchedules } from '@/api';
|
||||
import { useScheduleStore } from '@/stores';
|
||||
import { getTodayKST } from '@/utils';
|
||||
import { SEARCH_LIMIT } from '@/constants';
|
||||
|
|
@ -2,7 +2,7 @@ import { useParams, Link } from 'react-router-dom';
|
|||
import { useQuery, keepPreviousData } from '@tanstack/react-query';
|
||||
import { motion } from 'framer-motion';
|
||||
import { Calendar, ChevronRight } from 'lucide-react';
|
||||
import { getSchedule } from '@/api/schedules';
|
||||
import { getSchedule } from '@/api';
|
||||
|
||||
// 섹션 컴포넌트들
|
||||
import { YoutubeSection, XSection, DefaultSection, CATEGORY_ID, decodeHtmlEntities } from '../sections';
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
export { default as PCSchedule } from './pc/Schedule';
|
||||
export { default as MobileSchedule } from './mobile/Schedule';
|
||||
export { default as PCScheduleDetail } from './pc/ScheduleDetail';
|
||||
export { default as MobileScheduleDetail } from './mobile/ScheduleDetail';
|
||||
export { default as PCBirthday } from './pc/Birthday';
|
||||
export { default as MobileBirthday } from './mobile/Birthday';
|
||||
|
|
@ -54,3 +54,6 @@ export {
|
|||
groupSchedulesByDate,
|
||||
countByCategory,
|
||||
} from './schedule';
|
||||
|
||||
// 애니메이션 관련
|
||||
export { fireBirthdayConfetti } from './confetti';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue