# leerob/next-mdx-blog architecture

> Architecture diagram of the GitHub repository leerob/next-mdx-blog, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/leerob/next-mdx-blog
- Repository: https://github.com/leerob/next-mdx-blog

## Overview

This is a Next.js MDX blog and personal-site template. A visitor reaches the home page or a note page; the application presents MDX content through shared layout and typography/link/code renderers. The sitemap discovers note pages, while an optional Postgres database supplies redirects during Next.js configuration. The page contents themselves were not excerpted, so content-level links and navigation are not inferred; the graph reflects the available tree, README, and sampled source.

Main entry points: [`app/n`](https://github.com/leerob/next-mdx-blog/tree/main/app/n) (Note pages), [`app/layout.tsx`](https://github.com/leerob/next-mdx-blog/blob/main/app/layout.tsx) (Root layout), [`app/sitemap.ts`](https://github.com/leerob/next-mdx-blog/blob/main/app/sitemap.ts) (Sitemap), [`next.config.ts`](https://github.com/leerob/next-mdx-blog/blob/main/next.config.ts) (Next config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["MDX content"]
  node_home["Home page<br/>[page.mdx]"]
  node_notes["Note pages"]
end

subgraph group_rendering["Presentation"]
  node_layout["Root layout<br/>[layout.tsx]"]
  node_mdx["MDX components<br/>[mdx-components.tsx]"]
end

subgraph group_site["Site features"]
  node_sitemap["Sitemap<br/>[sitemap.ts]"]
  node_analytics["Vercel Analytics"]
end

subgraph group_redirects["Redirect handling"]
  node_config["Next config<br/>[next.config.ts]"]
  node_postgres[("Postgres")]
end

node_visitor(("Visitor"))

node_visitor -.->|"requests"| node_home
node_visitor -.->|"requests"| node_notes
node_layout -->|"renders"| node_analytics
node_sitemap -->|"scans"| node_notes
node_config -->|"queries redirects"| node_postgres

click node_home "https://github.com/leerob/next-mdx-blog/blob/main/app/page.mdx"
click node_notes "https://github.com/leerob/next-mdx-blog/tree/main/app/n"
click node_layout "https://github.com/leerob/next-mdx-blog/blob/main/app/layout.tsx"
click node_mdx "https://github.com/leerob/next-mdx-blog/blob/main/mdx-components.tsx"
click node_sitemap "https://github.com/leerob/next-mdx-blog/blob/main/app/sitemap.ts"
click node_config "https://github.com/leerob/next-mdx-blog/blob/main/next.config.ts"

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_home,node_notes toneBlue
class node_layout,node_mdx toneAmber
class node_sitemap,node_analytics toneMint
class node_config,node_postgres toneRose
class node_visitor toneIndigo
```

## Components

### MDX content

- [Home page](https://github.com/leerob/next-mdx-blog/blob/main/app/page.mdx): `app/page.mdx`
- [Note pages](https://github.com/leerob/next-mdx-blog/tree/main/app/n): `app/n`

### Presentation

- [Root layout](https://github.com/leerob/next-mdx-blog/blob/main/app/layout.tsx): `app/layout.tsx`
- [MDX components](https://github.com/leerob/next-mdx-blog/blob/main/mdx-components.tsx): `mdx-components.tsx`

### Site features

- [Sitemap](https://github.com/leerob/next-mdx-blog/blob/main/app/sitemap.ts): `app/sitemap.ts`
- **Vercel Analytics**

### Redirect handling

- [Next config](https://github.com/leerob/next-mdx-blog/blob/main/next.config.ts): `next.config.ts`
- **Postgres**

### Other components

- **Visitor**

## Connections

- Visitor → Home page: requests
- Visitor → Note pages: requests
- Root layout → Vercel Analytics: renders (evidence: `app/layout.tsx`)
- Sitemap → Note pages: scans (evidence: `app/sitemap.ts`)
- Next config → Postgres: queries redirects (evidence: `next.config.ts`)
