How kinerik/starter-nextjs works
Main Components
a. Client-Side Layer
• Next.js Frontend Components (pages/index.js)
• Static Assets (public directory)
• Styles (CSS modules and global styles)
b. Next.js Framework Layer
• Page Router
• API Routes Handler
• Server-Side Rendering Engine
c. Server Layer
• Custom Server (server.js)
• API Endpoints (/api/hello.js)
┌─────────────────────────────────────┐
• Client Browser │
• ┘
• ↕ HTTP/HTTPS
┌─────────────────────────────────────┐
• Next.js Application │
• ┬─────────────┬────────┤
• Pages │ API Routes │ Static │
• (_app.js, │ (/api/*) │ Files │
• index.js) │ │ │
• ┴─────────────┴────────┘
• ↕
┌─────────────────────────────────────┐
• Custom Server Layer │
• (server.js) │
• ┘
Important Elements to Highlight
a. Next.js Specific Features:
• File-based routing system (pages directory)
• API routes system (pages/api directory)
• Server-side rendering capabilities
• Static file serving (public directory)
b. Custom Server Implementation:
• How server.js interfaces with the Next.js application
• Custom routing or middleware
Data Flow Indicators
• How requests flow from the client browser
• SSR flow for page requests
• API route handling flow
• Demonstrate static file serving