ShipAI Docs
Codebase

Packages

Package-level ownership map for shared platform modules.

Shared packages provide most domain and platform capabilities used by all apps.

Boundary principle

If logic is reused across multiple apps, it should usually live in packages/* with an explicit public API in exports.

Core domain packages include @ai/db, @ai/auth, @ai/billing, @ai/stripe, and @ai/features.

Infrastructure and observability packages include @ai/kv, @ai/jobs, @ai/storage, @ai/logger, and @ai/tracing.

Support packages include @ai/ui, @ai/i18n, @ai/email, @ai/analytics, and @ai/branding.

Core data, auth, and platform

  • @ai/db: Drizzle schema, DB client, queries, migrations, and seeds.
  • @ai/auth: Better Auth setup and shared auth helpers/plugins.
  • @ai/i18n: Shared locale/routing/request/message utilities around next-intl.
  • @ai/ui: Shared component library and global styling assets.

Billing and payments

  • @ai/billing: usage/limit checks, limit response helpers, token accounting, and cost calculation.
  • @ai/stripe: Stripe client and checkout/customer/portal/webhook helpers.

AI, memory, and retrieval-adjacent modules

  • @ai/memory: memory client/types/config/prompts used by app memory flows.
  • @ai/converter: document conversion client/helpers used in comparison and file-processing paths.
  • @ai/features: centralized feature flags + service availability from environment variables.

Infra and observability

  • @ai/kv: Redis clients and rate limiting helpers.
  • @ai/jobs: BullMQ queues + worker entrypoint/schedulers/workers.
  • @ai/logger: structured logging + log/metric exporter helpers.
  • @ai/tracing: tracing primitives, wrappers, context propagation, streaming helpers.
  • @ai/storage: S3-compatible storage utilities.

Product/UX support packages

  • @ai/analytics: OpenPanel integration helpers for server/client event tracking.
  • @ai/email: React Email templates and preview scripts.
  • @ai/branding: branding config/types/defaults for white-label customization.

Dependency Direction (Intended)

  1. Low-level infra/data packages (db, kv, storage) are foundational.
  2. Domain packages (auth, billing, jobs, memory, stripe) build on those foundations.
  3. App packages (apps/*) orchestrate package capabilities at route/action boundaries.

Package Design Conventions

  • each package owns its API via exports in package.json
  • each package ships its own scripts (lint, typecheck, and more)
  • workspace dependencies use workspace:*
  • cross-cutting concerns stay package-level so apps remain orchestration-focused

On this page