# draftbot/documentation architecture

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

- Interactive diagram: https://gitdiagram.com/draftbot/documentation
- Repository: https://github.com/draftbot/documentation

## Overview

DraftBot’s product in this repository is bilingual community documentation, not the bot itself. The documented workflow is contributors writing French source pages, English translations being produced and reviewed in pull requests, and the documentation being served on DraftBot’s sites. The tree also shows scripts for translation-status checks, link validation, glossary generation, and shared parsing. Their utility-level calls are supported by the excerpts; feature-section nodes represent documentation directories, not implementations of the bot features they describe.

Main entry points: [`scripts/lib/pages.mjs`](https://github.com/draftbot/documentation/blob/main/scripts/lib/pages.mjs) (Page discovery), [`docs/fr`](https://github.com/draftbot/documentation/tree/main/docs/fr) (French source), [`docs/en`](https://github.com/draftbot/documentation/tree/main/docs/en) (English translations), [`scripts/lib/links.mjs`](https://github.com/draftbot/documentation/blob/main/scripts/lib/links.mjs) (Link analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Documentation content"]
  node_fr_docs["French source"]
  node_en_docs["English translations"]
  node_welcome["Member welcome<br/>[4.member-welcome]"]
  node_engagement["Engagement<br/>[5.engagement]"]
  node_security["Security<br/>[6.security]"]
  node_communication["Communication<br/>[7.communication]"]
  node_community["Community<br/>[8.community]"]
  node_games["Games and events<br/>[9.games-and-events]"]
  node_utilities["Utilities<br/>[10.utilities]"]
  node_misc["Miscellaneous<br/>[11.misc]"]
end

subgraph group_translation["Translation tooling"]
  node_translation_check["Translation checks"]
  node_pages["Page discovery<br/>[pages.mjs]"]
  node_frontmatter["Frontmatter and hashes<br/>[frontmatter.mjs]"]
  node_glossary_cli["Glossary builder<br/>[build-glossary.mjs]"]
  node_glossary["Glossary generation<br/>[glossary.mjs]"]
end

subgraph group_validation["Content validation"]
  node_link_check["Link checks<br/>[check-links.mjs]"]
  node_links["Link analysis<br/>[links.mjs]"]
end

node_contributors(("Contributors"))
node_docs_sites["DraftBot documentation sites"]

node_contributors -->|"write source"| node_fr_docs
node_fr_docs -->|"translate and review"| node_en_docs
node_fr_docs -->|"serve French"| node_docs_sites
node_en_docs -->|"serve English"| node_docs_sites
node_translation_check -->|"find page issues"| node_pages
node_pages -->|"parse metadata"| node_frontmatter
node_glossary_cli -->|"build and merge"| node_glossary
node_link_check -->|"find broken links"| node_links
node_links -->|"list pages"| node_pages
node_pages -->|"hash content"| node_frontmatter

click node_fr_docs "https://github.com/draftbot/documentation/tree/main/docs/fr"
click node_en_docs "https://github.com/draftbot/documentation/tree/main/docs/en"
click node_welcome "https://github.com/draftbot/documentation/tree/main/docs/fr/4.member-welcome"
click node_engagement "https://github.com/draftbot/documentation/tree/main/docs/fr/5.engagement"
click node_security "https://github.com/draftbot/documentation/tree/main/docs/fr/6.security"
click node_communication "https://github.com/draftbot/documentation/tree/main/docs/fr/7.communication"
click node_community "https://github.com/draftbot/documentation/tree/main/docs/fr/8.community"
click node_games "https://github.com/draftbot/documentation/tree/main/docs/fr/9.games-and-events"
click node_utilities "https://github.com/draftbot/documentation/tree/main/docs/fr/10.utilities"
click node_misc "https://github.com/draftbot/documentation/tree/main/docs/fr/11.misc"
click node_translation_check "https://github.com/draftbot/documentation/blob/main/scripts/check-translations.mjs"
click node_pages "https://github.com/draftbot/documentation/blob/main/scripts/lib/pages.mjs"
click node_frontmatter "https://github.com/draftbot/documentation/blob/main/scripts/lib/frontmatter.mjs"
click node_glossary_cli "https://github.com/draftbot/documentation/blob/main/scripts/build-glossary.mjs"
click node_glossary "https://github.com/draftbot/documentation/blob/main/scripts/lib/glossary.mjs"
click node_link_check "https://github.com/draftbot/documentation/blob/main/scripts/check-links.mjs"
click node_links "https://github.com/draftbot/documentation/blob/main/scripts/lib/links.mjs"

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_fr_docs,node_en_docs,node_welcome,node_engagement,node_security,node_communication,node_community,node_games,node_utilities,node_misc toneBlue
class node_translation_check,node_pages,node_frontmatter,node_glossary_cli,node_glossary toneAmber
class node_link_check,node_links toneMint
class node_contributors,node_docs_sites toneIndigo
```

## Components

### Documentation content

- [French source](https://github.com/draftbot/documentation/tree/main/docs/fr): `docs/fr`
- [English translations](https://github.com/draftbot/documentation/tree/main/docs/en): `docs/en`
- [Member welcome](https://github.com/draftbot/documentation/tree/main/docs/fr/4.member-welcome): `docs/fr/4.member-welcome`
- [Engagement](https://github.com/draftbot/documentation/tree/main/docs/fr/5.engagement): `docs/fr/5.engagement`
- [Security](https://github.com/draftbot/documentation/tree/main/docs/fr/6.security): `docs/fr/6.security`
- [Communication](https://github.com/draftbot/documentation/tree/main/docs/fr/7.communication): `docs/fr/7.communication`
- [Community](https://github.com/draftbot/documentation/tree/main/docs/fr/8.community): `docs/fr/8.community`
- [Games and events](https://github.com/draftbot/documentation/tree/main/docs/fr/9.games-and-events): `docs/fr/9.games-and-events`
- [Utilities](https://github.com/draftbot/documentation/tree/main/docs/fr/10.utilities): `docs/fr/10.utilities`
- [Miscellaneous](https://github.com/draftbot/documentation/tree/main/docs/fr/11.misc): `docs/fr/11.misc`

### Translation tooling

- [Translation checks](https://github.com/draftbot/documentation/blob/main/scripts/check-translations.mjs): `scripts/check-translations.mjs`
- [Page discovery](https://github.com/draftbot/documentation/blob/main/scripts/lib/pages.mjs): `scripts/lib/pages.mjs`
- [Frontmatter and hashes](https://github.com/draftbot/documentation/blob/main/scripts/lib/frontmatter.mjs): `scripts/lib/frontmatter.mjs`
- [Glossary builder](https://github.com/draftbot/documentation/blob/main/scripts/build-glossary.mjs): `scripts/build-glossary.mjs`
- [Glossary generation](https://github.com/draftbot/documentation/blob/main/scripts/lib/glossary.mjs): `scripts/lib/glossary.mjs`

### Content validation

- [Link checks](https://github.com/draftbot/documentation/blob/main/scripts/check-links.mjs): `scripts/check-links.mjs`
- [Link analysis](https://github.com/draftbot/documentation/blob/main/scripts/lib/links.mjs): `scripts/lib/links.mjs`

### Other components

- **Contributors**
- **DraftBot documentation sites**

## Connections

- Contributors → French source: write source (evidence: `README.md`)
- French source → English translations: translate and review (evidence: `README.md`)
- French source → DraftBot documentation sites: serve French (evidence: `README.md`)
- English translations → DraftBot documentation sites: serve English (evidence: `README.md`)
- Translation checks → Page discovery: find page issues (evidence: `scripts/check-translations.mjs`)
- Page discovery → Frontmatter and hashes: parse metadata (evidence: `scripts/lib/pages.mjs`)
- Glossary builder → Glossary generation: build and merge (evidence: `scripts/build-glossary.mjs`)
- Link checks → Link analysis: find broken links (evidence: `scripts/check-links.mjs`)
- Link analysis → Page discovery: list pages (evidence: `scripts/lib/links.mjs`)
- Page discovery → Frontmatter and hashes: hash content (evidence: `scripts/lib/pages.mjs`)
