From edcd0cd5599782451c567b68fd0b433f2af7f6f0 Mon Sep 17 00:00:00 2001 From: cherry2250 Date: Mon, 27 Oct 2025 09:45:41 +0900 Subject: [PATCH] =?UTF-8?q?FSD=20=EC=95=84=ED=82=A4=ED=85=8D=EC=B2=98?= =?UTF-8?q?=EB=A1=9C=20=ED=94=84=EB=A1=9C=EC=A0=9D=ED=8A=B8=20=EA=B5=AC?= =?UTF-8?q?=EC=A1=B0=20=EB=A6=AC=ED=8C=A9=ED=86=A0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 주요 변경사항: - FSD(Feature-Sliced Design) 아키텍처 도입 - shared 레이어 구조 생성 (ui, lib, api, model, types, config) - 공통 UI 컴포넌트를 shared/ui로 이동 (Header, BottomNavigation, Loading, Toast) - 라이브러리 코드를 shared/lib로 이동 (theme-provider, react-query-provider, theme) - 모든 import 경로 업데이트하여 새로운 구조 반영 - 기존 components, lib 디렉토리 제거 - 빌드 검증 완료 향후 확장: - widgets: 복잡한 UI 블록 - features: 기능 단위 코드 - entities: 비즈니스 엔티티 🤖 Generated with Claude Code Co-Authored-By: Claude --- src/app/(main)/analytics/page.tsx | 2 +- src/app/(main)/events/page.tsx | 2 +- src/app/(main)/layout.tsx | 2 +- src/app/(main)/page.tsx | 2 +- src/app/layout.tsx | 4 +- src/components/layout/BottomNav.tsx | 54 ------------------- src/{ => shared}/lib/react-query-provider.tsx | 0 src/{ => shared}/lib/theme-provider.tsx | 2 +- src/{styles => shared/lib}/theme.ts | 0 .../layout => shared/ui}/BottomNavigation.tsx | 0 .../layout => shared/ui}/Header.tsx | 0 .../common => shared/ui}/Loading.tsx | 0 .../common => shared/ui}/Toast.tsx | 0 13 files changed, 7 insertions(+), 61 deletions(-) delete mode 100644 src/components/layout/BottomNav.tsx rename src/{ => shared}/lib/react-query-provider.tsx (100%) rename src/{ => shared}/lib/theme-provider.tsx (91%) rename src/{styles => shared/lib}/theme.ts (100%) rename src/{components/layout => shared/ui}/BottomNavigation.tsx (100%) rename src/{components/layout => shared/ui}/Header.tsx (100%) rename src/{components/common => shared/ui}/Loading.tsx (100%) rename src/{components/common => shared/ui}/Toast.tsx (100%) diff --git a/src/app/(main)/analytics/page.tsx b/src/app/(main)/analytics/page.tsx index 0a0cef5..7153c33 100644 --- a/src/app/(main)/analytics/page.tsx +++ b/src/app/(main)/analytics/page.tsx @@ -15,7 +15,7 @@ import { Payments, People, } from '@mui/icons-material'; -import Header from '@/components/layout/Header'; +import Header from '@/shared/ui/Header'; // Mock 데이터 const mockAnalyticsData = { diff --git a/src/app/(main)/events/page.tsx b/src/app/(main)/events/page.tsx index 0315f45..6fd894c 100644 --- a/src/app/(main)/events/page.tsx +++ b/src/app/(main)/events/page.tsx @@ -19,7 +19,7 @@ import { Grid, } from '@mui/material'; import { Search, FilterList } from '@mui/icons-material'; -import Header from '@/components/layout/Header'; +import Header from '@/shared/ui/Header'; // Mock 데이터 const mockEvents = [ diff --git a/src/app/(main)/layout.tsx b/src/app/(main)/layout.tsx index 3eb5704..cacab56 100644 --- a/src/app/(main)/layout.tsx +++ b/src/app/(main)/layout.tsx @@ -1,5 +1,5 @@ import { Box } from '@mui/material'; -import BottomNavigation from '@/components/layout/BottomNavigation'; +import BottomNavigation from '@/shared/ui/BottomNavigation'; export default function MainLayout({ children }: { children: React.ReactNode }) { return ( diff --git a/src/app/(main)/page.tsx b/src/app/(main)/page.tsx index 0a21128..d0de68c 100644 --- a/src/app/(main)/page.tsx +++ b/src/app/(main)/page.tsx @@ -21,7 +21,7 @@ import { Edit, CheckCircle, } from '@mui/icons-material'; -import Header from '@/components/layout/Header'; +import Header from '@/shared/ui/Header'; // Mock 사용자 데이터 (API 연동 전까지 임시 사용) const mockUser = { diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 3dc9e89..65d3c18 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,6 +1,6 @@ import type { Metadata, Viewport } from 'next'; -import { MUIThemeProvider } from '@/lib/theme-provider'; -import { ReactQueryProvider } from '@/lib/react-query-provider'; +import { MUIThemeProvider } from '@/shared/lib/theme-provider'; +import { ReactQueryProvider } from '@/shared/lib/react-query-provider'; import '@/styles/globals.css'; export const metadata: Metadata = { diff --git a/src/components/layout/BottomNav.tsx b/src/components/layout/BottomNav.tsx deleted file mode 100644 index 28788c6..0000000 --- a/src/components/layout/BottomNav.tsx +++ /dev/null @@ -1,54 +0,0 @@ -'use client'; - -import { usePathname, useRouter } from 'next/navigation'; -import { BottomNavigation, BottomNavigationAction, Paper } from '@mui/material'; -import HomeIcon from '@mui/icons-material/Home'; -import EventIcon from '@mui/icons-material/Event'; -import BarChartIcon from '@mui/icons-material/BarChart'; -import PersonIcon from '@mui/icons-material/Person'; - -export function BottomNav() { - const pathname = usePathname(); - const router = useRouter(); - - const navItems = [ - { label: '홈', icon: , value: '/' }, - { label: '이벤트', icon: , value: '/events' }, - { label: '분석', icon: , value: '/analytics' }, - { label: '프로필', icon: , value: '/profile' }, - ]; - - const currentValue = navItems.find((item) => item.value === pathname)?.value || '/'; - - return ( - - { - router.push(newValue); - }} - showLabels - sx={{ height: 60 }} - > - {navItems.map((item) => ( - - ))} - - - ); -} diff --git a/src/lib/react-query-provider.tsx b/src/shared/lib/react-query-provider.tsx similarity index 100% rename from src/lib/react-query-provider.tsx rename to src/shared/lib/react-query-provider.tsx diff --git a/src/lib/theme-provider.tsx b/src/shared/lib/theme-provider.tsx similarity index 91% rename from src/lib/theme-provider.tsx rename to src/shared/lib/theme-provider.tsx index acdc6a0..2052d7b 100644 --- a/src/lib/theme-provider.tsx +++ b/src/shared/lib/theme-provider.tsx @@ -3,7 +3,7 @@ import { ThemeProvider } from '@mui/material/styles'; import CssBaseline from '@mui/material/CssBaseline'; import { AppRouterCacheProvider } from '@mui/material-nextjs/v14-appRouter'; -import { theme } from '@/styles/theme'; +import { theme } from '@/shared/lib/theme'; import { ReactNode } from 'react'; export function MUIThemeProvider({ children }: { children: ReactNode }) { diff --git a/src/styles/theme.ts b/src/shared/lib/theme.ts similarity index 100% rename from src/styles/theme.ts rename to src/shared/lib/theme.ts diff --git a/src/components/layout/BottomNavigation.tsx b/src/shared/ui/BottomNavigation.tsx similarity index 100% rename from src/components/layout/BottomNavigation.tsx rename to src/shared/ui/BottomNavigation.tsx diff --git a/src/components/layout/Header.tsx b/src/shared/ui/Header.tsx similarity index 100% rename from src/components/layout/Header.tsx rename to src/shared/ui/Header.tsx diff --git a/src/components/common/Loading.tsx b/src/shared/ui/Loading.tsx similarity index 100% rename from src/components/common/Loading.tsx rename to src/shared/ui/Loading.tsx diff --git a/src/components/common/Toast.tsx b/src/shared/ui/Toast.tsx similarity index 100% rename from src/components/common/Toast.tsx rename to src/shared/ui/Toast.tsx