Skip to content

/docs/api: BFF-served public spec + grayscale API docs viewer #867

Done

Description

@athvin

API product implementation work · roadmap #1008 · use parent dependency order; not a separate product rank.

Part of #857. Stack rank 10 of 13. Depends on: T4 (the public document exists), T9 (the getting-started flow it documents).

Color

The visible deliverable. The browser never reaches er-server, so the spec is served by a BFF route and the page renders the public document. This ticket carries the epic's one open design decision: every off-the-shelf viewer (Swagger UI, Redoc, Scalar) uses a colour-coded HTTP-method palette as its primary affordance, against a design doc that forbids any palette — and a vendored stylesheet dodges the ESLint gate but not the rule. First task is the decision, recorded in the ticket: a grayscale theme override (hue replaced with weight/scale/side-of-axis per the design system's techniques) vs a documented exception owned by frontend-design-system.

Scope

  • BFF route serving openapi.public.json (+ check-bff-authz.mjs entry).
  • /docs/api page rendering the viewer.
  • MARKETING_PUBLIC_PATHS in src/lib/site/routes.ts + sitemap.ts in the same edit (the sitemap file's own comment pairs them) — without the PUBLIC_PATHS entry, crawlers and signed-out visitors get a login redirect.
  • Getting-started copy: mint a key (T9 flow) → Authorize (T3's bearer scheme) → first call.
  • Viewer dependency must clear make frontend-audit (HIGH/CRITICAL advisories + the license allowlist).
  • CSP: fine today — script-src 'self' 'unsafe-inline', report-only (next.config.ts).
  • Axe gate registration for the new screen.
  • Skills in this PR: frontend-design-system if an exception is minted; landing-page if the page sits in the marketing group.

Out of scope

An internal-document viewer (the internal doc stays a committed artifact); any change to the spec content itself.

Testing

  • Renders signed-out (Playwright: the proxy does not redirect /docs/api).
  • No palette-rule violation: make frontend green with the viewer styled.
  • Axe passes on the new screen; make frontend-audit clean with the new dependency.
  • Playwright: the Authorize → first-call flow against the mock backend.

Definition of done

Epic DoD, plus: a signed-out visitor reads the public API docs at /docs/api; the page documents the connect flow end-to-end with T9; the grayscale decision is written down where the design system says it lives.

Activity

  1. added
    accessibility
    enhancement
    javascript
    mvp
    on Nov 8, 2026
  2. athvin commented on Nov 25, 2026

    @athvin
    OwnerAuthor

    Decisions (owner, 2026-11-25), recorded before any code as the ticket asks:

    1. Viewer: in-house grayscale, no third-party viewer and no design exception. /docs/api renders openapi.public.json with the repo's own components. HTTP methods are distinguished by weight, case and position, never hue. This rules out Swagger UI, Redoc and Scalar. A stock viewer would need either a colour exception or a vendored grayscale theme that each upgrade can silently undo, plus a new dependency to clear make frontend-audit.
    2. First call: a copyable request, no live call. The page shows the exact curl (and code) for the first call, with the key and origin as environment variables, following the Self-service API keys: org-admin minting with a role ceiling, list endpoint, show-once UI #866 connect flow. The browser never sends a customer key anywhere, and the BFF boundary is unchanged: no relay of caller-supplied credentials and no CORS on er-server. The Playwright test asserts the generated request instead of a live response.
  3. self-assigned this
    on Nov 25, 2026
  4. athvin commented on Nov 25, 2026

    @athvin
    OwnerAuthor

    Claimed — working in #1217 (draft). Closing that PR releases the claim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

accessibilityenhancementjavascriptmvp

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions