Skip to content

CS2Inspect Documentation Site

This is the documentation site for CS2Inspect, built with VitePress.

📖 Structure

services/docs-site/
├── .vitepress/
│   └── config.ts         # VitePress configuration
├── api/                  # API documentation
│   ├── index.md         # API overview
│   ├── authentication.md # Auth docs
│   ├── health.md        # Health check docs
│   ├── data.md          # Data endpoints
│   ├── loadouts.md      # Loadout management
│   ├── items.md         # Item management
│   ├── inspect.md       # Inspect system
│   ├── errors.md        # Error handling
│   └── api-*.md         # Auto-generated endpoint docs
├── scripts/
│   └── generate-api-docs.ts  # API documentation generator
├── typedoc.json         # TypeDoc configuration
└── package.json

🚀 Development

Install Dependencies

bash
# From root directory
bun run docs:install

# Or directly
cd services/docs-site && bun install

Start Development Server

bash
# From root directory
bun run docs:dev

# Or directly
cd services/docs-site && bun run dev

Generate API Documentation

bash
# From root directory
bun run docs:generate

# Or directly
cd services/docs-site && bun run generate:api

Build for Production

bash
# From root directory
bun run docs:build

# Or directly
cd services/docs-site && bun run build

Preview Production Build

bash
# From root directory
bun run docs:preview

# Or directly
cd services/docs-site && bun run preview

📝 Documentation Types

1. Hand-Written Documentation

Located in api/*.md (except api-*.md), these are manually curated, detailed guides:

  • Authentication - JWT tokens, Steam OpenID flow
  • Health Checks - Kubernetes probes, monitoring
  • Data Endpoints - Static data API
  • Loadouts - User loadout management
  • Items - Weapon customization
  • Inspect System - CS2 inspect URL processing
  • Error Handling - Error codes and responses

2. Auto-Generated Documentation

Generated by scripts/generate-api-docs.ts from the actual API source code:

  • Scans server/api/ directory
  • Extracts route information, methods, parameters
  • Parses JSDoc comments
  • Generates api/api-*.md files

These files are regenerated on every build.

🔧 Adding New Documentation

Adding a New API Page

  1. Create a new .md file in api/ directory
  2. Add it to the sidebar in .vitepress/config.ts

Improving Auto-Generated Docs

Add JSDoc comments to your API endpoints:

typescript
/**
 * Description of what this endpoint does
 * 
 * @param {string} steamId - User's Steam ID
 * @returns {LoadoutResponse} The user's loadouts
 */
export default defineEventHandler(async (event) => {
  // ...
})

🚢 Deployment

Documentation is automatically deployed to GitHub Pages via the workflow at .github/workflows/deploy-docs.yml.

Triggers:

  • Push to master branch
  • Changes to services/docs-site/, server/api/, or types/

URL: https://sak0a.github.io/cs2inspect-web/

📦 Dependencies

PackagePurpose
vitepressStatic site generator
vitepress-plugin-mermaidDiagram support
typedocTypeScript documentation
typedoc-plugin-markdownMarkdown output for TypeDoc
globFile pattern matching for API scanner

Built with ❤️ by the CS2Inspect community