An interactive demonstration project showcasing Next.js 15 App Router core features, including layout systems, file conventions, and routing functionality with complete examples.
- Nested Layouts - Nested layout system demonstration
- Route Groups - Route grouping functionality showcase
- Parallel Routes - Parallel routing feature implementation
- File Conventions - Complete file convention examples
loading.js
- Loading state managementerror.js
- Error boundary handlingnot-found.js
- 404 page customization
- Next.js 15.5.0 - Latest version of App Router
- TypeScript - Complete type support
- Tailwind CSS v4 - Modern styling system
- shadcn/ui - High-quality UI component library
- Lucide React - Beautiful icon library
app-router-template/
βββ src/
β βββ app/
β β βββ globals.css # Global styles and theme
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Home page
β β βββ components/
β β β βββ Header.tsx # Shared navigation component
β β βββ layouts/ # Layout system demonstration
β β β βββ nested-layouts/ # Nested layouts
β β β β βββ layout.tsx # Outer layout
β β β β βββ page.tsx # Home page
β β β β βββ dashboard/ # Dashboard page
β β β β βββ settings/ # Settings page (with inner layout)
β β β β βββ profile/ # Profile page
β β β βββ route-groups/ # Route groups
β β β β βββ page.tsx # Demo page
β β β β βββ (admin)/ # Admin group
β β β β βββ (user)/ # User group
β β β β βββ (public)/ # Public group
β β β βββ parallel-routes/ # Parallel routes
β β β βββ layout.tsx # Parallel routes layout
β β β βββ @messages/ # Messages slot
β β β βββ @users/ # Users slot
β β β βββ @settings/ # Settings slot
β β βββ file-conventions/ # File conventions demonstration
β β βββ loading/ # Loading states
β β β βββ page.tsx # Introduction page
β β β βββ loading.js # Loading component
β β β βββ demo/ # Demo page
β β βββ error/ # Error handling
β β β βββ page.tsx # Introduction page
β β β βββ error.js # Error boundary
β β β βββ demo/ # Demo page
β β βββ not-found/ # 404 page
β β βββ page.tsx # Introduction page
β β βββ not-found.js # 404 component
β β βββ demo/ # Demo page
β βββ components/
β βββ ui/ # shadcn/ui components
βββ public/ # Static assets
βββ package.json # Project dependencies
βββ next.config.ts # Next.js configuration
βββ tailwind.config.ts # Tailwind configuration
βββ tsconfig.json # TypeScript configuration
The project adopts a modern dark theme design:
- Primary Color:
#1c66e5
(Blue) - Background:
#0a0a0a
(Dark black) - Foreground:
#ffffff
(White) - Card:
#1a1a1a
(Dark gray) - Border:
rgba(255, 255, 255, 0.1)
(Semi-transparent white)
- Node.js 18.17 or higher
- npm or yarn package manager
npm install
edgeone pages dev
The project will start at http://localhost:8088
Path: /layouts/nested-layouts
Demonstrates a true nested layout system:
- Outer layout provides shared navigation and title
- Inner layout (settings page) provides sidebar
- Layout state persists during page transitions
- Supports multi-level nesting and independent rendering
Features:
- Layout persistence
- Shared components
- Multi-level nesting
- Performance optimization
Path: /layouts/route-groups
Showcases route grouping functionality:
- Uses
(folderName)
convention to create logical groups - Doesn't affect URL path structure
- Applies different layouts to different route segments
- Supports admin, user, public, and other groups
Group Structure:
(admin)
- Admin backend pages(user)
- User-related pages(public)
- Public pages
Path: /layouts/parallel-routes
Implements true parallel routing features:
- Uses
@folder
convention to create slots - Renders multiple independent route segments simultaneously
- Each slot maintains independent state
- Supports conditional rendering and default slots
Slot Components:
@messages
- Message list@users
- User management@settings
- Application settings@default
- Default content
Path: /file-conventions/loading
- Automatically displays loading states
- Supports nesting and inheritance
- Doesn't affect SEO and performance
- Real demonstration of async component loading
Path: /file-conventions/error
- Automatically captures component errors
- Graceful degradation handling
- Provides error recovery mechanisms
- Prevents application crashes
Path: /file-conventions/not-found
- Custom 404 pages
- Supports
notFound()
function calls - Maintains complete application structure
- User-friendly guidance
- Outer Layout: Provides shared navigation and title
- Inner Layout: Provides additional layout for specific page segments
- Layout Inheritance: Supports multi-level nesting and state persistence
- Performance Optimization: Only re-renders changed parts
- File System Routing: Automatic routing based on file structure
- Dynamic Routing: Supports parameters and query strings
- Middleware Support: Route-level logic processing
- SEO Optimization: Server-side rendering and metadata management
- Layout State: Persists during page transitions
- Component State: Managed using React Hooks
- Server State: Supports async data fetching
- Client State: Interactions and user input
Welcome to submit Issues and Pull Requests to improve this project!
- Write code using TypeScript
- Follow ESLint rules
- Keep component structure clear
- Add appropriate comments and documentation
- Use clear commit messages
- One commit for one thing
- Test to ensure functionality works
- Update related documentation
This project is licensed under the MIT License - see the LICENSE file for details.