Skip to main content

๐Ÿ“š Documenting

Learn how to create and maintain documentation in NestFlux.

๐ŸŽฏ Documentation Platformโ€‹

NestFlux uses Docusaurus as its documentation platform, providing:

  • Modern Interface: Clean, professional documentation site
  • Markdown Support: Write docs in Markdown with MDX extensions
  • Search Functionality: Built-in search across all documentation
  • Responsive Design: Works perfectly on desktop and mobile
  • Version Control: Documentation lives alongside code

๐Ÿš€ Starting Documentationโ€‹

Start the documentation development server:

pnpm start:docs

This launches Docusaurus at http://localhost:3000 with hot reload for instant preview of changes.

๐Ÿ“ Documentation Structureโ€‹

The documentation is organized into two main sections:

๐Ÿ—๏ธ NestFlux Documentationโ€‹

Located in docs/docs/nestflux/ - Template Documentation

Contains documentation about the NestFlux template itself:

  • Architecture explanations
  • Setup and configuration guides
  • Feature patterns and conventions
  • Technology stack information
  • Development workflows

Purpose: Help developers understand how to use and extend the NestFlux template.

๐ŸŽฏ Project Documentationโ€‹

Located in docs/docs/project/ - Your Project's Documentation

Reserved for your specific project documentation:

  • Business logic and requirements
  • Domain-specific decisions
  • Project architecture choices
  • Team conventions and standards
  • Deployment procedures

Purpose: Document your specific project built with NestFlux.

โœ๏ธ Writing Documentationโ€‹

Creating New Pagesโ€‹

  1. Choose the right section:

    • NestFlux features โ†’ docs/docs/nestflux/
    • Project-specific content โ†’ docs/docs/project/
  2. Create the file:

    ---
    sidebar_position: 1
    ---

    # Your Page Title

    Page content here...
  3. Add to navigation: Files are automatically included in the sidebar based on their location and sidebar_position.

Markdown Featuresโ€‹

Docusaurus supports enhanced Markdown with:

  • Code blocks with syntax highlighting
  • Tabs for multiple examples
  • Admonitions for notes and warnings
  • Mermaid diagrams for flowcharts and schemas
  • MDX components for interactive content

Example Structureโ€‹

docs/docs/
โ”œโ”€โ”€ nestflux/ # Template documentation
โ”‚ โ”œโ”€โ”€ index.md
โ”‚ โ”œโ”€โ”€ architecture/
โ”‚ โ”œโ”€โ”€ getting-started/
โ”‚ โ””โ”€โ”€ technologies/
โ””โ”€โ”€ project/ # Your project docs
โ”œโ”€โ”€ index.md
โ”œโ”€โ”€ business-rules/
โ”œโ”€โ”€ deployment/
โ””โ”€โ”€ team-guidelines/

๐Ÿš€ Publishing Documentationโ€‹

Building Documentationโ€‹

Build the documentation site:

pnpm build:docs

Output: docs/build/ - Static site ready for deployment

Automated Pipelineโ€‹

NestFlux comes with a pre-configured GitHub Actions pipeline that:

  • Tests Documentation: Runs Playwright tests to ensure documentation works correctly
  • Publishes to GitHub Pages: Automatically deploys documentation on merge to main branch
  • Quality Assurance: Validates links, builds, and functionality before deployment

The pipeline ensures your documentation is always tested and up-to-date in production.

Manual Deployment Optionsโ€‹

  • GitHub Pages: Automatic deployment from repository (pre-configured)
  • Netlify/Vercel: Connect to your repository for auto-deployment
  • Static Hosting: Deploy the build/ folder to any static host