Skip to content

System Architecture & Monorepo Overview

Wunderkint AI CRM (wk-crm) is structured as a high-performance pnpm monorepo managed by Turborepo.


wk-crm/
├── apps/
│ ├── web/ # Next.js 16 App Router frontend + tRPC API backend
│ ├── docs/ # Starlight (Astro) documentation site
│ ├── storybook/ # Storybook 8 component workbench for @wk-crm/ui
│ └── whatsapp-bridge/ # Standalone WhatsApp webhooks & real-time socket bridge
├── packages/
│ └── ui/ # @wk-crm/ui shared Radix components & Neobrutalism theme
├── db/
│ └── drizzle/ # Drizzle migration files and schema definitions

  • ORM: Drizzle ORM connecting to Neon PostgreSQL.
  • Schemas: 26 modular schema files located in apps/web/lib/db/schema/.
  • API Layer: 28 tRPC routers located in apps/web/lib/trpc/routers/ handling type-safe RPC procedure execution.

AI agents utilize Google Gemini via custom workflow orchestrators in apps/web/lib/ai/. All agents interface through dedicated REST endpoints under /api/ai/*.


Terminal window
# Run local development server for main app
pnpm dev
# Run documentation site locally
pnpm docs:dev
# Run full project type check
pnpm type-check
# Build documentation site
pnpm docs:build