/app ├ layout.tsx # 전체 공통 레이아웃 ├ page.tsx # 홈 페이지 └ /about └ page.tsx # About 페이지 /components ├ AppBar.tsx ├ SideDrawer.tsx └ Footer.tsx /styles └ globals.css
app/layout.tsx
// app/layout.tsx
import'./globals.css'
importAppBarfrom'app/components/AppBar'
importSideDrawerfrom'app/components/SideDrawer'
importFooterfrom'app/components/Footer'
importtype { Metadata } from'next'
exportconstmetadata:Metadata= {
title:'My Blog',
description:'A simple blog with Next.js App Router',
}
exportdefaultfunctionRootLayout({ children }: { children:React.ReactNode }) {
return (
<htmllang="en">
<bodyclassName="flex flex-col min-h-screen">
<AppBar/>
<divclassName="flex flex-1">
<SideDrawer/>
<mainclassName="flex-1 p-4">{children}</main>
</div>
<Footer/>
</body>
</html>
)
}
app/page.tsx
// app/page.tsx
exportdefaultfunctionHome() {
return (
<div>
<h1className="text-2xl font-bold mb-4">Welcome to My Blog</h1>
<p>This is the homepage using the Next.js app directory.</p>