Packages Reference
Detailed documentation for each internal package.
Raypx is organized as a pnpm monorepo with 11 internal packages under packages/. Each package is published under the @raypx/ scope and linked via the workspace:* protocol, so consuming packages always resolve to the local source.
Import Convention
All internal packages follow a consistent import pattern:
import { createDb } from "@raypx/database"
import { logger } from "@raypx/logger"
import { getAuth } from "@raypx/auth"Package Categories
The 11 packages are grouped into three layers:
Blocks
Infrastructure
Low-level packages that provide shared foundations for the rest of the codebase.
Puzzle
Feature
Packages that encapsulate a specific product capability such as authentication, billing, or email.
Palette
Presentation
Packages that provide UI components, theming, and internationalization.
All Packages
Infrastructure
| Package | Description |
|---|---|
@raypx/env | Type-safe environment variable validation with Zod and Standard Schema support |
@raypx/logger | Structured JSON logging built on Pino |
@raypx/database | Drizzle ORM integration with PostgreSQL connection pooling |
Feature
| Package | Description |
|---|---|
@raypx/auth | Better Auth integration with lazy initialization and social providers |
@raypx/rpc | Type-safe API layer with oRPC procedures and routers |
@raypx/storage | Object storage abstraction backed by unstorage |
@raypx/email | Email sending with Resend and React Email templates |
@raypx/otp | One-time password service for verification flows |
@raypx/billing | Plan limits and billing logic for free and pro tiers |
Presentation
| Package | Description |
|---|---|
@raypx/i18n | Internationalization with use-intl and locale routing |
@raypx/ui | Shared UI components powered by shadcn/ui |
Dependency Rules
- Infrastructure packages must not import feature or presentation packages.
- Feature packages may depend on infrastructure packages but not on other feature packages (with few exceptions).
- The main app (
src/) may import from any package. - Presentation packages are the only layer that may export React components.