Context
Both loopover-ui and metagraphed's apps/ui currently hand-author docs as individual TanStack Router route files (docs.<slug>.tsx), each a full React component with hardcoded JSX content, meta tags, and manually-maintained nav entries in docs.index.tsx. This doesn't scale: every content edit touches a component file, there's no structured content model, no generated navigation, and no search. It also means every "add a docs page" contributor issue currently asks for a whole hand-built route rather than prose.
Decided direction (2026-07-15, after research into Mintlify, Fumadocs, Docusaurus, Nextra, Starlight, Content Collections, and Scalar): fumadocs-core + fumadocs-mdx (headless — not fumadocs-ui's full component shell) as the MDX content/structure/search layer, rendered through the existing <DocsPage>/Callout/CodeBlock ui-kit primitives, plus Scalar's @scalar/api-reference (MIT, self-hosted, framework-agnostic) for the API playground instead of fumadocs-openapi.
This is a spike, not a committed integration, because of two real open risks that need proving, not assuming:
fumadocs-openapi's createAPIPage has documented, recent compatibility issues in TanStack/Vite environments — this is why the plan routes around it entirely via Scalar rather than trying to make it work.
- Both apps run Vite through
@lovable.dev/vite-tanstack-config, a managed preset that explicitly warns against adding plugins directly ("do NOT add them manually or the app will break with duplicate plugins"). Fumadocs' official TanStack Start guide assumes a bare TanStack Start + Vite setup — it has never been tested against this specific wrapped preset. fumadocs-mdx/vite's plugin has to go through the preset's vite: {...} passthrough; whether that works cleanly (particularly around React/JSX processing, since viteReact is already registered by the preset) is unverified.
Requirements — this is a bounded proof, not a full migration
- Add
fumadocs-core + fumadocs-mdx to loopover-ui and get the Vite plugin working through @lovable.dev/vite-tanstack-config's vite: {...} passthrough, without duplicate-plugin breakage (dev server AND a real npm run build must both succeed — a dev-only proof isn't sufficient given the preset's own comments flag build-vs-dev-vs-sandbox differences).
- Define one
defineDocs/content-source config and migrate exactly one existing page — docs.self-hosting-quickstart.tsx is the suggested candidate (already read and understood from the recent AMS-docs work) — into an .mdx file, rendered through fumadocs-core's page-tree/source API but using the existing <DocsPage>/Callout/CodeBlock components from the ui-kit for actual markup, not fumadocs-ui's bundled components. Confirm visual output is unchanged from the current hand-built page.
- Confirm Fumadocs' built-in Orama search indexes the migrated page and returns real results, self-hosted (no external search service).
- Confirm nav/sidebar can be generated from the content source's page tree instead of a hand-maintained array like
docs.index.tsx's AUDIENCES.
- Separately, add
@scalar/api-reference as a standalone page or embed pointed at the existing OpenAPI JSON output (ui:openapi), and confirm the interactive "Try it" playground actually issues a request against a real endpoint.
- Write up findings in a PR-description-length report (not a new markdown doc under
docs/ — post as a PR description or issue comment, since it's a decision record, not user-facing content): what worked, what didn't, the exact working Vite config diff, whether the Lovable-preset passthrough needed anything non-obvious, and a clear go/no-go recommendation with a fallback (Content Collections was the runner-up architecture during research) if something in here turns out to be a blocker.
Deliverables
Test Coverage Requirements
This is UI/tooling work under apps/loopover-ui/** — outside coverage.include per this repo's convention, so Codecov's patch gate does not apply. If the spike touches anything under src/** (it shouldn't), that would inherit the normal 99%+ patch requirement.
Expected Outcome
A proven, working integration pattern (or a clear, evidenced reason it doesn't work here) that the AMS-docs migration (#6012 and its sub-issues, currently paused) and metagraphed's docs-page migration (currently paused) can both be re-scoped against, instead of guessing.
Links & Resources
Context
Both
loopover-uiand metagraphed'sapps/uicurrently hand-author docs as individual TanStack Router route files (docs.<slug>.tsx), each a full React component with hardcoded JSX content, meta tags, and manually-maintained nav entries indocs.index.tsx. This doesn't scale: every content edit touches a component file, there's no structured content model, no generated navigation, and no search. It also means every "add a docs page" contributor issue currently asks for a whole hand-built route rather than prose.Decided direction (2026-07-15, after research into Mintlify, Fumadocs, Docusaurus, Nextra, Starlight, Content Collections, and Scalar):
fumadocs-core+fumadocs-mdx(headless — notfumadocs-ui's full component shell) as the MDX content/structure/search layer, rendered through the existing<DocsPage>/Callout/CodeBlockui-kit primitives, plus Scalar's@scalar/api-reference(MIT, self-hosted, framework-agnostic) for the API playground instead offumadocs-openapi.This is a spike, not a committed integration, because of two real open risks that need proving, not assuming:
fumadocs-openapi'screateAPIPagehas documented, recent compatibility issues in TanStack/Vite environments — this is why the plan routes around it entirely via Scalar rather than trying to make it work.@lovable.dev/vite-tanstack-config, a managed preset that explicitly warns against adding plugins directly ("do NOT add them manually or the app will break with duplicate plugins"). Fumadocs' official TanStack Start guide assumes a bare TanStack Start + Vite setup — it has never been tested against this specific wrapped preset.fumadocs-mdx/vite's plugin has to go through the preset'svite: {...}passthrough; whether that works cleanly (particularly around React/JSX processing, sinceviteReactis already registered by the preset) is unverified.Requirements — this is a bounded proof, not a full migration
fumadocs-core+fumadocs-mdxtoloopover-uiand get the Vite plugin working through@lovable.dev/vite-tanstack-config'svite: {...}passthrough, without duplicate-plugin breakage (dev server AND a realnpm run buildmust both succeed — a dev-only proof isn't sufficient given the preset's own comments flag build-vs-dev-vs-sandbox differences).defineDocs/content-source config and migrate exactly one existing page —docs.self-hosting-quickstart.tsxis the suggested candidate (already read and understood from the recent AMS-docs work) — into an.mdxfile, rendered throughfumadocs-core's page-tree/source API but using the existing<DocsPage>/Callout/CodeBlockcomponents from the ui-kit for actual markup, notfumadocs-ui's bundled components. Confirm visual output is unchanged from the current hand-built page.docs.index.tsx'sAUDIENCES.@scalar/api-referenceas a standalone page or embed pointed at the existing OpenAPI JSON output (ui:openapi), and confirm the interactive "Try it" playground actually issues a request against a real endpoint.docs/— post as a PR description or issue comment, since it's a decision record, not user-facing content): what worked, what didn't, the exact working Vite config diff, whether the Lovable-preset passthrough needed anything non-obvious, and a clear go/no-go recommendation with a fallback (Content Collections was the runner-up architecture during research) if something in here turns out to be a blocker.Deliverables
fumadocs-mdxVite integration inloopover-ui, both dev and production build greendocs.self-hosting-quickstart.tsx's content) migrated to.mdx, rendered via existing ui-kit primitives, visually equivalent to todayTest Coverage Requirements
This is UI/tooling work under
apps/loopover-ui/**— outsidecoverage.includeper this repo's convention, so Codecov's patch gate does not apply. If the spike touches anything undersrc/**(it shouldn't), that would inherit the normal 99%+ patch requirement.Expected Outcome
A proven, working integration pattern (or a clear, evidenced reason it doesn't work here) that the AMS-docs migration (#6012 and its sub-issues, currently paused) and metagraphed's docs-page migration (currently paused) can both be re-scoped against, instead of guessing.
Links & Resources
apps/loopover-ui/vite.config.ts(the managed preset to integrate through)apps/loopover-ui/src/routes/docs.self-hosting-quickstart.tsx(candidate page to migrate)apps/loopover-ui/src/routes/docs.index.tsx(nav to eventually replace)