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 installStart Development Server
bash
# From root directory
bun run docs:dev
# Or directly
cd services/docs-site && bun run devGenerate API Documentation
bash
# From root directory
bun run docs:generate
# Or directly
cd services/docs-site && bun run generate:apiBuild for Production
bash
# From root directory
bun run docs:build
# Or directly
cd services/docs-site && bun run buildPreview 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-*.mdfiles
These files are regenerated on every build.
🔧 Adding New Documentation
Adding a New API Page
- Create a new
.mdfile inapi/directory - 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
masterbranch - Changes to
services/docs-site/,server/api/, ortypes/
URL: https://sak0a.github.io/cs2inspect-web/
📦 Dependencies
| Package | Purpose |
|---|---|
| vitepress | Static site generator |
| vitepress-plugin-mermaid | Diagram support |
| typedoc | TypeScript documentation |
| typedoc-plugin-markdown | Markdown output for TypeDoc |
| glob | File pattern matching for API scanner |