A comprehensive documentation site built with Docusaurus featuring C4 architecture models, specifications, and interactive API documentation.
- System Context diagrams
- Container diagrams
- Component diagrams
- Rendered directly from Markdown using Mermaid
- Functional requirements
- Non-functional requirements
- State diagrams
- Entity-relationship diagrams
- Test scenarios
- Auto-generated from OpenAPI 3.1 specs
- Interactive API playground for admin endpoints
- Complete RBAC and provisioning API
- Authentication examples
- Node.js >= 20.0
- npm or yarn
- Python 3.11+ (for SpecKit)
- uv tool (for SpecKit installation)
npm installStart the development server:
npm startThe site will open at http://localhost:3000.
npm run buildThe static files will be generated in the build directory.
law-firm-doc/
├── docs/ # Documentation content
│ ├── intro.md # Introduction page
│ ├── getting-started.md # Getting started guide
│ ├── c4-models/ # C4 architecture diagrams
│ │ ├── system-context.md # System context diagram
│ │ ├── container-diagram.md # Container diagram
│ │ └── component-diagram.md # Component diagram
│ ├── specifications/ # Feature specifications
│ │ └── case-management-spec.md
│ └── api/ # Auto-generated API docs
│ └── *.api.mdx # Generated from OpenAPI spec
├── examples/ # Example files
│ └── openapi.yaml # OpenAPI specification
├── src/ # Custom React components
├── static/ # Static assets
├── docusaurus.config.ts # Docusaurus configuration
├── sidebars.ts # Sidebar configuration
└── package.json
- Create a new
.mdfile indocs/c4-models/ - Add Mermaid code blocks with C4 syntax:
Supported C4 diagram types:
C4Context- System contextC4Container- Container viewC4Component- Component view
Create files in docs/specifications/ with:
- Functional requirements
- Non-functional requirements
- Mermaid diagrams (state, ER, sequence, etc.)
- Test scenarios
- References to API docs
SpecKit allows you to create specifications with AI assistance:
-
Use slash commands in Claude Code:
/speckit.constitution # Establish project principles /speckit.specify # Create a specification /speckit.plan # Create implementation plan /speckit.tasks # Generate task list /speckit.implement # Execute implementation -
Specs are automatically visible in Docusaurus under "SpecKit Specifications"
-
Specs are stored in
.specify/specs/[feature-name]/
For detailed instructions, see the SpecKit Guide in the documentation.
- Edit the OpenAPI spec:
examples/admin-api.yaml - Regenerate API docs:
npm run docusaurus gen-api-docs adminApi
- The docs in
docs/admin-api/will be automatically updated
npm start- Start development servernpm run build- Build for productionnpm run serve- Serve production build locallynpm run clear- Clear Docusaurus cachenpm run docusaurus gen-api-docs all- Regenerate API docsnpm run typecheck- Run TypeScript type checking
@docusaurus/core- Core Docusaurus framework@docusaurus/preset-classic- Classic theme preset@docusaurus/theme-mermaid- Mermaid diagram supportdocusaurus-plugin-openapi-docs- OpenAPI docs generatordocusaurus-theme-openapi-docs- OpenAPI docs theme
- Clear cache:
npm run clear - Check Mermaid syntax is correct
- Ensure proper indentation
- Run:
npm run docusaurus gen-api-docs all - Check OpenAPI spec is valid
- Clear cache and rebuild
- Check Node.js version (>= 20.0)
- Clear cache:
npm run clear - Delete
node_modulesand reinstall
Using GitHub Pages:
npm run deployOr build and deploy to any static hosting service:
npm run build
# Deploy the 'build' directory