ADR 0018 — Documentation Site (Docusaurus)
Status: Accepted (Phase 12) Context date: 2026-07
Context
The platform has accumulated 12 architecture docs, 8 ADRs, 7 OpenAPI specifications, 5 event schemas, a WebSocket protocol spec, and SDKs for JavaScript/Swift/Android — all as raw markdown and YAML/JSON scattered across the repository. There is no unified, browsable documentation site. Developers must navigate raw files in the repo to find information.
Key requirements:
- Browsable — searchable, organized, with sidebar navigation.
- Interactive API reference — auto-generated from OpenAPI specs with "try it" panels.
- Diagram support — Mermaid diagrams already in architecture docs must render.
- Low maintenance — docs should sync from the source of truth in
docs/andcontracts/. - CI-friendly —
npm run buildmust succeed without broken links.
Decision
Create a self-contained Docusaurus 3.x site at docs-site/ with:
docusaurus-plugin-openapi-docs(PaloAltoNetworks, v4.x) for interactive API reference from all 7 OpenAPI specs.@docusaurus/theme-mermaidfor rendering Mermaid diagrams.- Copy, not symlink — a
scripts/sync-docs.shscript copies architecture docs and ADRs fromdocs/into the Docusaurus tree with frontmatter injection. Symlinks were rejected because they break on some CI runners and Windows. - No versioning initially — the API is pre-1.0; versioning adds complexity without benefit yet.
- Six sidebar categories: Getting Started, Architecture, API Reference, SDKs, Events & Protocols, ADRs.
Alternatives Considered
| Option | Rejected Because |
|---|---|
| MkDocs + Material | No native OpenAPI rendering; separate plugin ecosystem. |
| Nextra (Next.js) | Heavier runtime; less mature plugin ecosystem for OpenAPI. |
| Redocly | Excellent for API-only docs but weak for narrative documentation. |
| GitHub Wiki | No CI integration, no sidebar control, no OpenAPI rendering. |
Consequences
- Positive: Unified documentation site with interactive API reference, Mermaid diagrams, and organized navigation. Build-time link validation catches stale references.
- Positive:
docs/remains the source of truth. The sync script is idempotent and runs before every build. - Negative: Duplicated content between
docs/anddocs-site/docs/. The sync script mitigates this but adds a build step. - Negative: OpenAPI docs are generated and
.gitignored, requiringnpm run gen-api-docsbefore build. - Follow-up: Add doc versioning when the API reaches 1.0. Consider Algolia DocSearch for full-text search.