Frontend App Structure
Quality Hub GINEZ uses Next.js 14 App Router for a modern, file-system based routing approach with React Server and Client Components.Directory Structure
Next.js App Router
File-Based Routing
The App Router uses file conventions for routing:page.tsx- Defines a route’s UIlayout.tsx- Shared UI for a segment and its childrenloading.tsx- Loading UI for a segmenterror.tsx- Error UI for a segmentnot-found.tsx- 404 UI
Route Groups
Parentheses create route groups without affecting URL:Dynamic Routes
Brackets create dynamic segments:Root Layout
The root layout wraps all pages:Application Shell
TheAppShell component provides the main application structure:
Page Structure Pattern
Typical page component structure:Navigation Structure
Navigation is defined inAppShell.tsx:
Responsive Design
The app uses a mobile-first approach:Breakpoints
Mobile Adaptations
- Collapsible sidebar on desktop
- Hamburger menu on mobile
- Responsive tables (horizontal scroll)
- Touch-friendly buttons and inputs
- Mobile-optimized forms
Client vs Server Components
Client Components ("use client")
Required for:
- State management (
useState,useEffect) - Event handlers (
onClick,onChange) - Browser APIs (localStorage, window)
- Context consumers (
useAuth,useTheme) - Third-party libraries with browser dependencies
Server Components (default)
Used for:- Static content
- SEO-critical pages
- Data fetching without client state
