This document covers the build and deployment process for the documentation site located in apps/documentation/. It explains how to build the static documentation site using Astro, Starlight, and the Bun runtime, including Makefile orchestration, development workflows, and static output generation.
For information about building and deploying the reference API implementation, see Build System & Workflows.
The documentation site uses a multi-stage build pipeline that transforms Markdown content and Astro components into optimized static HTML/CSS/JS files.
Build Flow:
bun installdist/Sources: Makefile94-112 apps/documentation/package.json1-27
The Makefile provides convenient commands for documentation site operations. Each target is defined in Makefile94-112
| Target | Command | Purpose |
|---|---|---|
documentation-setup | cd apps/documentation && bun install | Install all dependencies |
documentation-dev | cd apps/documentation && bun run dev | Start development server (localhost only) |
documentation-dev-host | cd apps/documentation && bun run dev --host | Start development server (network accessible) |
documentation-build | cd apps/documentation && bun run build | Build static site for production |
documentation-preview | cd apps/documentation && bun run preview | Preview built static site locally |
documentation-clean | Remove build artifacts | Delete .astro, dist, node_modules |
Sources: Makefile94-112
The documentation site uses Bun instead of npm or Node.js for faster performance.
package.jsonMakefile97 shows: cd apps/documentation && bun install
bun install to install dependencies from package.jsonMakefile100 shows: cd apps/documentation && bun run dev
dev script from apps/documentation/package.json6: "dev": "astro dev"Sources: Makefile94-112 apps/documentation/package.json1-27
The production build follows a two-step validation and generation process defined in apps/documentation/package.json8
astro check)Defined in apps/documentation/package.json8: "build": "astro check && astro build"
The @astrojs/check package validates:
.astro and .ts filessrc/content/config.tsIf validation fails, the build stops and error messages are displayed.
astro build)After successful type checking, astro build performs:
Content Processing
.md files in src/content/docs/Component Compilation
.astro components to JavaScriptAsset Optimization
Static HTML Generation
dist/ directorySources: apps/documentation/package.json8 Makefile105-106
The astro build command generates the following directory structure in apps/documentation/dist/:
dist/
├── index.html # Homepage
├── specifications/
│ ├── frontend/
│ │ ├── routing/
│ │ │ └── index.html # Each page as static HTML
│ │ └── ...
│ ├── backend/
│ │ ├── endpoints/
│ │ │ └── index.html
│ │ ├── api-response-format/
│ │ │ └── index.html
│ │ └── ...
│ └── ...
├── _astro/ # Bundled CSS/JS with content hashes
│ ├── index.[hash].js
│ ├── styles.[hash].css
│ └── ...
├── pagefind/ # Search index
│ ├── pagefind.js
│ ├── index/
│ └── ...
└── sitemap.xml # Generated sitemap
| Property | Value |
|---|---|
| Format | Static HTML/CSS/JS |
| Routing | Directory-based (e.g., /specifications/backend/endpoints/) |
| JavaScript | Minimal client-side JS (primarily for search and navigation) |
| Images | Optimized with Sharp, responsive srcsets |
| Cache Strategy | Content-hashed filenames in _astro/ |
| Search | Pre-built index in pagefind/ |
This static output can be deployed to any static hosting service (Netlify, Vercel, Cloudflare Pages, GitHub Pages, etc.) or served by any web server.
Sources: apps/documentation/package.json8 Makefile105-106
make documentation-dev)Command: Makefile99-100
Features:
http://localhost:4321Network Access: Use make documentation-dev-host (Makefile102-103) to expose the server on your local network (accessible via IP address).
make documentation-preview)Command: Makefile108-109
Purpose:
dist/http://localhost:4321)Workflow:
Sources: Makefile99-109 apps/documentation/package.json6-9
The documentation-clean target removes all generated files and installed dependencies.
Command: Makefile111-112
| Scenario | Reason |
|---|---|
| Dependency issues | Corrupted node_modules, version conflicts |
| Build cache problems | Stale .astro cache causing incorrect builds |
| Disk space | Remove large node_modules directory |
| Fresh start | Reset to clean state before debugging |
Sources: Makefile111-112
This diagram shows the typical workflow from setup to deployment:
Sources: Makefile94-112 apps/documentation/package.json1-27
While this repository focuses on the build process, the static output in dist/ can be deployed to various hosting platforms:
| Platform | Deployment Method |
|---|---|
| Netlify | Connect GitHub repo, auto-build on push |
| Vercel | Connect GitHub repo, auto-deploy |
| Cloudflare Pages | Connect GitHub repo, configure build command |
| GitHub Pages | Push dist/ to gh-pages branch |
| AWS S3 + CloudFront | Upload dist/ to S3 bucket |
| Self-hosted | Copy dist/ to web server (nginx, Apache, etc.) |
For automated deployments, configure your hosting platform with:
make documentation-build or bun run buildapps/documentation/distmake documentation-setup or bun installThe static nature of the output ensures compatibility with virtually any hosting solution that can serve HTML files.
Refresh this wiki