You are viewing archived documentation for v0.98. Go to latest →

Documentation Site

The documentation site is an optional component that serves the Otavi docs as a browsable website using Express and markdown-it.

Docker Deployment

The docs site is included in the standard docker-compose.yml stack as the docs container. It runs automatically alongside the hub.

No additional configuration is needed beyond setting the FQDN.

Configuration

Set the documentation site FQDN in your .env file:

OTAVI_DOCS_FQDN=docs.otavi.example.com

Traefik routes HTTPS traffic for this FQDN to the docs container automatically via Docker labels in docker-compose.yml.

Standalone Deployment

The docs site can also be run independently:

cd docs
npm install
node server.js

By default it listens on port 80 (configurable via the PORT environment variable).

Writing pages

Pages are Markdown under guide/, reference/ and deployment/, listed in the sidebar in docs/server.js. The site uses the web app's look: its palettes, fonts and wordmark (docs/static/style.css; the font and the wordmark's o come from pnpm brand:assets), dark by default with a switch for light that each reader's browser remembers.

Badges

A badge labels what a sentence or a table cell applies to. Four kinds, one colour each:

Write Shows For
:level[hub], :level[team], :level[account], :level[satellite] Hub Team Account Satellite the level a setting or rule applies at
:role[viewer], :role[member], :role[admin], :role[owner], :role[hub admin] Member Hub admin the lowest role that may do it
:app[web], :app[phone], :app[pi], :app[hub], :app[worker] Web app Phone Raspberry Pi where it runs or shows
:since[hub 0.76.0], :since[Pi 1.6.5], :since[phone 1.28.0] hub 0.76.0 the release it arrived in, linked to its changelog entry

Versions need no markup: a release tag (vhub-0.64.0+, vsat-1.6.5, vapk-1.28.0), a pre-0.28 hub version (v0.29+) or a component with its full version (hub 0.76.0, Pi 1.6.5, phone 1.28.0) becomes a version badge by itself. BirdNET's model versions (v2.4) are left alone. A version whose release has no notes links to its minor version's group, or to nothing. The settings and permissions tables in reference/settings-and-permissions.md are generated with level and role badges (pnpm --filter @otavi/hub settings:docs).

Diagrams

A ```mermaid block becomes a diagram, drawn by the site itself (no outside request) in the reader's theme and drawn again when they switch it. Each has zoom buttons and a Full screen button; the wheel zooms in full screen (with Ctrl or Cmd on the page, which keeps scrolling otherwise), as do a pinch and a double click, and a zoomed diagram moves by dragging. Colour a node by its kind with a class whose colours follow the theme (docs/static/style.css, --dg-*): declare the class with a line width (classDef app stroke-width:2px, needed by the syntax) and assign it (class api,web app). The kinds:

Class For
satellite Pis and phones
person People and their browsers
transport The proxy and the broker
app The hub's own services
work The inference workers
store Database, queue, object store
outside Outside services and side jobs (dashed: add stroke-dasharray:5 4 to its classDef)

Leave colours out of the diagram itself: a fixed style or fill reads in one theme only. An icon goes at the start of a node's label, api["<span class='dg-icon i-api'></span>api<br/>Fastify"], drawn in the node's text colour; the available icons and how to add one are in docs/static/icons/README.md.

Changelog

The Changelog section (/changelog/hub, /changelog/satellite, /changelog/mobile) is drawn from the repository's CHANGELOG.md at start-up, one page per release stream, grouped by minor version. The docs image copies the file, so a release shows up once the docs container is rebuilt. The releases up to hub 0.27, when every component shared one version, are on the hub page.