25 Mins

Dashboard Milestone 1: App Layout Shell & Dynamic Invoices

Environment Setup

Before beginning this milestone, initialize the professional folder structure for this track on your PC:

Bash
npx voidx-verify --init="nextjs"

The setup command generated the following structure: nextjs-milestones/.

The Architecture Core

In this initial deployment phase, you are tasked with constructing the foundational skeletal architecture of the VoidX Dashboard. Your primary objective is to implement a robust layout.tsx that serves as the persistent shell for the entire application, ensuring global UI elements like sidebars and headers maintain state across route transitions. You will integrate a dynamic routing strategy to handle the /dashboard/invoices endpoint, rendering invoice data fetched directly from our internal data layer.

Operator Note: Prioritize structural integrity in your layout.tsx. Unnecessary re-renders of navigation components will compromise the performance metrics of your build.

Executing Data Dynamics

Your technical execution must strictly adhere to the Next.js 15 App Router paradigm. You are required to leverage server components for data fetching to ensure optimal security and performance. When building the invoice view, ensure your page.tsx consumes data asynchronously without blocking the primary thread, utilizing Suspense boundaries for granular loading states. Align your styling with the predefined design system to ensure seamless UI integration.

Operator Note: Utilize loading.tsx at the route segment level to provide immediate visual feedback while your async data requests resolve.

Pending Local Verification

Run the CLI verification to unlock

Starter Code

Use the following starter code in your local project file:

TypeScript
export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    // Add HTML and Body wrapper tags here
    <main>{children}</main>
  );
}

CLI Verification

Bash
npx voidx-verify --token="<YOUR_TOKEN>" --skill="nextjs" --challenge="nx-project-milestone-1" --file="nextjs-milestones/milestone-1/page.tsx"

Run the CLI verification to unlock

Lab Overview

Objectives & Tasks

Review the tasks below and follow the interactive instructions to complete this module.

Knowledge Check

Ready to test your understanding of Dashboard Milestone 1: App Layout Shell & Dynamic Invoices?

Previous
4.5 App Router State Management
Locked
Complete Challenge to Unlock
Back