6. Local Docs-as-Code Scaffold & Repository Hygiene
Repository:
VPS Infrastructure (planovi-vps)• Rule Prefix:BR-DOC• Documented Rules: 3 • Open[TEAM_WHY_NEEDED]Questions: 1
Business Purpose & Actors
- Problem solved: Houses a standalone Astro Starlight documentation build (
docs/) documenting the VPS topology, security, storage, deployment workflows, and troubleshooting runbooks, plus repository ignore hygiene (.gitignore) preventing accidental commits of live.envsecrets, SSL keys, backups, and runtime volumes. - Actors: Infrastructure engineers maintaining VPS documentation; Astro/Starlight build toolchain.
All Features & End-to-End Flows
- Astro Starlight Site (
docs/astro.config.mjs,docs/src/):- Custom zero-dependency Remark plugin
remarkMermaid()converts fenced```mermaidblocks into<pre class="mermaid">...</pre>so Expressive Code does not intercept them, rendered client-side via Mermaid10.9.0CDN with dark/light theme detection (docs/astro.config.mjs:6-69). - Custom
SiteTitle.astrooverride (docs/src/components/SiteTitle.astro:1-115) adds a left-aligned sidebar collapse toggle button persisted inlocalStorageunder keyplanovi_docs_sidebar_collapsed(desktop>= 800pxcollapses sidebar; mobile< 800pxtogglesdata-mobile-menu-expandeddrawer). - 14 Markdown/MDX pages covering Architecture, Services, Developer Guide, Operations, and Troubleshooting.
- Custom zero-dependency Remark plugin
- Repository Ignore Hygiene (
.gitignore:1-28):- Ignores
.env,.env.local,.env.*.local,devops_handover_guide.md,cloudflare-ssl/,*.log,*.metadata.json,volumes/,backups/,supabase/,flutter-app/,migrations/, rootkong.yml,php-app/index.php, anddocs/{node_modules,.astro,dist}/.
- Ignores
Hard Business Rules, Validations, Calculations & Edge Cases
- BR-DOC-01 (Secret & Runtime Exclusion):
.gitignore:1-23excludes live.env,cloudflare-ssl/,backups/,volumes/, andsupabase/runtime function directories from Git tracking. - BR-DOC-02 (Mermaid Rendering Security Level):
docs/astro.config.mjs:54,63initializes Mermaid10.9.0withsecurityLevel: 'loose'and re-runs onastro:after-swapView Transitions. - BR-DOC-03 (Duplicate Docs Portal Drift):
PA-IDEAS/planovi-docsis the live Cloudflare Pages hub (dev-docs-arq.pages.dev,docs.planovi.app), makingplanovi-vps/docs/a secondary copy that can drift from the central portal (it also still uses pre-rebrand styling rather than the#32CA42/#09090BStarlight theme).
State Machines & Data Lifecycle
Static site build (astro build -> docs/dist/).
Technical Contract
- Build Commands:
npm run dev,npm run build,npm run preview(docs/package.json:6-11). - External Dependency:
https://cdn.jsdelivr.net/npm/mermaid@10.9.0/dist/mermaid.min.js.
Cross-Repository Dependencies
- Content in
docs/src/content/docs/mirrors the/vps/tab insidePA-IDEAS/planovi-docs.
Why It Works This Way
- Created during an earlier repo-local Docs-as-Code rollout (commit
d5c2fc0) before documentation was consolidated intoPA-IDEAS/planovi-docs. [TEAM_WHY_NEEDED: Should planovi-vps/docs/ be deprecated/removed once PA-IDEAS/planovi-docs is updated from this blueprint, to prevent engineers from editing stale local docs?]
Debugging, Logs & Common Failure Modes
- Symptom: Diagrams fail to render after client-side page navigation -> Root Cause: Mermaid script did not re-bind on Astro View Transitions -> Verify: Inspect browser console for
mermaiderrors onastro:after-swap-> Fix: Confirmastro.config.mjs:59-68runsmermaid.run({ querySelector: '.mermaid' }).