Skip to content

Migrate from Pages Router to App Router #940

@DarshanCode2005

Description

@DarshanCode2005

Summary

The conference website is currently using the legacy Next.js Pages Router (pages/), while running Next.js 16. Since Next.js 13.4, the App Router (app/) has been the recommended routing system, and all new features are being built for it.

This issue tracks the migration from Pages Router to App Router using the official migration approach.

This migration can be done incrementally, so there is no need for a risky “big bang” rewrite.


Why migrate now?

Reduce future migration effort

Every new page or feature built on the Pages Router will eventually need to be rewritten. Migrating now prevents additional migration debt.

Improve contributor experience

Most modern Next.js tutorials, documentation, and learning resources use the App Router. Migrating helps new contributors work with familiar patterns and lowers the barrier to contribution.

Access modern Next.js features

The App Router enables features that are not available in Pages Router, including:

  • React Server Components (smaller client bundles)
  • Built-in SEO metadata via metadata / generateMetadata
  • Streaming and improved loading states
  • Server Actions and modern data-fetching patterns
  • Improved layout system with nested layouts

Align with current Next.js best practices

Pages Router is still supported but is in maintenance mode. App Router is the actively developed and recommended architecture.


Current scope

The migration includes:

  • Moving routes from pages/ to app/
  • Migrating _app.tsx to app/layout.tsx
  • Replacing getStaticProps / getStaticPaths with App Router equivalents
  • Migrating API routes to app/api/.../route.ts
  • Updating SEO metadata handling
  • Adding 'use client' to interactive components where needed

This migration can be performed gradually, and both routers can coexist during the transition.


Migration plan

Phase 1 : App Router scaffold

  • Create app/ directory
  • Create root app/layout.tsx
  • Move shared layout (Navbar, Footer, BackToTopButton)
  • Ensure both routers work together

Phase 2 : Migrate pages incrementally

  • Home page
  • Venue pages
  • Editions page
  • CFP / registration page

Phase 3 : Migrate API routes

  • Move pages/api/... routes to app/api/.../route.ts

Phase 4 : Cleanup

  • Remove pages/ directory
  • Remove _app.tsx
  • Update tests and configuration if needed

Benefits

  • Aligns with modern Next.js architecture
  • Improves performance and SEO
  • Reduces client-side JavaScript where possible
  • Makes the project easier for new contributors to understand
  • Enables future framework features

Additional notes

  • Next.js supports incremental migration, so this can be done safely in phases
  • Netlify supports App Router, but deployment should be verified after migration
  • Interactive components using React hooks will need 'use client'

Resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions