Packages (packages/*)
The packages/ directory contains 24 shared packages that provide domain logic, infrastructure, and UI components consumed by the apps.
Overview
Each package is a self-contained workspace with its own package.json, moon.yml, and tsconfig.json. Packages follow the same Clean Architecture principles as the rest of the monorepo, with pure domain logic separated from infrastructure concerns.
Package List
| Package | Path | Description |
|---|---|---|
@booking/ai | packages/ai | AI integration utilities and OpenAI helpers |
@booking/auth | packages/auth | Authentication, session management, and Supabase integration |
@booking/billing | packages/billing | Billing and subscription domain logic |
@booking/bookings | packages/bookings | Booking domain logic and types |
@booking/chat | packages/chat | Real-time chat domain logic |
@booking/communication | packages/communication | Email, SMS, and notification dispatch |
@booking/config | packages/config | App configuration and environment management |
@booking/database | packages/database | Drizzle ORM schema, migrations, and queries |
@booking/devtools | packages/devtools | Developer tools and debugging utilities |
@booking/feature-flags | packages/feature-flags | Feature flag management and evaluation |
@booking/infrastructure | packages/infrastructure | Server infrastructure, middleware, and oRPC setup |
@booking/layout | packages/layout | App layout components (header, footer, navigation, sidebar) |
@booking/notifications | packages/notifications | Notification system and preferences |
@booking/payments | packages/payments | Payment processing and Stripe integration |
@booking/provider | packages/provider | Provider domain logic and types |
@booking/rbac | packages/rbac | Role-based access control (5 roles, 30+ permissions) |
@booking/reviews | packages/reviews | Review and rating domain logic |
@booking/search | packages/search | Search and filtering domain logic |
@booking/settings | packages/settings | User and provider settings domain logic |
@booking/shared | packages/shared | Shared utilities, types, and common helpers |
@booking/support | packages/support | Support ticket domain logic |
@booking/ui | packages/ui | Shared UI component library |
@booking/user | packages/user | User profile, verification, and management |
Usage
Packages are consumed by apps via workspace references:
typescript
import { authMiddleware } from "@booking/auth";
import { db } from "@booking/database";
import { checkPermission } from "@booking/rbac";
import { Button } from "@booking/ui";Key Scripts
Each package follows the standard monorepo task set:
bash
# Run tasks for a specific package
moon run packages-auth:lint
moon run packages-database:typecheck
moon run packages-rbac:test
# Run tasks for all packages
moon run :lint --query 'stack == "frontend" || stack == "backend"'Architecture
Most packages follow a Clean Architecture layout:
packages/<name>/
├── src/
│ ├── index.ts # Package entry point (barrel export)
│ ├── domain/ # Pure business logic (no side effects)
│ ├── application/ # Orchestration layer
│ └── adapters/ # I/O layer (side effects only)
├── biome.jsonc # Workspace-specific lint config
├── moon.yml # Moonrepo task config
├── tsconfig.json # TypeScript config
└── package.json # Package manifestRelated
- Project Overview — Monorepo structure
- Architecture Overview — Clean Architecture principles
- Workspaces — All workspace details