# redocly/redoc architecture

> Architecture diagram of the GitHub repository redocly/redoc, 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/redocly/redoc
- Repository: https://github.com/redocly/redoc

## Overview

Redoc turns OpenAPI/Swagger, AsyncAPI, and GraphQL definitions into interactive API documentation for React or HTML embedding. The main workflow is specification input, format-specific adaptation, and documentation rendering, with navigation, search, schema detail, examples, and MCP documentation as distinct capabilities. The graph follows documented capabilities and visible source references; several adapter and rendering internals were not sampled, so their internal call paths are not asserted.

Main entry points: [`src/Redoc.tsx`](https://github.com/redocly/redoc/blob/main/src/Redoc.tsx) (Redoc entry points), [`src/pages`](https://github.com/redocly/redoc/tree/main/src/pages) (Documentation pages), [`src/adapters/openapi`](https://github.com/redocly/redoc/tree/main/src/adapters/openapi) (OpenAPI adapter), [`src/components/ItemContent/ItemContentRenderer.tsx`](https://github.com/redocly/redoc/blob/main/src/components/ItemContent/ItemContentRenderer.tsx) (Content rendering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Specification adapters"]
  node_openapi["OpenAPI adapter"]
  node_asyncapi["AsyncAPI adapter"]
  node_graphql["GraphQL adapter"]
end

subgraph group_render["Documentation UI"]
  node_redoc["Redoc entry points<br/>[Redoc.tsx]"]
  node_pages["Documentation pages"]
  node_content["Content rendering"]
  node_schema["Schema views<br/>[SchemaView.tsx]"]
  node_panels["Examples and panels"]
  node_mcp["MCP documentation"]
end

subgraph group_interaction["Navigation and discovery"]
  node_menu["Side menu<br/>[SideMenu.tsx]"]
  node_routing["Route resolution<br/>[routing.ts]"]
  node_search["Search"]
  node_deeplinks["Deep links<br/>[deep-link.ts]"]
end

subgraph group_state["Shared application state"]
  node_sharedtypes["Document models"]
  node_appstate["Application state<br/>[app.ts]"]
  node_globalstore["API document store<br/>[store.ts]"]
end

subgraph group_services["Supporting services"]
  node_samples["Code samples"]
  node_graphqlsample["GraphQL query samples<br/>[graphql-samples.ts]"]
end

node_author(("API author"))
node_definition["API definition"]

node_author -->|"provides"| node_definition
node_definition -->|"documents from"| node_redoc
node_redoc -->|"supports"| node_openapi
node_redoc -->|"supports"| node_asyncapi
node_redoc -->|"supports"| node_graphql
node_redoc -.->|"renders docs"| node_pages
node_pages -.->|"renders content"| node_content
node_pages -->|"shows navigation"| node_menu
node_pages -->|"shows examples"| node_panels
node_openapi -->|"documents extension"| node_mcp
node_openapi -->|"provides samples"| node_samples
node_content -.->|"renders schemas"| node_schema
node_graphqlsample -->|"generates query sample"| node_panels
node_menu -->|"resolves active route"| node_routing
node_search -->|"searches documentation"| node_pages
node_appstate -.->|"shares document state"| node_globalstore
node_deeplinks -.->|"supports deep links"| node_schema
node_sharedtypes -->|"defines document models"| node_globalstore

click node_redoc "https://github.com/redocly/redoc/blob/main/src/Redoc.tsx"
click node_openapi "https://github.com/redocly/redoc/tree/main/src/adapters/openapi"
click node_asyncapi "https://github.com/redocly/redoc/tree/main/src/adapters/asyncapi"
click node_graphql "https://github.com/redocly/redoc/tree/main/src/adapters/graphql"
click node_sharedtypes "https://github.com/redocly/redoc/tree/main/src/types"
click node_appstate "https://github.com/redocly/redoc/blob/main/src/jotai/app.ts"
click node_globalstore "https://github.com/redocly/redoc/blob/main/src/jotai/store.ts"
click node_pages "https://github.com/redocly/redoc/tree/main/src/pages"
click node_content "https://github.com/redocly/redoc/blob/main/src/components/ItemContent/ItemContentRenderer.tsx"
click node_schema "https://github.com/redocly/redoc/blob/main/src/components/Schema/SchemaView.tsx"
click node_panels "https://github.com/redocly/redoc/tree/main/src/components/panels"
click node_mcp "https://github.com/redocly/redoc/tree/main/src/components/Mcp"
click node_menu "https://github.com/redocly/redoc/blob/main/src/components/SideMenu/SideMenu.tsx"
click node_routing "https://github.com/redocly/redoc/blob/main/src/utils/routing.ts"
click node_search "https://github.com/redocly/redoc/tree/main/src/services/search"
click node_samples "https://github.com/redocly/redoc/tree/main/src/services/code-samples"
click node_graphqlsample "https://github.com/redocly/redoc/blob/main/src/utils/graphql-samples.ts"
click node_deeplinks "https://github.com/redocly/redoc/blob/main/src/utils/deep-link.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_openapi,node_asyncapi,node_graphql toneBlue
class node_redoc,node_pages,node_content,node_schema,node_panels,node_mcp toneAmber
class node_menu,node_routing,node_search,node_deeplinks,node_author,node_definition toneMint
class node_sharedtypes,node_appstate,node_globalstore toneRose
class node_samples,node_graphqlsample toneIndigo
```

## Components

### Specification adapters

- [OpenAPI adapter](https://github.com/redocly/redoc/tree/main/src/adapters/openapi): `src/adapters/openapi`
- [AsyncAPI adapter](https://github.com/redocly/redoc/tree/main/src/adapters/asyncapi): `src/adapters/asyncapi`
- [GraphQL adapter](https://github.com/redocly/redoc/tree/main/src/adapters/graphql): `src/adapters/graphql`

### Documentation UI

- [Redoc entry points](https://github.com/redocly/redoc/blob/main/src/Redoc.tsx): `src/Redoc.tsx`
- [Documentation pages](https://github.com/redocly/redoc/tree/main/src/pages): `src/pages`
- [Content rendering](https://github.com/redocly/redoc/blob/main/src/components/ItemContent/ItemContentRenderer.tsx): `src/components/ItemContent/ItemContentRenderer.tsx`
- [Schema views](https://github.com/redocly/redoc/blob/main/src/components/Schema/SchemaView.tsx): `src/components/Schema/SchemaView.tsx`
- [Examples and panels](https://github.com/redocly/redoc/tree/main/src/components/panels): `src/components/panels`
- [MCP documentation](https://github.com/redocly/redoc/tree/main/src/components/Mcp): `src/components/Mcp`

### Navigation and discovery

- [Side menu](https://github.com/redocly/redoc/blob/main/src/components/SideMenu/SideMenu.tsx): `src/components/SideMenu/SideMenu.tsx`
- [Route resolution](https://github.com/redocly/redoc/blob/main/src/utils/routing.ts): `src/utils/routing.ts`
- [Search](https://github.com/redocly/redoc/tree/main/src/services/search): `src/services/search`
- [Deep links](https://github.com/redocly/redoc/blob/main/src/utils/deep-link.ts): `src/utils/deep-link.ts`

### Shared application state

- [Document models](https://github.com/redocly/redoc/tree/main/src/types): `src/types`
- [Application state](https://github.com/redocly/redoc/blob/main/src/jotai/app.ts): `src/jotai/app.ts`
- [API document store](https://github.com/redocly/redoc/blob/main/src/jotai/store.ts): `src/jotai/store.ts`

### Supporting services

- [Code samples](https://github.com/redocly/redoc/tree/main/src/services/code-samples): `src/services/code-samples`
- [GraphQL query samples](https://github.com/redocly/redoc/blob/main/src/utils/graphql-samples.ts): `src/utils/graphql-samples.ts`

### Other components

- **API author**
- **API definition**

## Connections

- API author → API definition: provides (evidence: `README.md`)
- API definition → Redoc entry points: documents from (evidence: `README.md`)
- Redoc entry points → OpenAPI adapter: supports (evidence: `README.md`)
- Redoc entry points → AsyncAPI adapter: supports (evidence: `README.md`)
- Redoc entry points → GraphQL adapter: supports (evidence: `README.md`)
- Redoc entry points → Documentation pages: renders docs
- Documentation pages → Content rendering: renders content
- Documentation pages → Side menu: shows navigation (evidence: `README.md`)
- Documentation pages → Examples and panels: shows examples (evidence: `README.md`)
- OpenAPI adapter → MCP documentation: documents extension (evidence: `README.md`)
- OpenAPI adapter → Code samples: provides samples (evidence: `README.md`)
- Content rendering → Schema views: renders schemas
- GraphQL query samples → Examples and panels: generates query sample (evidence: `src/components/panels/ExampleItem/GraphQLQueryItem.tsx`)
- Side menu → Route resolution: resolves active route
- Search → Documentation pages: searches documentation (evidence: `README.md`)
- Application state → API document store: shares document state (evidence: `src/jotai/app.ts`)
- Deep links → Schema views: supports deep links
- Document models → API document store: defines document models (evidence: `src/jotai/store.ts`)
