DEV Community

Cover image for Building a Production-Ready Portfolio: Phase-2 — Layout, Navigation & Routing Foundations
Sushant Gaurav
Sushant Gaurav

Posted on

Building a Production-Ready Portfolio: Phase-2 — Layout, Navigation & Routing Foundations

Until now, the frontend existed mostly as structure and intent:

  • folders were planned
  • responsibilities were defined
  • routing was conceptual

Day-4 is where those plans started turning into real user experience.

As a product owner and lead developer, I treated this day as:

“Let’s define how users move through the product — and how the system supports that movement cleanly.”

Why Layout & Navigation Deserve Their Own Phase

In many projects, navigation is:

  • rushed
  • hardcoded
  • tightly coupled to UI

That approach doesn’t scale.

From a product perspective:

  • navigation defines information architecture
  • layout defines consistency
  • routing defines mental models for users

So instead of sprinkling headers and footers everywhere, I introduced a dedicated layout system.

Introducing a Layout Layer (Not Just Components)

The first deliberate decision was creating a layout abstraction.

This was not about visuals — it was about ownership and responsibility.

The layout layer is responsible for:

  • global UI elements
  • persistent navigation
  • shared structure across routes

That led to three clear building blocks:

  • NavBar
  • Footer
  • Layouts (wrapper)

Centralising Navigation Data (Thinking Like a Product)

Before writing a single line of NavBar JSX, I asked a simple question:

What happens when navigation changes?

New pages, renamed sections, reordered links — these are product decisions, not UI problems.

So instead of hardcoding links inside components, I created a single source of truth.

data/navLinks.js

This file represents:

  • the product’s navigation structure
  • the pages the product exposes
  • the contract between routing and UI

By centralising this:

  • NavBar and Footer stay in sync
  • future changes are trivial
  • duplication is eliminated

This mirrors how real products manage:

  • menus
  • sidebars
  • sitemaps

Building the NavBar: More Than Just Links

The NavBar is often the most visible component — but also one of the most abused.

Here, I treated it as:

  • a brand anchor
  • a navigation hub
  • a responsive system component

Key Design Decisions

1. Brand Identity Comes First

  • Logo + name
  • Clickable
  • Always returns to home

This establishes:

  • trust
  • recognition
  • continuity

2. Desktop and Mobile Are First-Class Citizens

Instead of:

  • desktop first
  • mobile as an afterthought

The NavBar was built with:

  • responsive logic
  • mobile interaction patterns
  • smooth transitions

This reflects real-world usage, not just desktop demos.

Mobile Navigation: Designing for Intent

The hamburger menu was not just added — it was designed.

Key considerations:

  • clear open/close state
  • smooth animations
  • auto-close on navigation
  • no accidental overlays

This is where UI meets UX responsibility.

“Coming Soon” Is Also a Product Signal

You’ll notice a theme toggle button that doesn’t yet switch themes.

This was intentional.

From a product perspective:

  • it signals roadmap
  • it sets expectation
  • it avoids silent failure

Instead of hiding incomplete features, I chose to:

  • expose intent
  • communicate clearly
  • keep UX honest

This is a subtle but powerful product leadership decision.

Footer: Reinforcing Structure & Trust

Footers are often ignored — but they matter.

The footer here serves three purposes:

  1. Secondary navigation
  2. Brand reinforcement
  3. External credibility (social links)

Using the same navLinks data:

  • ensures consistency
  • prevents drift
  • reinforces the product’s information architecture

This reuse is intentional and scalable.

Layouts Component: The Glue That Holds Everything Together

Instead of wrapping every page manually, I introduced a single Layouts component.

Its responsibility:

  • render persistent UI
  • delegate page content via routing

Using React Router’s Outlet:

  • keeps routes clean
  • avoids duplication
  • supports nested routing naturally

This is the point where architecture pays off.

Routing: Turning Structure Into Navigation

Finally, everything comes together in routing.

The routing setup reflects:

  • clean URLs
  • predictable structure
  • real-world app patterns

Each route:

  • maps to a page
  • inherits layout
  • stays focused on content

This separation allows:

  • layout changes without touching pages
  • routing changes without breaking UI
  • easier testing and debugging

Why Nested Routing Is a Strategic Decision

Using a shared layout with nested routes is not a React trick — it’s an architectural commitment.

By defining:

  • a single layout wrapper
  • pages as children
  • content rendered via Outlet

I ensured that:

  • global UI remains stable
  • navigation persists across pages
  • page-level components stay focused

From a product lens, this means:

  • consistent experience
  • predictable behaviour
  • easier onboarding for contributors

Separation of Concerns: A Quiet Win

One of the most overlooked benefits of this setup is what pages do NOT know.

Pages:

  • don’t care about navigation
  • don’t import layout components
  • don’t manage global UI

They simply answer:

“What content should this route show?”

This makes the codebase:

  • easier to reason about
  • safer to refactor
  • faster to extend

That’s not accidental — it’s intentional engineering.

Navigation as Data, Not UI

By treating navigation as data (navLinks.js), I unlocked multiple advantages:

  • UI components stay dumb
  • product structure stays explicit
  • changes require fewer edits

From a product-owner perspective, this is powerful because:

  • adding a new section is low-risk
  • reordering pages doesn’t require UI rewrites
  • consistency is enforced by design

This is how real systems prevent entropy.

Avoiding Common Frontend Anti-Patterns

This phase intentionally avoids several mistakes I’ve seen repeatedly in production systems:

❌ Hardcoded navigation everywhere

❌ Layout duplicated across pages

❌ Routing logic scattered across files

❌ Mobile handled as an afterthought

Instead, this setup provides:

  • a single layout owner
  • a single navigation source
  • predictable routing rules
  • mobile-first behaviour

These decisions don’t feel important on Day 4, but they save weeks later.

Product Thinking in Small Details

Even small choices reflect product thinking:

  • “Coming soon” tooltip instead of broken buttons
  • animated feedback instead of silent state changes
  • brand presence in both header and footer
  • social links for credibility and trust

None of these are required for functionality.
All of them are required for experience.

That distinction matters.

How This Prepares the System for Scale

This foundation directly enables future work:

  • Dark mode → toggle already exists
  • Backend integration → pages are isolated
  • Role-based navigation → data-driven links
  • SEO & analytics → consistent layout
  • Testing → predictable component boundaries

Phase-3 isn’t about features.
It’s about creating space for features.

Day-4 in Retrospect

Looking back, Day-4 achieved something subtle but critical:

It transformed the frontend from “files and folders”
into a navigable, user-facing product.

This is where:

  • users start forming opinions
  • structure starts paying off
  • technical decisions become visible

And from here on, every new feature plugs into a stable, predictable system.

What’s Next

With layout and navigation in place, the next logical step is:

  • building actual sections
  • connecting data
  • shaping real content

Phase-3 continues, but the hardest part — getting the foundation right — is now done.

Closing Thought

Good frontend engineering isn’t about writing JSX faster.
It’s about making decisions that future you — and future contributors — will thank you for.

If you’re following along, the complete source lives here:
👉 GitHub Repository: https://github.com/imsushant12/sushantgaurav-portfolio

Top comments (0)