# excalidraw/excalidraw-libraries architecture

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

- Interactive diagram: https://gitdiagram.com/excalidraw/excalidraw-libraries
- Repository: https://github.com/excalidraw/excalidraw-libraries

## Overview

This repository serves a public catalog of community-made Excalidraw libraries. A visitor browses the site, searches or sorts the catalog, and can open or install a library for use in Excalidraw. The sampled browser code loads catalog metadata and download statistics, then renders entries and their previews; the library files are the catalog’s downloadable content. The README also documents creating and publishing libraries through the Excalidraw editor. Source excerpts are partial, so details of individual install and publish interactions are not mapped.

Main entry points: [`script.js`](https://github.com/excalidraw/excalidraw-libraries/blob/main/script.js) (Catalog interface), [`index.html`](https://github.com/excalidraw/excalidraw-libraries/blob/main/index.html) (Catalog page), [`libraries`](https://github.com/excalidraw/excalidraw-libraries/tree/main/libraries) (Library files), [`libraries.json`](https://github.com/excalidraw/excalidraw-libraries/blob/main/libraries.json) (Library metadata)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Library catalog"]
  node_catalog_ui["Catalog interface<br/>[script.js]"]
  node_page["Catalog page<br/>[index.html]"]
end

subgraph group_content["Library content"]
  node_library_metadata["Library metadata<br/>[libraries.json]"]
  node_download_stats["Download statistics<br/>[stats.json]"]
  node_library_files["Library files"]
end

subgraph group_serving["Site serving"]
  node_static_server["Static file server<br/>[index.js]"]
end

node_visitor(("Visitor"))
node_excalidraw["Excalidraw editor"]

node_visitor -->|"browses"| node_page
node_page -->|"loads"| node_catalog_ui
node_catalog_ui -->|"fetches"| node_library_metadata
node_catalog_ui -->|"fetches"| node_download_stats
node_catalog_ui -->|"links previews"| node_library_files
node_visitor -->|"creates libraries"| node_excalidraw
node_excalidraw -.->|"publishes library"| node_library_files
node_visitor -.->|"installs library"| node_excalidraw

click node_catalog_ui "https://github.com/excalidraw/excalidraw-libraries/blob/main/script.js"
click node_page "https://github.com/excalidraw/excalidraw-libraries/blob/main/index.html"
click node_library_metadata "https://github.com/excalidraw/excalidraw-libraries/blob/main/libraries.json"
click node_download_stats "https://github.com/excalidraw/excalidraw-libraries/blob/main/stats.json"
click node_library_files "https://github.com/excalidraw/excalidraw-libraries/tree/main/libraries"
click node_static_server "https://github.com/excalidraw/excalidraw-libraries/blob/main/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_catalog_ui,node_page toneBlue
class node_library_metadata,node_download_stats,node_library_files toneAmber
class node_static_server toneMint
class node_visitor,node_excalidraw toneIndigo
```

## Components

### Library catalog

- [Catalog interface](https://github.com/excalidraw/excalidraw-libraries/blob/main/script.js): `script.js`
- [Catalog page](https://github.com/excalidraw/excalidraw-libraries/blob/main/index.html): `index.html`

### Library content

- [Library metadata](https://github.com/excalidraw/excalidraw-libraries/blob/main/libraries.json): `libraries.json`
- [Download statistics](https://github.com/excalidraw/excalidraw-libraries/blob/main/stats.json): `stats.json`
- [Library files](https://github.com/excalidraw/excalidraw-libraries/tree/main/libraries): `libraries`

### Site serving

- [Static file server](https://github.com/excalidraw/excalidraw-libraries/blob/main/index.js): `index.js`

### Other components

- **Visitor**
- **Excalidraw editor**

## Connections

- Visitor → Catalog page: browses (evidence: `README.md`)
- Catalog page → Catalog interface: loads
- Catalog interface → Library metadata: fetches (evidence: `script.js`)
- Catalog interface → Download statistics: fetches (evidence: `script.js`)
- Catalog interface → Library files: links previews (evidence: `script.js`)
- Visitor → Excalidraw editor: creates libraries (evidence: `README.md`)
- Excalidraw editor → Library files: publishes library (evidence: `README.md`)
- Visitor → Excalidraw editor: installs library (evidence: `README.md`)
