This document outlines the migration from Next.js Pages Router to App Router structure.
- Before:
pages/directory with file-based routing - After:
app/directory with folder-based routing and layout support
app/
├── layout.tsx # Root layout (replaces _app.js)
├── page.tsx # Home page (replaces index.js)
├── contact/
│ └── page.tsx # Contact page
├── work/
│ └── page.tsx # Work/Projects page
├── project/
│ └── [slug]/
│ └── page.tsx # Dynamic project pages
├── certifications/
│ └── page.tsx # Certifications page
├── services/
│ └── page.tsx # Services page
├── vinyl/
│ └── page.tsx # Vinyl collection page
└── api/
├── send-email/
│ └── route.ts # Email API route
└── spotify/
└── route.ts # Spotify API route
- Migrated from JavaScript to TypeScript
- Added comprehensive type definitions in
types/directory - Type-safe component props and API responses
components/
├── ui/ # Reusable UI components
│ ├── MotionDiv.tsx # Client-side motion wrapper
│ └── ColorModeValues.tsx # Color mode helper
├── layouts/ # Layout components
│ └── Navbar.tsx # Navigation component
└── forms/ # Form components
└── ContactForm.tsx # Contact form
- Pages: All pages are now Server Components by default
- Data Fetching: Direct async functions instead of
getStaticProps/getServerSideProps - Client Components: Marked with
'use client'directive where needed
- Before:
<Head>component in each page - After:
metadataexport from page components - SEO optimization with structured metadata
- Before:
pages/api/with default export functions - After:
app/api/with named export functions (GET,POST, etc.) - Better TypeScript support and request/response handling
- Server-side data fetching by default
- Reduced client-side JavaScript bundle
- Better performance with streaming and parallel data fetching
- Complete TypeScript coverage
- Proper type definitions for:
- Project data structures
- API request/response types
- Component props
- Service configurations
- Structured metadata API
- Better Open Graph support
- Improved Twitter Card integration
npm install
# or
yarn installnpm run dev
# or
yarn devnpm run build
npm start
# or
yarn build
yarn start- Dark Mode Support - Full Chakra UI theme integration
- Responsive Design - Mobile-first approach maintained
- Static Generation - Optimized for static site generation
- Image Optimization - Next.js Image component integration
- API Integration - SendGrid email and Spotify API support
- All functionality from the original Pages Router implementation has been preserved
- Performance improvements through server-side rendering and reduced client-side JavaScript
- Better developer experience with TypeScript and improved file organization
- Backward compatibility maintained for all external integrations
If you encounter issues:
- Clear Next.js cache:
rm -rf .next - Reinstall dependencies:
rm -rf node_modules && npm install - Check TypeScript compilation:
npx tsc --noEmit
For specific issues, refer to the Next.js App Router documentation.