APIDocumer is a Next.js-based OpenAPI documentation viewer for static hosting. It loads public/openapi.yaml, groups endpoints by tags, and renders endpoint details, schemas, and examples in a searchable UI.
- OpenAPI 3.x viewer with sidebar navigation by tags
- Full-width, responsive documentation layout
- Endpoint search (path, method, summary, description, tag)
- Request/response schema and example rendering
- SEO-aware metadata generated from OpenAPI spec fields
- Static export support for GitHub Pages
- Next.js 15
- React 19
- TypeScript
- Tailwind CSS + Radix UI
src/app/page.tsx: server entry, OpenAPI loader, and SEO metadata generationsrc/components/doc-viewer.tsx: main documentation UIsrc/components/endpoint-display.tsx: endpoint details renderersrc/lib/openapi-parser.ts: tag grouping and$refhelperspublic/openapi.yaml: source OpenAPI spec loaded at build/runtime.github/workflows/deploy.yml: GitHub Pages deployment workflow
- Install dependencies:
npm ci- Run dev server:
npm run dev- Open
http://localhost:9002.
Generate production static output:
npm run deployThis runs next build (with output: 'export') and creates out/ with .nojekyll for GitHub Pages compatibility.
This repository includes .github/workflows/deploy.yml which:
- installs dependencies with
npm ci - builds static output via
npm run deploy - uploads
out/as the Pages artifact - deploys to GitHub Pages
- In GitHub, go to Settings > Pages.
- Set source to GitHub Actions.
- Ensure the default branch for deployment is
main.
APIDocumer reads documentation data from public/openapi.yaml.
For best SEO and discoverability, include high-quality fields in your spec:
info.titleinfo.descriptioninfo.versionservers[0].url- optional
info.x-keywords(string array)
These are used to build page metadata (title, description, keywords, Open Graph, and Twitter cards).
- Fork the repository
- Create a feature branch
- Make changes with clear commit messages
- Open a pull request with:
- what changed
- why it changed
- screenshots for UI changes
Use these before opening a PR:
npm run typecheck
npm run lint
npm run buildAdd your preferred open-source license file (for example MIT) and update this section accordingly.