# devfullcycle/live-nextjs-14-ssr architecture

> Architecture diagram of the GitHub repository devfullcycle/live-nextjs-14-ssr, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/devfullcycle/live-nextjs-14-ssr
- Repository: https://github.com/devfullcycle/live-nextjs-14-ssr

## Overview

1. **Overall shape**
   - This repo is a **single Next.js application** at the root, plus a **separate `node-api/` service**. The architecture is therefore split into a frontend/runtime rendered by Next.js and a small backend/data service that can be run independently.

2. **Next.js application boundary**
   - The main app lives under `src/app`, using the **App Router**. Route folders map directly to URL segments, so the route structure is part of the architecture:
     - `src/app/page.tsx` → home route
     - `src/app/pagina1/page.tsx` → `/pagina1`
     - `src/app/pagina1/filha/page.tsx` → nested `/pagina1/filha`
     - `src/app/products/page.tsx` → `/products`
   - `src/app/layout.tsx` is the shared shell for all routes, and `src/app/globals.css` provides global styling.

3. **Feature/page organization**
   - The app is organized by route rather than by a single central controller.
   - `products` appears to be a distinct feature area, separate from the more static/example pages (`pagina1`, `filha`), which suggests the repo is demonstrating multiple page types and route nesting.

4. **Component layer**
   - Reusable UI lives in `src/components`:
     - `ProductList.tsx` is a feature-specific presentational component for the products area.
     - `Loading.tsx` is a shared loading-state component.
     - `ClientComponent.tsx` marks a browser-only interactive boundary in an otherwise server-first Next.js app.
   - This implies a split between server-rendered route components and a small set of client-side interactive components.

5. **Shared domain and utility layer**
   - `src/models.ts` defines shared data shapes used across the app.
   - `src/utils.ts` holds reusable helper logic.
   - These files act as the “contract” layer between pages, components, and any data source, keeping types and transformation logic centralized.

6. **Separate Node API service**
   - `node-api/api.js` and `node-api/data.js` form an isolated backend/data service.
   - `data.js` likely provides the in-memory or static data source, while `api.js` exposes it over HTTP.
   - This is a clear architectural boundary: the Next.js app is not the only source of truth; it can consume data from a separate Node process.

7. **HTTP and integration boundary**
   - `api.http` indicates the backend API is intended to be exercised directly with HTTP requests, which is useful for local testing and for documenting the API surface.
   - In diagram terms, this repo has at least two runtime entry points:
     - the **Next.js web app**
     - the **Node API server**

8. **Styling and static assets**
   - Tailwind CSS is part of the UI stack (`tailwind.config.js`, `postcss.config.js`), with global styles in `src/app/globals.css`.
   - `public/` holds static assets served directly by Next.js without passing through component logic.

9. **Build/runtime/tooling**
   - The project is TypeScript-based (`tsconfig.json`) and linted with ESLint (`.eslintrc.json`).
   - `next.config.js` configures the Next.js runtime/build behavior.
   - The repo is clearly optimized for the standard Next.js development/deployment flow described in the README.

10. **Likely request/data flow to draw**
   - Browser request enters the Next.js app for a route.
   - The route’s `page.tsx` renders, using shared layout/styles and any reusable components.
   - If the page needs interactivity, `ClientComponent.tsx` marks the client-side portion.
   - If the page needs data, it can consume shared models/utils and potentially call the separate `node-api` service.
   - The products feature is the most obvious place where a data-to-UI flow exists via `ProductList`.

11. **Diagram boundaries worth showing**
   - **Browser** → **Next.js app**
   - **Next.js app (routes/layout/components)** → **shared models/utils**
   - **Next.js app** ↔ **Node API service**
   - **Node API service** → **data source in `node-api/data.js`**
   - **Static assets** via `public/`

12. **What this repo is demonstrating**
   - This is not just a single-page demo; it shows a small but realistic Next.js architecture with:
     - route-based page composition
     - shared UI components
     - a client/server component split
     - a separate HTTP API backend
     - shared types and utilities for cross-cutting concerns

Main entry points: [`src/app/products/page.tsx`](https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/app/products/page.tsx) (Products page), [`src/app/layout.tsx`](https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/app/layout.tsx) (App shell), [`node-api/api.js`](https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/node-api/api.js) (API server), [`src/app/page.tsx`](https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/app/page.tsx) (Home page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Next.js app"]
  node_nextapp["Next.js app<br/>web runtime"]
  node_layout["App shell<br/>layout<br/>[layout.tsx]"]
  node_home["Home page<br/>route<br/>[page.tsx]"]
  node_pagina1["Pagina1<br/>route<br/>[page.tsx]"]
  node_filha["Nested page<br/>route<br/>[page.tsx]"]
  node_products["Products page<br/>route<br/>[page.tsx]"]
  node_productlist["Product list<br/>[ProductList.tsx]"]
  node_clientcomp["Client component"]
  node_loading["Loading state<br/>[Loading.tsx]"]
  node_models["Data models<br/>shared types<br/>[models.ts]"]
  node_utils["Utilities<br/>shared utils<br/>[utils.ts]"]
  node_globals["Global styles<br/>styling<br/>[globals.css]"]
  node_public[("Static assets")]
end

subgraph group_api["Node API"]
  node_nodeapi["Node API<br/>http service"]
  node_apijs["API server<br/>[api.js]"]
  node_datajs["Data store<br/>data module<br/>[data.js]"]
end

node_browser(("Browser<br/>client"))

node_browser -->|"requests"| node_nextapp
node_nextapp -->|"wraps"| node_layout
node_nextapp -->|"serves"| node_home
node_nextapp -->|"serves"| node_pagina1
node_nextapp -->|"serves"| node_filha
node_nextapp -->|"serves"| node_products
node_products -->|"uses"| node_productlist
node_products -->|"types"| node_models
node_products -->|"transforms"| node_utils
node_nextapp -->|"hydrates"| node_clientcomp
node_nextapp -->|"shows"| node_loading
node_layout -->|"styles"| node_globals
node_nextapp -->|"serves"| node_public
node_nextapp -.->|"fetches data"| node_nodeapi
node_nodeapi -->|"entrypoint"| node_apijs
node_apijs -->|"reads"| node_datajs

click node_layout "https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/app/layout.tsx"
click node_home "https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/app/page.tsx"
click node_pagina1 "https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/app/pagina1/page.tsx"
click node_filha "https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/app/pagina1/filha/page.tsx"
click node_products "https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/app/products/page.tsx"
click node_productlist "https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/components/ProductList.tsx"
click node_clientcomp "https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/components/ClientComponent.tsx"
click node_loading "https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/components/Loading.tsx"
click node_models "https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/models.ts"
click node_utils "https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/utils.ts"
click node_globals "https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/app/globals.css"
click node_public "https://github.com/devfullcycle/live-nextjs-14-ssr/tree/main/public"
click node_apijs "https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/node-api/api.js"
click node_datajs "https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/node-api/data.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_nextapp,node_layout,node_home,node_pagina1,node_filha,node_products,node_productlist,node_clientcomp,node_loading,node_models,node_utils,node_globals,node_public toneBlue
class node_nodeapi,node_apijs,node_datajs toneAmber
class node_browser toneNeutral
```

## Components

### Next.js app

Root web application rendered by Next.js App Router

- **Next.js app**: web runtime · Main server-rendered application boundary
- [App shell](https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/app/layout.tsx): layout · Shared root layout for all routes · `src/app/layout.tsx`
- [Home page](https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/app/page.tsx): route · Root route page · `src/app/page.tsx`
- [Pagina1](https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/app/pagina1/page.tsx): route · Route page under /pagina1 · `src/app/pagina1/page.tsx`
- [Nested page](https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/app/pagina1/filha/page.tsx): route · Nested route under /pagina1/filha · `src/app/pagina1/filha/page.tsx`
- [Products page](https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/app/products/page.tsx): route · Feature route for product browsing · `src/app/products/page.tsx`
- [Product list](https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/components/ProductList.tsx): Product-facing list component · `src/components/ProductList.tsx`
- [Client component](https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/components/ClientComponent.tsx): client component · Browser-only interactive boundary · `src/components/ClientComponent.tsx`
- [Loading state](https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/components/Loading.tsx): Shared loading UI component · `src/components/Loading.tsx`
- [Data models](https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/models.ts): shared types · Central shared data shapes · `src/models.ts`
- [Utilities](https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/utils.ts): shared utils · Reusable helper logic · `src/utils.ts`
- [Global styles](https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/src/app/globals.css): styling · Application-wide CSS entrypoint · `src/app/globals.css`
- [Static assets](https://github.com/devfullcycle/live-nextjs-14-ssr/tree/main/public): assets · Files served directly by Next.js · `public`

### Node API

Separate backend service with local data source

- **Node API**: http service · Separate backend process exposed over HTTP
- [API server](https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/node-api/api.js): server · HTTP entrypoint for the Node service · `node-api/api.js`
- [Data store](https://github.com/devfullcycle/live-nextjs-14-ssr/blob/main/node-api/data.js): data module · Local data source for the API · `node-api/data.js`

### Other components

- **Browser**: client · User-facing entry point that requests app routes

## Connections

- Browser → Next.js app: requests · Browser loads routed pages from the web app
- Next.js app → App shell: wraps · All routes share the root app shell
- Next.js app → Home page: serves · Root route is rendered by the App Router
- Next.js app → Pagina1: serves · Route segment maps to a page
- Next.js app → Nested page: serves · Nested route maps to a deeper page
- Next.js app → Products page: serves · Products feature is exposed as its own route
- Products page → Product list: uses · Products page renders the product list UI
- Products page → Data models: types · Product UI relies on shared data shapes
- Products page → Utilities: transforms · Feature logic uses reusable helpers
- Next.js app → Client component: hydrates · Client-only interactive island within the app
- Next.js app → Loading state: shows · Shared loading UI is used across routes
- App shell → Global styles: styles · Global CSS is applied through the app shell
- Next.js app → Static assets: serves · Static files are available to routes and components
- Next.js app → Node API: fetches data · Web app can consume the separate Node service
- Node API → API server: entrypoint · HTTP server entry module
- API server → Data store: reads · API server sources its responses from local data
