#1643

feat: add the API docs page

Draftjubianchiwants to merge intofrom

WARNING

Depends on #1642, still open. Until it merges, this diff also shows its changes; this pull request's own changes.

Summary

The v1 API had no public page. This adds /docs/api, readable by everyone, on the console shell from #1642, with its first guide: the Introduction. Part of #857 (it documents the v1 API, not /api/cli), and second of five pull requests splitting #1533.

Changes

  1. Page. /docs/api redirects to /docs/api/introduction; a section the docs don't have is the not found page. ApiDocsSection lists the sections, ApiDocsController renders one with its preview metadata.
  2. Introduction. What the API is for, its base URL, format and Accept: application/json, and a first request. Its code is highlighted on the server (ApiGuideSnippets) and shown in the site's code blocks.
  3. Links. API is linked from the aside, after Apps, and from the user menu.
#Pull requestDepends on
0#1642 the console layoutproduction
1this one0
2#1644 the guides1
3#1645 the OpenAPI spec2
4#1646 the endpoint reference and search3

Validation

CheckResult
pest --parallel --coverage --exactly=100.0 (full suite)6461 passed, 100.0%
pest --type-coverage --min=100100.0%
pint --test, rector --dry-run, phpstanclean
TSX tests, tsc1120 passed, clean

Visual evidence

Playwright (Chromium) against a local dev server on this branch, emulated viewports, Inertia SSR off. The Introduction was captured at 1440×900, 1366×650 and 390×844, light and dark: layout shift (CLS) 0 on load, no horizontal overflow, no console error.

Introduction, 1440 light1366 dark390 dark390 light

The API link, before and after, in the aside's footer links and in the user menu (captured while this change was part of #1533; the links are unchanged), and a guest's mobile header with its way back to /dev/null.

Before, 1440 lightAfter, 1440 lightBefore, 390 lightAfter, 390 lightGuest header, 390 light

Device verification

Emulation only (390×844, DPR 2, touch): no hardware or simulator.

Independent review

Fresh read-only reviewers, given the guidelines, the stack, the validation results and the captures. A first round on the previous heads found should-fix points (fixtures and options ahead of their PR, the Errors table hiding its meanings on a phone, the Guilds preview, captures from before production's guild fields), all fixed. Re-review on base 1aa85cf4, head 6b4aee82: CODE: PASS, VISUAL: PASS, no blocker or should-fix.

Limitations

The sidebar lists the Introduction alone until #1644.

Activity

4
coderabbitai[bot]13d ago

IMPORTANT

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

paulinevos7d ago

Might make sense to automate API docs generation instead?

This pull request is a draft

Merging is unavailable until it is marked ready for review.