Architecture

Shared Packages

Overview of the 21 shared packages in the @hn-monorepo namespace

Import Pattern

All shared packages are imported via the @hn-monorepo/{package} namespace:

import { Button } from "@hn-monorepo/ui/components/button"
import { createAuthConfig } from "@hn-monorepo/auth"
import { stripe } from "@hn-monorepo/billing"

Each package defines an exports field in its package.json to control the public API. Internal dependencies between packages use workspace:*.

Package Categories

Configuration

PackageDescription
configShared environment validation using t3-env
config-biomeShared Biome linting and formatting configuration
config-typescriptShared TypeScript compiler configuration

UI

PackageDescription
uiShared UI component library built on shadcn/ui
sharedShared utilities, hooks, and types used across apps

Backend and Data

PackageDescription
authConvex auth provider pattern and wrappers
billingStripe billing integration and subscription logic
convex-helpersConvex utility helpers for common operations
storageFile storage utilities
apiShared API utilities
securitySecurity utilities

AI and Integrations

PackageDescription
aiAI provider abstractions (Anthropic, OpenAI, OpenRouter)
emailEmail templates and sending via React Email + Nodemailer
i18nInternationalization using next-intl
analyticsAnalytics event tracking abstraction
monitoringOpenTelemetry + SigNoz error monitoring

Planex-Specific

PackageDescription
planex-cliPlanex CLI tool
planex-engineCore engine for AI blueprint generation

Other

PackageDescription
changelogChangelog generation utilities
signageDigital signage utilities
testingShared test configuration, fixtures, and mocks

Package Rules

  1. Packages depend on packages, never on apps@hn-monorepo/billing can import @hn-monorepo/analytics, but never from calnexus
  2. Packages are small and focused — each has a single, clear purpose
  3. Packages export only what is needed — use index.ts to control the public API
  4. Packages are tree-shakeable — export individual functions/components, avoid side effects
  5. Apps can contain app-specific logic — not everything needs to be a package

Creating a New Package

See Adding Packages for a step-by-step guide.

HanseNexus 2026