Source for the Obsrv documentation site published at docs.obsrv.ai.
It is a static site built with Astro and the Starlight docs framework, with the API reference generated from the Obsrv OpenAPI spec. The site is deployed to GitHub Pages automatically on every push to main.
Obsrv is an open-source observability and data platform incubated within the Sunbird initiative.
- Node.js 22+
- pnpm (the repo pins
pnpm@11.2.2viapackageManager)
pnpm install
pnpm devThis starts the Astro dev server (default at http://localhost:4321). The dev script first runs scripts/transform-openapi.mjs to generate the API reference spec.
| Command | Description |
|---|---|
pnpm dev |
Generate the OpenAPI spec, then start the dev server with hot reload. |
pnpm build |
Generate the OpenAPI spec, then build the production site into dist/. Fails on broken internal links. |
pnpm preview |
Serve the production build locally for a final check. |
There is no separate test suite — a successful pnpm build is the validation gate (it type-checks and validates all internal links). Run it before pushing.
Documentation pages live as .mdx files under src/content/docs/. The file path maps directly to the URL — e.g. src/content/docs/guides/installation/aws-installation-guide.mdx → /guides/installation/aws-installation-guide. Images go in public/assets/ and are referenced as /assets/....
The sidebar navigation is defined manually in astro.config.mjs. When you add a new page, add a corresponding entry there (or confirm it lives under one of the autogenerate directory groups).
The top-level directories (
introduction/,core-concepts/,guides/, etc.) are the frozen original GitBook source kept for reference. Editing them does not affect the live site — edit the.mdxfiles undersrc/content/docs/instead.
The pages under /guides/api-specification are generated, not hand-written:
- CI syncs the upstream OpenAPI spec from
Sanketika-Obsrv/obsrv-api-serviceintoopenapi/openapi_v2.yml(a committed copy serves as fallback). scripts/transform-openapi.mjs(run as part ofdev/build) collapses the spec's granular tags into a small set of sections and writes the derivedopenapi/openapi.generated.yml.- The
starlight-openapiplugin renders the reference pages from that generated spec.
To change how API endpoints are grouped, edit the tag mapping in scripts/transform-openapi.mjs.
src/content/docs/ Documentation pages (.mdx) — the live content
src/components/ Starlight component overrides (sidebar, page title, etc.)
src/styles/ Global CSS
openapi/ OpenAPI source spec (the .generated.yml is built, git-ignored)
scripts/ Build-time scripts (OpenAPI transform, one-time migration)
public/ Static assets served at the site root
astro.config.mjs Site config: Starlight options, plugins, sidebar, redirects
Pushing to main triggers .github/workflows/deploy.yml, which syncs the API spec, runs pnpm build, and publishes dist/ to GitHub Pages.
See LICENSE.