# PHASE 12: Next.js 15 App Router Pages Migration **Status:** ⬜ Not Started **Estimated Time:** 45-55 hours **Priority:** CRITICAL **Depends On:** All previous phases (1-11) **Blocks:** Phase 13 (Next.js Optimization) --- ## 🎯 Goal Convert ALL React SPA pages to Next.js 15 App Router pages while replacing Supabase calls with Django services. This is a DUAL migration: 1. **React → Next.js App Router**: Convert pages and routing 2. **Supabase → Django**: Replace all data fetching **Critical Requirements:** - Preserve ALL existing URLs - Maintain exact same UI/UX - Use Server Components by default - Mark Client Components with 'use client' - Sacred Pipeline remains intact --- ## 📋 Next.js App Router Structure ### New Directory Structure ``` app/ ├── layout.tsx # Root layout ├── page.tsx # Homepage ├── loading.tsx # Global loading ├── error.tsx # Global error ├── not-found.tsx # 404 page │ ├── parks/ │ ├── page.tsx # /parks (listing) │ ├── loading.tsx # Loading state │ ├── [parkSlug]/ │ │ ├── page.tsx # /parks/[parkSlug] │ │ ├── loading.tsx │ │ └── rides/ │ │ └── page.tsx # /parks/[parkSlug]/rides │ └── owners/ │ └── [ownerSlug]/ │ └── page.tsx # /owners/[ownerSlug]/parks │ ├── rides/ │ ├── page.tsx # /rides (listing) │ ├── [rideSlug]/ │ │ ├── page.tsx # /rides/[rideSlug] │ │ └── reviews/ │ │ └── page.tsx # /rides/[rideSlug]/reviews │ └── models/ │ └── [modelSlug]/ │ ├── page.tsx # /ride-models/[modelSlug] │ └── rides/ │ └── page.tsx # /ride-models/[modelSlug]/rides │ ├── manufacturers/ │ ├── page.tsx # /manufacturers (listing) │ └── [manufacturerSlug]/ │ ├── page.tsx # /manufacturers/[manufacturerSlug] │ └── rides/ │ └── page.tsx # /manufacturers/[manufacturerSlug]/rides │ ├── owners/ │ ├── page.tsx # /owners (listing) │ └── [ownerSlug]/ │ └── page.tsx # /owners/[ownerSlug] │ ├── designers/ │ ├── page.tsx # /designers (listing) │ └── [designerSlug]/ │ └── page.tsx # /designers/[designerSlug] │ ├── auth/ │ ├── login/ │ │ └── page.tsx │ ├── register/ │ │ └── page.tsx │ └── callback/ │ └── page.tsx │ ├── profile/ │ ├── page.tsx # /profile │ ├── settings/ │ │ └── page.tsx │ └── lists/ │ └── page.tsx │ ├── admin/ │ ├── page.tsx # /admin │ └── moderation/ │ └── page.tsx # /admin/moderation │ ├── search/ │ └── page.tsx # /search │ └── contact/ └── page.tsx # /contact ``` --- ## 📋 Tasks ### Task 12.1: Root Layout & Homepage (6 hours) #### Create Root Layout `app/layout.tsx` (Server Component): ```typescript import { Inter } from 'next/font/google'; import './globals.css'; import { AuthProvider } from '@/components/providers/AuthProvider'; import { Navigation } from '@/components/layout/Navigation'; import { Footer } from '@/components/layout/Footer'; const inter = Inter({ subsets: ['latin'] }); export const metadata = { title: 'ThrillWiki - Theme Park & Ride Database', description: 'Comprehensive database of theme parks and rides', }; export default function RootLayout({ children, }: { children: React.ReactNode; }) { return (
{children}