AI Technical Writer & Knowledge Base Platform
Self-hosted AI technical writing starter scaffold turning PRs, OpenAPI specs, and architecture changes into docs and changelogs while flagging stale pages and enforcing glossary rules.
01. Problem & Context
Engineering teams ship pull requests and OpenAPI schema changes far faster than documentation updates, leaving developer portals with stale endpoint examples, broken cross-references, inconsistent product terminology, and manual release-note bottlenecks.
02. Engineering Solution
Initialized the Phase 3 self-hosted starter scaffold pairing a FastAPI + Pydantic v2 backend (`/api/v1/health{,/live,/ready}`, pure ASGI security-header middleware, fail-fast production secret validation) with a React 18 Vite/Tailwind workspace, PostgreSQL (`pgvector`) + Redis Compose stack, and GitHub Actions CI. Establishes the verified runtime baseline for planned `ingestion/`, `drift/`, `style_lint/`, and `publishing/` domain modules.
03. System Architecture
Verified starter runtime (`backend/app/main.py`, `core/config.py`, `core/middleware.py`, `api/v1/health.py`) paired with a React 18 TypeScript dashboard (`frontend/src/App.tsx`), Docker Compose (`postgres` pgvector, `redis`, `api`, `frontend`, `ollama` profile), and CI pipeline (`ruff`, `mypy`, `pytest`, `tsc`, `vitest`, `vite build`, `npm audit`, Trivy) ready for the four planned technical-writing modules in `docs/ARCHITECTURE.md`.
Core Architectural Components
Verified Starter API, Security Baseline & UI Shell (`/api/v1/health*`)
Shipped FastAPI application with versioned `/api/v1/health`, `/live`, and `/ready` probes, ASGI security-header injection (`X-Request-ID`, `nosniff`, `DENY`), fail-fast `validate_production_security()`, offline `mock`/Ollama/Gemini routing settings, and React 18 live health console.
Planned Domain Module: PR & Spec Ingestion (`ingestion/`)
Blueprint for parsing Git diffs, OpenAPI 3.x / JSON Schema specifications, and Architecture Decision Records (ADRs) into structured documentation change sets.
Planned Domain Module: Stale Doc & Drift Detection (`drift/`)
Blueprint for code-to-documentation freshness scanning that flags outdated endpoints, deprecated configuration flags, and broken internal links.
Planned Domain Modules: Glossary Linting & Editorial Publishing (`style_lint/`, `publishing/`)
Blueprint for deterministic glossary, terminology, readability, and do-not-translate verification plus Markdown/MDX changelog synthesis behind editorial PR approval gates.
04. Notable Engineering Decisions
Deterministic Glossary & Drift Scanners Before LLM Drafting
Style-guide terminology, broken route links, and OpenAPI schema diffs can be checked deterministically; combining rule checks with local LLM drafting avoids silent documentation hallucinations.
Editorial Pull-Request Review Gates Over Direct Repo Writes
Auto-generated changelogs and API docs still require technical accuracy sign-off, so the publishing workflow is architected around reviewable PR proposals and audit trails.
Reproducible Self-Hosted Baseline with Offline CI Verification
Shipping full `ruff`, `mypy`, `pytest`, `tsc`, `vitest`, `vite build`, and Docker Compose checks in the starter guarantees a clean developer experience before adding AST/OpenAPI parsers.
05. Engineering Challenges & Solutions
Challenge: Keeping generated API docs and terminology synchronized with proprietary internal repositories safely.
Engineering Solution: Configured local-first Ollama inference, `mock` deterministic CI execution, and `LLM_REDACT_PII_FOR_CLOUD=true` in the starter runtime configuration.
Challenge: Preventing documentation drift checks from degenerating into noisy false positives.
Engineering Solution: Separated structural extraction (`ingestion/`) and freshness/link checks (`drift/`) from prose style linting (`style_lint/`) in the `docs/ARCHITECTURE.md` module plan.
06. Implementation Highlights
- Verified FastAPI starter with `/api/v1/health`, `/live`, and `/ready` probes plus fail-fast `APP_ENV=production` secret and CORS validation
- Pure ASGI `SecurityHeadersMiddleware` injecting `X-Request-ID`, `X-Content-Type-Options: nosniff`, `X-Frame-Options: DENY`, and production HSTS
- React 18 + TypeScript + Vite + Tailwind starter dashboard with live `/api/v1/health` status check and Vitest + Testing Library unit tests
- PostgreSQL (`pgvector`) + Redis + optional Ollama Docker Compose stack with non-root API and unprivileged Nginx containers
- Documented Phase 3 `docs/ARCHITECTURE.md` blueprint for `ingestion/`, `drift/`, `style_lint/`, and `publishing/` modules behind GitHub Actions CI