# magicuidesign/magicui architecture

> Architecture diagram of the GitHub repository magicuidesign/magicui, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/magicuidesign/magicui
- Repository: https://github.com/magicuidesign/magicui

## Overview

Magic UI is a Next.js site presenting a library of reusable UI components and animations, with documentation, a component showcase, marketing pages, and a blog. The principal visitor workflow is to browse the site, explore showcase entries or blog posts, and inspect component previews and source. The excerpts show selected page-to-component and page-to-content-source relationships; the broader registry and docs implementation is represented from the tree and README, so unsampled wiring is omitted.

Main entry points: [`apps/www/app/(blog)/blog/[...slug]/page.tsx`](https://github.com/magicuidesign/magicui/blob/main/apps/www/app/(blog)/blog/%5B...slug%5D/page.tsx) (Blog article), [`apps/www/lib/source.ts`](https://github.com/magicuidesign/magicui/blob/main/apps/www/lib/source.ts) (Content sources), [`apps/www/app/(marketing)/showcase/page.tsx`](https://github.com/magicuidesign/magicui/blob/main/apps/www/app/(marketing)/showcase/page.tsx) (Showcase pages), [`apps/www/app/llm/[[...slug]]/route.ts`](https://github.com/magicuidesign/magicui/blob/main/apps/www/app/llm/%5B%5B...slug%5D%5D/route.ts) (Markdown endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Site and marketing"]
  node_home["Marketing home<br/>[page.tsx]"]
  node_hero["Hero section<br/>[hero.tsx]"]
  node_showcase["Showcase pages<br/>[page.tsx]"]
  node_showcase_items["Showcase entries<br/>[page.tsx]"]
  node_showcase_ui["Showcase cards<br/>[showcase.tsx]"]
end

subgraph group_docs["Docs and components"]
  node_docs_layout["Docs layout<br/>[layout.tsx]"]
  node_docs_content["Documentation content<br/>[docs.ts]"]
  node_component_registry["Component registry<br/>[__index__.tsx]"]
  node_registry_ui["Registry UI entries<br/>[registry-ui.ts]"]
  node_registry_examples["Registry examples"]
  node_component_preview["Component preview"]
  node_preview_tabs["Preview and code tabs"]
end

subgraph group_editorial["Blog and publishing"]
  node_blog_index["Blog index<br/>[page.tsx]"]
  node_blog_post["Blog article<br/>[page.tsx]"]
  node_blog_toc["Article contents"]
  node_mobile_toc["Mobile contents<br/>[mobile-toc.tsx]"]
  node_blog_webhook["Publishing webhook<br/>[route.ts]"]
end

subgraph group_platform["Content and integrations"]
  node_content_sources[("Content sources<br/>[source.ts]")]
  node_llm_route["Markdown endpoint<br/>[route.ts]"]
  node_docs_helpers["Docs helpers<br/>[docs.ts]"]
  node_og_route["Social image endpoint<br/>[route.tsx]"]
end

node_visitor(("Site visitor"))
node_github_actions["GitHub Actions"]

node_visitor -->|"visits"| node_home
node_home -->|"renders"| node_hero
node_visitor -->|"browses"| node_showcase
node_showcase -->|"reads entries"| node_content_sources
node_showcase -->|"renders cards"| node_showcase_ui
node_visitor -->|"browses"| node_blog_index
node_blog_index -->|"reads posts"| node_content_sources
node_visitor -->|"opens article"| node_blog_post
node_blog_post -->|"loads article"| node_content_sources
node_blog_post -->|"renders contents"| node_blog_toc
node_blog_post -->|"renders mobile contents"| node_mobile_toc
node_mobile_toc -->|"embeds"| node_blog_toc
node_visitor -->|"opens docs"| node_docs_layout
node_visitor -->|"explores components"| node_component_preview
node_preview_tabs -->|"shows preview"| node_component_preview
node_visitor -->|"requests markdown"| node_llm_route
node_llm_route -->|"loads page"| node_content_sources
node_llm_route -->|"replaces source tags"| node_docs_helpers
node_visitor -->|"submits publish event"| node_blog_webhook
node_blog_webhook -->|"dispatches workflow"| node_github_actions
node_visitor -->|"requests image"| node_og_route

click node_home "https://github.com/magicuidesign/magicui/blob/main/apps/www/app/(marketing)/page.tsx"
click node_hero "https://github.com/magicuidesign/magicui/blob/main/apps/www/components/sections/hero.tsx"
click node_showcase "https://github.com/magicuidesign/magicui/blob/main/apps/www/app/(marketing)/showcase/page.tsx"
click node_showcase_items "https://github.com/magicuidesign/magicui/blob/main/apps/www/app/(marketing)/showcase/%5B...slug%5D/page.tsx"
click node_showcase_ui "https://github.com/magicuidesign/magicui/blob/main/apps/www/components/sections/showcase.tsx"
click node_docs_layout "https://github.com/magicuidesign/magicui/blob/main/apps/www/app/(docs)/layout.tsx"
click node_docs_content "https://github.com/magicuidesign/magicui/blob/main/apps/www/config/docs.ts"
click node_component_registry "https://github.com/magicuidesign/magicui/blob/main/apps/www/registry/__index__.tsx"
click node_registry_ui "https://github.com/magicuidesign/magicui/blob/main/apps/www/registry/registry-ui.ts"
click node_registry_examples "https://github.com/magicuidesign/magicui/blob/main/apps/www/registry/registry-examples.ts"
click node_component_preview "https://github.com/magicuidesign/magicui/blob/main/apps/www/components/component-preview.tsx"
click node_preview_tabs "https://github.com/magicuidesign/magicui/blob/main/apps/www/components/component-preview-tabs.tsx"
click node_blog_index "https://github.com/magicuidesign/magicui/blob/main/apps/www/app/(blog)/blog/page.tsx"
click node_blog_post "https://github.com/magicuidesign/magicui/blob/main/apps/www/app/(blog)/blog/%5B...slug%5D/page.tsx"
click node_blog_toc "https://github.com/magicuidesign/magicui/blob/main/apps/www/components/blog/table-of-contents.tsx"
click node_mobile_toc "https://github.com/magicuidesign/magicui/blob/main/apps/www/components/blog/mobile-toc.tsx"
click node_blog_webhook "https://github.com/magicuidesign/magicui/blob/main/apps/www/app/api/blog-webhook/route.ts"
click node_content_sources "https://github.com/magicuidesign/magicui/blob/main/apps/www/lib/source.ts"
click node_llm_route "https://github.com/magicuidesign/magicui/blob/main/apps/www/app/llm/%5B%5B...slug%5D%5D/route.ts"
click node_docs_helpers "https://github.com/magicuidesign/magicui/blob/main/apps/www/lib/docs.ts"
click node_og_route "https://github.com/magicuidesign/magicui/blob/main/apps/www/app/og/route.tsx"

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_hero,node_showcase,node_showcase_items,node_showcase_ui toneBlue
class node_docs_layout,node_docs_content,node_component_registry,node_registry_ui,node_registry_examples,node_component_preview,node_preview_tabs toneAmber
class node_blog_index,node_blog_post,node_blog_toc,node_mobile_toc,node_blog_webhook toneMint
class node_content_sources,node_llm_route,node_docs_helpers,node_og_route toneRose
class node_visitor,node_github_actions toneIndigo
```

## Components

### Site and marketing

- [Marketing home](https://github.com/magicuidesign/magicui/blob/main/apps/www/app/(marketing)/page.tsx): `apps/www/app/(marketing)/page.tsx`
- [Hero section](https://github.com/magicuidesign/magicui/blob/main/apps/www/components/sections/hero.tsx): `apps/www/components/sections/hero.tsx`
- [Showcase pages](https://github.com/magicuidesign/magicui/blob/main/apps/www/app/(marketing)/showcase/page.tsx): `apps/www/app/(marketing)/showcase/page.tsx`
- [Showcase entries](https://github.com/magicuidesign/magicui/blob/main/apps/www/app/(marketing)/showcase/%5B...slug%5D/page.tsx): `apps/www/app/(marketing)/showcase/[...slug]/page.tsx`
- [Showcase cards](https://github.com/magicuidesign/magicui/blob/main/apps/www/components/sections/showcase.tsx): `apps/www/components/sections/showcase.tsx`

### Docs and components

- [Docs layout](https://github.com/magicuidesign/magicui/blob/main/apps/www/app/(docs)/layout.tsx): `apps/www/app/(docs)/layout.tsx`
- [Documentation content](https://github.com/magicuidesign/magicui/blob/main/apps/www/config/docs.ts): `apps/www/config/docs.ts`
- [Component registry](https://github.com/magicuidesign/magicui/blob/main/apps/www/registry/__index__.tsx): `apps/www/registry/__index__.tsx`
- [Registry UI entries](https://github.com/magicuidesign/magicui/blob/main/apps/www/registry/registry-ui.ts): `apps/www/registry/registry-ui.ts`
- [Registry examples](https://github.com/magicuidesign/magicui/blob/main/apps/www/registry/registry-examples.ts): `apps/www/registry/registry-examples.ts`
- [Component preview](https://github.com/magicuidesign/magicui/blob/main/apps/www/components/component-preview.tsx): `apps/www/components/component-preview.tsx`
- [Preview and code tabs](https://github.com/magicuidesign/magicui/blob/main/apps/www/components/component-preview-tabs.tsx): `apps/www/components/component-preview-tabs.tsx`

### Blog and publishing

- [Blog index](https://github.com/magicuidesign/magicui/blob/main/apps/www/app/(blog)/blog/page.tsx): `apps/www/app/(blog)/blog/page.tsx`
- [Blog article](https://github.com/magicuidesign/magicui/blob/main/apps/www/app/(blog)/blog/%5B...slug%5D/page.tsx): `apps/www/app/(blog)/blog/[...slug]/page.tsx`
- [Article contents](https://github.com/magicuidesign/magicui/blob/main/apps/www/components/blog/table-of-contents.tsx): `apps/www/components/blog/table-of-contents.tsx`
- [Mobile contents](https://github.com/magicuidesign/magicui/blob/main/apps/www/components/blog/mobile-toc.tsx): `apps/www/components/blog/mobile-toc.tsx`
- [Publishing webhook](https://github.com/magicuidesign/magicui/blob/main/apps/www/app/api/blog-webhook/route.ts): `apps/www/app/api/blog-webhook/route.ts`

### Content and integrations

- [Content sources](https://github.com/magicuidesign/magicui/blob/main/apps/www/lib/source.ts): `apps/www/lib/source.ts`
- [Markdown endpoint](https://github.com/magicuidesign/magicui/blob/main/apps/www/app/llm/%5B%5B...slug%5D%5D/route.ts): `apps/www/app/llm/[[...slug]]/route.ts`
- [Docs helpers](https://github.com/magicuidesign/magicui/blob/main/apps/www/lib/docs.ts): `apps/www/lib/docs.ts`
- [Social image endpoint](https://github.com/magicuidesign/magicui/blob/main/apps/www/app/og/route.tsx): `apps/www/app/og/route.tsx`

### Other components

- **Site visitor**
- **GitHub Actions**

## Connections

- Site visitor → Marketing home: visits (evidence: `apps/www/app/(marketing)/page.tsx`)
- Marketing home → Hero section: renders (evidence: `apps/www/app/(marketing)/page.tsx`)
- Site visitor → Showcase pages: browses (evidence: `apps/www/app/(marketing)/showcase/page.tsx`)
- Showcase pages → Content sources: reads entries (evidence: `apps/www/app/(marketing)/showcase/page.tsx`)
- Showcase pages → Showcase cards: renders cards (evidence: `apps/www/app/(marketing)/showcase/page.tsx`)
- Site visitor → Blog index: browses (evidence: `apps/www/app/(blog)/blog/page.tsx`)
- Blog index → Content sources: reads posts (evidence: `apps/www/app/(blog)/blog/page.tsx`)
- Site visitor → Blog article: opens article (evidence: `apps/www/app/(blog)/blog/[...slug]/page.tsx`)
- Blog article → Content sources: loads article (evidence: `apps/www/app/(blog)/blog/[...slug]/page.tsx`)
- Blog article → Article contents: renders contents (evidence: `apps/www/app/(blog)/blog/[...slug]/page.tsx`)
- Blog article → Mobile contents: renders mobile contents (evidence: `apps/www/app/(blog)/blog/[...slug]/page.tsx`)
- Mobile contents → Article contents: embeds (evidence: `apps/www/components/blog/mobile-toc.tsx`)
- Site visitor → Docs layout: opens docs (evidence: `README.md`)
- Site visitor → Component preview: explores components (evidence: `README.md`)
- Preview and code tabs → Component preview: shows preview (evidence: `apps/www/components/component-preview-tabs.tsx`)
- Site visitor → Markdown endpoint: requests markdown (evidence: `apps/www/app/llm/[[...slug]]/route.ts`)
- Markdown endpoint → Content sources: loads page (evidence: `apps/www/app/llm/[[...slug]]/route.ts`)
- Markdown endpoint → Docs helpers: replaces source tags (evidence: `apps/www/app/llm/[[...slug]]/route.ts`)
- Site visitor → Publishing webhook: submits publish event (evidence: `apps/www/app/api/blog-webhook/route.ts`)
- Publishing webhook → GitHub Actions: dispatches workflow (evidence: `apps/www/app/api/blog-webhook/route.ts`)
- Site visitor → Social image endpoint: requests image (evidence: `apps/www/app/og/route.tsx`)
