# yarnpkg/website architecture

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

- Interactive diagram: https://gitdiagram.com/yarnpkg/website
- Repository: https://github.com/yarnpkg/website

## Overview

Yarn Classic’s website provides package discovery, package detail pages, documentation and installation content. The principal user flow searches the npm package index, refines results, and opens package details; detail views enrich registry data with repository, README, activity and bundle-size information, with a separate package-file browser. The tree also identifies featured-package and documentation/install/nightly entry points. Some components are unsampled, so their capabilities are represented without guessed call relationships.

Main entry points: [`js/src/components/Search.js`](https://github.com/yarnpkg/website/blob/master/js/src/components/Search.js) (Package search), [`js/src/components/Details.js`](https://github.com/yarnpkg/website/blob/master/js/src/components/Details.js) (Package overview), [`js/src/util/index.js`](https://github.com/yarnpkg/website/blob/master/js/src/util/index.js) (Formatting and fetch helpers), [`js/src/packages.js`](https://github.com/yarnpkg/website/blob/master/js/src/packages.js) (Featured packages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Package discovery"]
  node_search["Package search<br/>[Search.js]"]
  node_searchbox["Search box<br/>[SearchBox.js]"]
  node_results["Search results<br/>[Results.js]"]
  node_hit["Package result<br/>[Hit.js]"]
  node_featured["Featured packages<br/>[packages.js]"]
  node_algolia(("Algolia search"))
end

subgraph group_details["Package details"]
  node_details_view["Package overview<br/>[Details.js]"]
  node_aside["Detail sidebar<br/>[Aside.js]"]
  node_file_browser["Package file browser<br/>[FileBrowser.js]"]
  node_package_cdn(("jsDelivr package data"))
  node_repository_apis(("Repository APIs"))
  node_bundlephobia(("Bundlephobia"))
  node_markdown["Markdown rendering<br/>[Markdown.js]"]
  node_highlight["Syntax highlighting<br/>[highlight.pack.js]"]
end

subgraph group_content["Site content"]
  node_documentation["Documentation page<br/>[documentation.js]"]
  node_installation["Installation page<br/>[install.js]"]
  node_nightly["Nightly page<br/>[nightly.js]"]
  node_package_page["Package page entry<br/>[package.js]"]
end

subgraph group_shared["Shared runtime"]
  node_common["Common page runtime<br/>[common.js]"]
  node_status["Service status<br/>[serviceStatus.js]"]
  node_config["Search configuration<br/>[config.js]"]
  node_url_sync["URL state sync<br/>[withUrlSync.js]"]
  node_utilities["Formatting and fetch helpers<br/>[index.js]"]
end

node_visitor(("Website visitor"))

node_search -->|"renders"| node_searchbox
node_search -->|"renders"| node_results
node_search -->|"queries"| node_algolia
node_search -->|"reads settings"| node_config
node_search -->|"wraps state"| node_url_sync
node_featured -->|"queries featured IDs"| node_algolia
node_featured -->|"uses package links"| node_utilities
node_details_view -->|"fetches repository data"| node_repository_apis
node_details_view -->|"fetches bundle size"| node_bundlephobia
node_details_view -->|"uses fetch helpers"| node_utilities
node_file_browser -->|"fetches file metadata"| node_package_cdn
node_markdown -->|"highlights code"| node_highlight
node_common -->|"checks status"| node_status
node_common -->|"imports runtime helpers"| node_utilities
node_documentation -->|"reads settings"| node_config
node_package_page -->|"loads component"| node_details_view
node_visitor -.->|"uses"| node_search

click node_search "https://github.com/yarnpkg/website/blob/master/js/src/components/Search.js"
click node_searchbox "https://github.com/yarnpkg/website/blob/master/js/src/components/SearchBox.js"
click node_results "https://github.com/yarnpkg/website/blob/master/js/src/components/Results.js"
click node_hit "https://github.com/yarnpkg/website/blob/master/js/src/components/Hit.js"
click node_featured "https://github.com/yarnpkg/website/blob/master/js/src/packages.js"
click node_details_view "https://github.com/yarnpkg/website/blob/master/js/src/components/Details.js"
click node_aside "https://github.com/yarnpkg/website/blob/master/js/src/components/Aside.js"
click node_file_browser "https://github.com/yarnpkg/website/blob/master/js/src/components/FileBrowser.js"
click node_markdown "https://github.com/yarnpkg/website/blob/master/js/src/components/Markdown.js"
click node_highlight "https://github.com/yarnpkg/website/blob/master/js/src/util/highlight.pack.js"
click node_documentation "https://github.com/yarnpkg/website/blob/master/js/src/documentation.js"
click node_installation "https://github.com/yarnpkg/website/blob/master/js/src/install.js"
click node_nightly "https://github.com/yarnpkg/website/blob/master/js/src/nightly.js"
click node_package_page "https://github.com/yarnpkg/website/blob/master/js/src/package.js"
click node_common "https://github.com/yarnpkg/website/blob/master/js/src/common.js"
click node_status "https://github.com/yarnpkg/website/blob/master/js/src/util/serviceStatus.js"
click node_config "https://github.com/yarnpkg/website/blob/master/js/src/util/config.js"
click node_url_sync "https://github.com/yarnpkg/website/blob/master/js/src/util/withUrlSync.js"
click node_utilities "https://github.com/yarnpkg/website/blob/master/js/src/util/index.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_search,node_searchbox,node_results,node_hit,node_featured,node_algolia toneBlue
class node_details_view,node_aside,node_file_browser,node_package_cdn,node_repository_apis,node_bundlephobia,node_markdown,node_highlight toneAmber
class node_documentation,node_installation,node_nightly,node_package_page toneMint
class node_common,node_status,node_config,node_url_sync,node_utilities toneRose
class node_visitor toneIndigo
```

## Components

### Package discovery

- [Package search](https://github.com/yarnpkg/website/blob/master/js/src/components/Search.js): `js/src/components/Search.js`
- [Search box](https://github.com/yarnpkg/website/blob/master/js/src/components/SearchBox.js): `js/src/components/SearchBox.js`
- [Search results](https://github.com/yarnpkg/website/blob/master/js/src/components/Results.js): `js/src/components/Results.js`
- [Package result](https://github.com/yarnpkg/website/blob/master/js/src/components/Hit.js): `js/src/components/Hit.js`
- [Featured packages](https://github.com/yarnpkg/website/blob/master/js/src/packages.js): `js/src/packages.js`
- **Algolia search**

### Package details

- [Package overview](https://github.com/yarnpkg/website/blob/master/js/src/components/Details.js): `js/src/components/Details.js`
- [Detail sidebar](https://github.com/yarnpkg/website/blob/master/js/src/components/Aside.js): `js/src/components/Aside.js`
- [Package file browser](https://github.com/yarnpkg/website/blob/master/js/src/components/FileBrowser.js): `js/src/components/FileBrowser.js`
- **jsDelivr package data**
- **Repository APIs**
- **Bundlephobia**
- [Markdown rendering](https://github.com/yarnpkg/website/blob/master/js/src/components/Markdown.js): `js/src/components/Markdown.js`
- [Syntax highlighting](https://github.com/yarnpkg/website/blob/master/js/src/util/highlight.pack.js): `js/src/util/highlight.pack.js`

### Site content

- [Documentation page](https://github.com/yarnpkg/website/blob/master/js/src/documentation.js): `js/src/documentation.js`
- [Installation page](https://github.com/yarnpkg/website/blob/master/js/src/install.js): `js/src/install.js`
- [Nightly page](https://github.com/yarnpkg/website/blob/master/js/src/nightly.js): `js/src/nightly.js`
- [Package page entry](https://github.com/yarnpkg/website/blob/master/js/src/package.js): `js/src/package.js`

### Shared runtime

- [Common page runtime](https://github.com/yarnpkg/website/blob/master/js/src/common.js): `js/src/common.js`
- [Service status](https://github.com/yarnpkg/website/blob/master/js/src/util/serviceStatus.js): `js/src/util/serviceStatus.js`
- [Search configuration](https://github.com/yarnpkg/website/blob/master/js/src/util/config.js): `js/src/util/config.js`
- [URL state sync](https://github.com/yarnpkg/website/blob/master/js/src/util/withUrlSync.js): `js/src/util/withUrlSync.js`
- [Formatting and fetch helpers](https://github.com/yarnpkg/website/blob/master/js/src/util/index.js): `js/src/util/index.js`

### Other components

- **Website visitor**

## Connections

- Package search → Search box: renders (evidence: `js/src/components/Search.js`)
- Package search → Search results: renders (evidence: `js/src/components/Search.js`)
- Package search → Algolia search: queries (evidence: `js/src/components/Search.js`)
- Package search → Search configuration: reads settings (evidence: `js/src/components/Search.js`)
- Package search → URL state sync: wraps state (evidence: `js/src/components/Search.js`)
- Featured packages → Algolia search: queries featured IDs (evidence: `js/src/packages.js`)
- Featured packages → Formatting and fetch helpers: uses package links (evidence: `js/src/packages.js`)
- Package overview → Repository APIs: fetches repository data (evidence: `js/src/components/Details.js`)
- Package overview → Bundlephobia: fetches bundle size (evidence: `js/src/components/Details.js`)
- Package overview → Formatting and fetch helpers: uses fetch helpers (evidence: `js/src/components/Details.js`)
- Package file browser → jsDelivr package data: fetches file metadata (evidence: `js/src/components/FileBrowser.js`)
- Markdown rendering → Syntax highlighting: highlights code (evidence: `js/src/components/Markdown.js`)
- Common page runtime → Service status: checks status (evidence: `js/src/common.js`)
- Common page runtime → Formatting and fetch helpers: imports runtime helpers (evidence: `js/src/common.js`)
- Documentation page → Search configuration: reads settings (evidence: `js/src/documentation.js`)
- Package page entry → Package overview: loads component (evidence: `js/src/package.js`)
- Website visitor → Package search: uses
