Skip to content

Preview

The RapiDoc Portal packages are not on npm yet. Until they are, run the CLI from a checkout of the RapiDoc monorepo: node <monorepo>/packages/rapidoc-cli/src/index.js <command> instead of npx rapidoc <command>.

  • Node.js 22.12 or later
  • One or more OpenAPI 3.0, 3.1 or Swagger 2.0 files (optional: the starter includes one)
  1. Scaffold the project

    npm create rapidoc@latest my-portal

    In a repository that already has OpenAPI files, run npx rapidoc init there instead. It finds the specs and asks which to list under apis:, the site title, and whether to install the dependencies, then prints the command that does the same without questions. Options: --title "Acme Developers", --spec <file> (repeatable), --no-install, --force to overwrite existing files, and --yes to take the defaults without asking.

  2. Start the dev server

    cd my-portal
    npm run dev

    The portal opens on http://localhost:4321. Guide edits appear immediately; a change to rapidoc.config.yaml or a spec restarts the server.

  3. Make it yours

    Edit rapidoc.config.yaml: the site title and logo, the theme color, the header tabs and the sidebar. Write guides in docs/. See Configuration and Writing guides.

  4. Build for production

    npm run build

    The static site is written to dist/. Upload it to any static host: see Static hosting.

my-portal/
├── rapidoc.config.yaml # site, header, tabs, theme, APIs
├── package.json # dev, build and validate scripts
├── specs/api.yaml # a starter spec (or your own specs)
├── docs/
│ ├── index.markdoc # the home page
│ ├── getting-started.md
│ └── guides/overview.markdoc
└── .gitignore # node_modules/, dist/, .rapidoc-temp/

Read on in Project structure.

npx rapidoc validate

It checks every local spec in apis: against the OpenAPI schema and exits with code 1 on an error. See Validate.