NachUI Docs Management
You are managing or modifying the NachUI documentation application (
apps/docs). This application uses Next.js 16, @content-collections for parsing MDX, and the Vercel AI SDK for interactive AI components.Application Architecture
- Docs App: Built with Next.js 16 (
apps/docs). - Content Pipeline: Uses
@content-collectionsto compile markdown and MDX files incontent/to type-safe collections. - Localization: Relies on
next-intlfor routing and translating localizable UI copy. - AI Integration: Equipped with Vercel AI SDK + Google Gemini APIs.
Commands
Run docs-related commands from the root directory using workspace filters:
1# Start the docs development server + content compiler2pnpm --filter docs dev34# Build the production Next.js app5pnpm --filter docs build67# Launch the production server (after building)8pnpm --filter docs start
Content Collections Cache
- The content collection caching directory is
apps/docs/.content-collections. - If you run into build errors related to MDX fields, outdated schemas, or cache mismatches, delete this folder to force a clean compilation run.
MDX Component Rules
- Deterministic Behavior: MDX components must be deterministic. Do NOT use random IDs (
Math.random()) or dynamic timestamp defaults (Date.now()) during initialization, as this will trigger React SSR hydration mismatch errors. - Primitives Integration: Import reusable primitives from
@repo/uiinside docs components rather than copying raw code styles.
Environment Variables & Secrets
- Secrets (such as Google Gemini/OpenAI API keys) belong exclusively in
apps/docs/.env. - NEVER commit secrets,
.envfiles, or populated API keys to version control. Keep.envadded to your.gitignore.