This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Static site that hosts the phpMyFAQ API documentation.
It renders swagger-ui-react against OpenAPI specs fetched at runtime from the thorsten/phpMyFAQ GitHub repo (branches 4.0, 4.1, main).
Deployed on Vercel — pushing to main triggers deployment.
pnpm dev— Next.js dev server on http://localhost:3000 (Turbopack)pnpm build— production buildpnpm start— serve the production buildpnpm lint— ESLint flat config (eslint.config.mjs), composingeslint-config-next/core-web-vitalsandeslint-config-next/typescript. Note: Next 16 removednext lint, so this script invokeseslintdirectly.pnpm test— Vitest (jsdom + Testing Library).pnpm test:watchfor watch mode. A single test:pnpm test -- path/to/file.test.tsx -t "name". Test setup (vitest.setup.ts) stubswindow.matchMedia(jsdom doesn't implement it) and resets thedarkclass on<html>between tests.swagger-ui-reactis mocked in component tests to avoid pulling its CSS/runtime.
- Next.js 16 App Router (Turbopack default), React 19, TypeScript, Tailwind CSS 4 (CSS-first; no
tailwind.config.*— configure via@theme/@custom-variantinapp/globals.css). PostCSS uses@tailwindcss/postcss. - The entire UI is a single client component:
app/page.tsx. It owns version selection, dark-mode toggle, and renders<SwaggerUI url={...}/>. New API versions are added by extending theapiUrlsmap and the corresponding<option>entries there. app/layout.tsxandapp/globals.cssset up the global shell. Dark-mode styling for Swagger UI relies on the.swagger-container-dark/.swagger-container-lightclass wrappers plus thedarkclass on<html>.- Security headers (
X-Frame-Options: DENY,X-Content-Type-Options: nosniff,Referrer-Policy: origin-when-cross-origin) are configured innext.config.mjsand applied to all routes.