Skip to main content

Docusaurus Quick Start Guide

๐Ÿš€ Quick Setup (5 minutes)โ€‹

cd docs
./setup-docusaurus.sh

This script will:

  • Clean old VitePress artifacts
  • Install Docusaurus dependencies
  • Create favicon from logo
  • Test the build
  • Show next steps

Option 2: Manual Setupโ€‹

cd docs

# Install dependencies
npm install

# Start development server
npm run start

# Build for production
npm run build

๐Ÿ“‹ Quick Commandsโ€‹

CommandDescription
npm run startStart dev server at http://localhost:3000
npm run buildBuild production site
npm run servePreview production build
npm run clearClear cache
npm run deployDeploy to GitHub Pages

๐ŸŒ Development Serverโ€‹

npm run start

Visit: http://localhost:3000/mcp-adr-analysis-server/

The site will auto-reload when you edit markdown files.

๐Ÿ—๏ธ Building for Productionโ€‹

npm run build

Output: build/ directory (ready for deployment)

๐Ÿšข Deploymentโ€‹

Automatic (GitHub Actions)โ€‹

Push to main branch - GitHub Actions will automatically:

  1. Build the Docusaurus site
  2. Deploy to GitHub Pages
  3. Available at: https://tosin2013.github.io/mcp-adr-analysis-server/

Manual Deploymentโ€‹

npm run deploy

๐Ÿ“ Editing Documentationโ€‹

File Structureโ€‹

docs/
โ”œโ”€โ”€ tutorials/ # Learning-oriented guides
โ”œโ”€โ”€ how-to-guides/ # Problem-solving guides
โ”œโ”€โ”€ reference/ # Technical reference
โ”œโ”€โ”€ explanation/ # Understanding-oriented
โ””โ”€โ”€ ide-rules/ # IDE integration

Adding a New Pageโ€‹

  1. Create markdown file in appropriate directory:

    touch tutorials/my-new-tutorial.md
  2. Add front matter:

    ---
    id: my-new-tutorial
    title: My New Tutorial
    sidebar_label: New Tutorial
    sidebar_position: 4
    ---
  3. Add to sidebars.js if needed:

    'tutorials/my-new-tutorial',

Markdown Featuresโ€‹

Code Blocks with Syntax Highlightingโ€‹

interface MyInterface {
name: string;
value: number;
}

Admonitionsโ€‹

:::note
This is a note
:::

:::tip
This is a tip
:::

:::warning
This is a warning
:::

:::danger
This is dangerous
:::

Mermaid Diagramsโ€‹

```mermaid
graph TD
A[Start] --> B[Process]
B --> C[End]
```

Tabsโ€‹

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="npm" label="npm" default>
npm install
</TabItem>
<TabItem value="yarn" label="Yarn">
yarn install
</TabItem>
</Tabs>

๐ŸŽจ Customizationโ€‹

Theme Colorsโ€‹

Edit src/css/custom.css:

:root {
--ifm-color-primary: #646cff;
/* Change to your brand color */
}

Logo and Imagesโ€‹

  • Logo: static/img/logo.png
  • Favicon: static/img/favicon.ico
  • OG Image: static/img/og-image.png

Edit docusaurus.config.js:

navbar: {
items: [
// Add your nav items
],
}

Edit sidebars.js:

{
type: 'category',
label: 'My Section',
items: ['doc1', 'doc2'],
}

๐Ÿ” Search Configurationโ€‹

Local Search (Default)โ€‹

Already configured - works out of the box.

  1. Sign up at https://docsearch.algolia.com/
  2. Get your API keys
  3. Update docusaurus.config.js:
algolia: {
appId: 'YOUR_APP_ID',
apiKey: 'YOUR_API_KEY',
indexName: 'mcp-adr-analysis-server',
}

๐Ÿ› Troubleshootingโ€‹

Port Already in Useโ€‹

npm run start -- --port 3001

Build Errorsโ€‹

# Clear cache and rebuild
npm run clear
npm run build

Module Not Foundโ€‹

# Reinstall dependencies
rm -rf node_modules package-lock.json
npm install

Docusaurus will warn about broken links during build. Fix them by:

  • Using relative paths: /tutorials/my-doc
  • Checking file exists in docs directory
  • Updating onBrokenLinks in config (not recommended)

๐Ÿ“š Resourcesโ€‹

โœ… Verification Checklistโ€‹

After setup, verify:

  • Dev server starts: npm run start
  • All pages load correctly
  • Navigation works
  • Search works
  • Mermaid diagrams render
  • Code blocks have syntax highlighting
  • Production build succeeds: npm run build
  • GitHub Actions workflow exists: .github/workflows/deploy-docusaurus.yml

๐ŸŽ‰ You're Ready!โ€‹

Your Docusaurus documentation site is now set up and ready to use. Start the dev server and begin editing your documentation!

npm run start

Need Help? Check the full migration guide or Docusaurus documentation.