Skip to content

Documentation System

KoAkademy enforces a single-source documentation workflow:

  1. Root Markdown files are canonical for foundational technical documents (installation, deployment, architecture, contributing, troubleshooting).
  2. The Astro Starlight documentation website and the in-app docs viewer consume automatically generated MDX mirrors.
  3. Specialized guides (System Internals, Maintainers, User Guides, Enrollment Blueprints, API Reference) are native MDX files authored directly under docs/src/content/docs/.
Canonical Root Docs (e.g. CONTRIBUTING.md)
├──▶ npm run docs:sync (scripts/sync-docs.mjs)
│ └── Generates MDX mirrors with frontmatter & warning headers
└──▶ npm run docs:check (scripts/check-docs.mjs)
├── Validates mirrors are up to date
├── Checks that internal links resolve correctly
└── Verifies API contract documentation

Mapping of Canonical Files to Generated Mirrors

Section titled “Mapping of Canonical Files to Generated Mirrors”
Canonical Root FileGenerated Site MirrorSidebar Placement
GETTING_STARTED.mddocs/src/content/docs/self-hosting/installation.mdxSelf-Hosting → Installation
DEPLOYMENT.mddocs/src/content/docs/self-hosting/deployment.mdxSelf-Hosting → Deployment
CONFIGURATION.mddocs/src/content/docs/self-hosting/configuration.mdxSelf-Hosting → Configuration
TROUBLESHOOTING.mddocs/src/content/docs/self-hosting/troubleshooting.mdxSelf-Hosting → Troubleshooting
FAQ.mddocs/src/content/docs/self-hosting/faq.mdxSelf-Hosting → FAQ
DEVELOPMENT.mddocs/src/content/docs/start-here/development.mdxStart Here → Development
ARCHITECTURE.mddocs/src/content/docs/start-here/architecture.mdxStart Here → Architecture
CONTRIBUTING.mddocs/src/content/docs/start-here/contributing.mdxStart Here → Contributing

Decision Table: Where to Write New Documentation

Section titled “Decision Table: Where to Write New Documentation”
If you are writing…Edit this locationWorkflow
Setup, installation, or server deploymentGETTING_STARTED.md or DEPLOYMENT.mdEdit root file ➔ run npm run docs:sync ➔ commit both
Environment variables or service configCONFIGURATION.mdEdit root file ➔ run npm run docs:sync ➔ commit both
Contributor workflows, testing rules, setupCONTRIBUTING.md or DEVELOPMENT.mdEdit root file ➔ run npm run docs:sync ➔ commit both
High-level runtime or architecture overviewARCHITECTURE.mdEdit root file ➔ run npm run docs:sync ➔ commit both
Deep system internals (auth, frontend, queues)docs/src/content/docs/system/*.mdxEdit native MDX directly
Module development or maintainer processesdocs/src/content/docs/maintainers/*.mdxEdit native MDX directly
User and staff operational guidesdocs/src/content/docs/user-guide/*.mdxEdit native MDX directly
Enrollment blueprint engine guidesdocs/src/content/docs/enrollment-policies/*.mdxEdit native MDX directly
Public REST API referencedocs/src/content/docs/api/*.mdxEdit native MDX directly

Always run the full documentation verification before pushing:

Terminal window
# 1. Sync any canonical changes to their mirrors
npm run docs:sync
# 2. Check for stale mirrors and broken internal links
npm run docs:check
# 3. Test the Astro production build locally
npm --prefix docs run build
  • Framework: Astro 5 with @astrojs/starlight and @astrojs/mdx.
  • Search: Built-in client-side Pagefind indexing.
  • Typography & Styling: Self-hosted @fontsource/inter and @fontsource/jetbrains-mono with custom CSS matching the application’s shadcn/ui palette (docs/src/styles/custom.css).
  • Sidebar Navigation: Configured explicitly in docs/astro.config.mjs.
  • In-App Integration: The same generated documentation files are rendered inside the running application at /docs.

The documentation site is automatically built and deployed to GitHub Pages on documentation changes merged into master via .github/workflows/deploy-docs.yml.

When deploying:

  1. Ensure GitHub Pages is configured with Source: GitHub Actions in repository settings.
  2. The site publishes to https://yukazakiri.github.io/koakademy/.