docs(website): finalize the API plan — in-place router split, no /api/v2 #48
Reference in New Issue
Block a user
No description provided.
Delete Branch "docs/api-plan-final"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What & why
Finalizes the API v2 plan after a review pass. Three of the four pieces it described are not being built; what survives is the work that is actually justified.
auth/session.service.jsalready unifies cookie and bearer; the SSO / PKCE / pending-TOTP transaction cookies survive any merge (so "cookies are gone" was never true); and it dragged the admin-SSEfetch+ReadableStreamrewrite along as a dependency for no user-visible payoff. Recorded as deferred behind trigger conditions, with the two specs a revival must write first (refresh-token reuse detection, rollback procedure)./api/v2. The URL surface is already grouped by capability —/admin110 routes across 18 prefixes,/auth42,/public24,/player20 — so each capability router mounts at the prefix it already owns and every URL stays byte-identical. No dual mount, no per-route migration, no v1 retirement. The SPA (BASE = /api/v1), the Discord bot (SITE_PUBLIC_URL), and the Android app are all untouched.API_V2_SKELETON.mdis marked superseded, body unedited, kept as the recipe if a versioned API is ever forced./api/mobilefacade + app-version floor deferred. Nothing threatens the app when no URL moves and nothing is deleted; a facade would be ~70 permanently maintained delegate routes solving a problem that doesn't exist. Revival note recorded: start from the one-line alias mountapiRouter.use('/mobile', v1Router), hand-written delegates only where the mobile contract genuinely diverges. The M11 milestone is dropped fromandroid/PLAN.md.git diff --exit-code. The baselinewebsite/api-route-inventory.json(199 API routes + 2 internal) is committed here, and PR 0's generator must reproduce it byte-for-byte.server/src/app.jsis justform-action 'self'(absent today) andframe-ancestors 'self' → 'none'.How it was tested
Docs-only, so verification was against the code the plan describes:
app._router.stackfrom a barerequire('src/app.js')— confirmed it neither listens nor connects to the DB, and yields exactly the 110/api/v1/adminroutes thatadmin.routes.jsdefines. The manifest is scoped to/api/**+/.well-known/**+ the internal app, because the SPA catch-all and/brandmounts are filesystem-conditional and would otherwise make it depend on whether CI built the client.server/src/app.js;admin.routes.jsline/route counts confirmed; the app's hardcodedapi/v1/…path count (69) re-counted from theandroid-appsources.Checklist
AI-assisted contributions (required)
Claude Code (Opus 5). I have reviewed and understand every change, and take responsibility for it. AI-authored commits are marked with aCo-Authored-Bytrailer.License