Skip to content
GOGodswill
All posts
1 min read

Structuring a Next.js App Router project for the long run

How I organise routes, components and content in an App Router codebase so features stay easy to find, change and delete.

  • Next.js
  • Architecture
  • TypeScript

The App Router makes it easy to move fast and equally easy to end up with a folder that nobody wants to open. A little structure up front prevents that.

Route folders stay thin

A page file should compose and wire things together — fetch data, set metadata, render sections. When a page.tsx file starts accumulating layout logic and styling decisions, it's time to pull that into a component.

app/
  page.tsx            # composes hero + selected work + CTA
  work/
    page.tsx
    [slug]/page.tsx
  about/page.tsx
components/
  navigation/
  projects/
  sections/
  ui/
content/
  projects.ts
  blog.ts
lib/
  site.ts
  utils.ts

Group components by feature, then by type

Feature folders — projects, navigation, case-study — make ownership obvious. Inside them, reusable primitives live in ui/. You should be able to delete a feature by deleting one folder.

Content lives in code (until it doesn't)

For a portfolio or a small product, structured TypeScript content beats a CMS: it's typed, it's versioned, it can't go down. If non-developers need to edit content regularly, that's the signal to introduce a CMS — not the other way around.

Server first, client when needed

  • Pages and static sections render on the server by default — smaller bundles, faster first paint.
  • 'use client' is an opt-in for interactivity: menus, forms, filters, animations.
  • Pass server data into client components as props instead of re-fetching it in the browser.

Metadata belongs to the route

Titles, descriptions and canonical URLs are exported from the same file that renders the page. That keeps SEO honest: if a route exists, its metadata exists.

The payoff

Structure isn't about looking organised — it's about change cost. A thin route, a feature folder and typed content mean a new page takes minutes instead of an afternoon.

Let's build together

Have a product that needs building?

I'm available for frontend and mobile app engineering — full-time product roles, contracts, or ambitious freelance builds.